1. Create Task
  • Get Started
  • API Reference
    • Create Task
      • Image To Video
        POST
      • Instruct Edit
        POST
      • Try-On (Apparel)
        POST
      • Try-On (Accessories)
        POST
      • Lifestyle Scene
        POST
      • Swap Fashion Model
        POST
      • Background Replacer
        POST
      • Segment Image By Prompt
        POST
      • Segment Image By Type
        POST
    • Get Upload URL
      GET
    • Upload File
      PUT
    • List Preset Materials
      GET
    • Retrieve Generation Task Status
      GET
    • Download Generated Result
      GET
    • Retrieve API Credit Usage
      GET
  • Help
    • Download File Samples
    • Error Codes
    • FAQ
  1. Create Task

Segment Image By Type

POST
https://api.sellerpic.ai/v1/api/generate/segmentImage
You can retrieve a black-and-white Mark image through this API interface.
1-original.pngProduct Image
50860d1854e94e7a96f1db3075831235_mask_output.pngProduct Mask(Alpha Channel Mask - Black and White)
Before creating a task, please ensure all required resources have been uploaded.
1.
Request Upload File URL
2.
Upload File
Upload file limit:
Supported formats: JPG/JPEG/PNG/WEBP (no animations)
Max image resolution: 2000px
Credit Cost
This task requires 0 credits.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.sellerpic.ai/v1/api/generate/segmentImage' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "imageKey": "string",
    "type": "string",
    "expandPixels": 0
}'
Response Response Example
200 - Example 1
{
    "code": 0,
    "data": {
        "id": "string"
    },
    "msg": "string",
    "success": true,
    "traceId": "string"
}

Request

Header Params
Authorization
string 
required
Example:
Bearer YOUR_API_KEY
Content-Type
string 
required
Example:
application/json
Body Params application/json
imageKey
string 
required
Image storage key
type
string 
optional
Segmentation type (Must be one of COMMON, HUMAN_BODY, PRODUCT, CLOTH, HAIR, FACE, BAG, BRACELET, WATCH, EARRING, RING, SHOE, HAIR_ACCESSORY, GLASSES, HAT, CAP, NECKLACE), default is COMMON
expandPixels
integer 
optional
Expand/dilate the mask by specified pixels, default is 5,max is 20
Examples

Responses

🟢200OK
*/*
OK
Body
code
integer <int32>
required
Result code, where 0 indicates success and non-0 indicates an error.
Please refer to Error Codes
data
object (IdData«string») 
optional
id
string 
required
Task Id
msg
string 
optional
Description of the result, providing additional context or information about the operation outcome.
success
boolean 
required
traceId
string 
required
Trace ID for tracking the request across distributed systems.
🟢201Created
🟠401Unauthorized
🟠403Forbidden
🟠404Record Not Found
Modified at 2025-06-11 06:29:58
Previous
Segment Image By Prompt
Next
Get Upload URL
Built with