Doc (beta)
Agent

AI Agents

Lasted Updated:2025-05-13

Overview

AI agent is a core concept in WeShop AI, representing different agents and tools we have that tailored to your needs. Please refer to https://www.weshop.ai/agent (opens in a new tab) if you need more information. In WeShop AI, users need to select the appropriate agent(s) to start the task. Each agent includes detailed instructions to help users precisely choose the right agent.

Relevant interfaces of AI agents, please refer to AI Agents Reference Interface,Below is an introduction to the generic interfaces for different AI agents. For detailed usage methods of different agents, please visit the specific agent for more information.

AI Model

Showcase clothing with a variety of models that aligns with your brand’s aesthetic

Basic Information

AgentName

aimodel 

AgentVersion

- v1.0

Note

  • When executing the task, please select at least one or more parameters from fashionModelId, locationId, and textDescription to execute.

    • If you prefer to use the template, you can provide the locationId and fashionModelId parameters. You can query the valid locationId and fashionModelId values through the AI entity's info API.
    • If you want to describe the image you want to generate with words/phrases/sentences, you can assign a value to the textDescription parameter.
    • Mask settings:
      • If you only need to keep the clothing on the model unchanged, please set maskType to "autoApparelSegment" when executing the task. The AI entity will use automatic apparel segmentation technology to generate the mask image, and you do not need to provide customMask and customMaskUrl parameters at this time.

      • If you only need to change the background without replacing the model's face, please set maskType to "autoSubjectSegment" when executing the task. The AI entity will use automatic subject segmentation technology to generate the mask image, and you do not need to provide customMask and customMaskUrl parameters at this time.

      • If you need to select the areas to keep unchanged on your own instead of using automatic segmentation, please prepare the mask image before the operation and set maskType to "custom" when executing the task. In this case, you need to provide either customMask or customMaskUrl parameter.

Tasks

Create Task

Request Parameters

  • initParams

Parameters Sample:

{
    "initParams": {
        "taskName": "Create Task Api Test",
        "originalImage": "https://ai-image.weshop.ai/xxxxxxxx.png"
    }
}
Parameter NameRequiredTypeDescriptionNotes
taskNameNostringTask nameDo not exceed 20 characters
originalImageYesstringOriginal imageWhen using an external image link, you must ensure that the image link is publicly accessible on the internet.

Response Parameters

  • data
Parameter NameRequiredTypeDescriptionNotes
taskIdYesstringTask ID - Unique Identifier/

Task Execution

Parameter Matching Guide

Parameter Combinations for Different Use Cases

  • Change Model and Location: Achieve the effect of changing the model and location without altering the clothing in the image.

    Parameters Sample

    {
        "params": {
            "pose": "originalImagePose",
            "generatedContent": "freeCreation",
            "maskType": "autoApparelSegment",
            "locationId": "<Location Id>", // Required. The location to be changed
            "fashionModelId": "<Fashion Model Id>", //  Required. The model to be changed
        }
    }

change_model_bg

  • Change Model: Replace the model while keeping the background and clothing unchanged.

    Parameters Sample

    {
        "params": {
            "pose": "originalImagePose",
            "generatedContent": "referToOrigin",
            "maskType": "autoHumanSegment",
            "fashionModelId": "<Fashion Model Id>", //  Required. The model to be changed
        }
    }

change_model

  • Virtual Try-On: Apply clothing from one image onto a person in another location image, achieving a virtual try-on effect.

    Parameters Sample

    {
        "params": {
          	"pose": "freePose", // 'referenceImagePose' will result in minimal changes to the character's pose.
            "generatedContent": "freeCreation",
            "maskType": "autoApparelSegment",
            "locationId": "<Location Id>", // Required. The clothes will be worn by the character in the scene.
            "fashionModelId": "<Fashion Model Id>", //  Required. The model to be changed
        }
    }

    ootd

Request Parameters

  • params
Parameter NameRequiredTypeDescriptionNotes
generatedContentYesstringSelect algorithm preference:
"freeCreation":Free creation
"referToOrigin":Refer to the original image
1. FreeCreation free creation will make the resulting image more free, without being constrained by the style of the uploaded original image.
2. referToOrigin reference original image will make the resulting image refer to the style of the uploaded original image during the generation process.
maskTypeYesstringSelect mask type: "autoApparelSegment": Automatic apparel segmentation
"autoUpperApparelSegment":Automatic Upper Body Clothing Segmentation
"autoLowerApparelSegment":Automatic Lower Body Clothing Segmentation
"autoSubjectSegment": Automatic subject segmentation
"autoHumanSegment":Auto human segment
"inverseAutoHumanSegment":The inverted selection of the automatic human segmentation result
"custom": Manually upload mask information
1.autoApparelSegment automatic apparel segmentation is consistent with the 'change BG & face' on the web page.
2.Automatic Upper Body Clothing Segmentation: Automatically masks and selects upper body clothing, such as jackets, T-shirts, etc.
3.Automatic Lower Body Clothing Segmentation: Automatically masks and selects lower body clothing, such as pants, shorts, etc.
4. autoSubjectSegment automatically segments the subejct and background , consistent with the 'change BG' on the web page. When executing this mask type, the provided fashionModelId will not take effect.
5.autoHumanSegment automatically segments the human figure, consistent with the 'change face' on the web page. When executing this mask type, the provided locationId will not take effect.
6.inverseAutoHumanSegment
example:

7. For manual upload, ensure the uploaded mask image has the same dimensions as the original image.
customMaskNostringUpload the base64 encoded mask image1. When the mask type is "custom", this parameter must be uploaded, otherwise no need to upload.
2. The area outside the mask region is transparent.
3. Use base64 encoding, without the prefix "data:image/png;base64".
4. Must have the same dimensions as the original image.
customMaskUrlNostringURL of the uploaded mask imageWhen using an external image link, you must ensure that the image link is publicly accessible on the internet. The image format requirements are the same as customMask.
locationIdNointLocationOptional
locationTagIdsNoarray[int]Location tagsOptional, please refer to Locations
fashionModelIdNointModelOptional
fashionModelTagIdsNoarray[int]Model tagsOptional, please refer to FashionModels
textDescriptionNostringText description of the content (optional)Optional
negTextDescriptionNostringDescription of content you don't want to appear (optional)Optional
resultImageFormatNostringSelect the format of the generated result image, options: "jpg" "png" (default is png)Default is png
resizeToOriginalImageNoboolWhether to resize the generated result image to the original image dimensionsDefault is false
batchCountNointSet the number of images to generate in this execution, minimum is 1, maximum is 16Default is 4, values out of range will use the default
poseNoStringSelect Model AIPose:
"originalImagePose":Original Image Pose
"referenceImagePose":Reference Image Pose
"freePose":Free Pose
Default is originalImagePose.
1.originalImagePose:Suitable for model image, product details remain unchanged.
2.referenceImagePose:Suitable for model, mannequin, and flat lay, product will adjust to pose changes.
3.freePose:Suitable for model, mannequin, and flat lay, AI free pose, product will adjust to pose changes.

Response Parameters

  • data
Parameter NameRequiredTypeDescriptionNotes
executionIdYesstringExecution ID - the unique identifier/

Query Task

Request Parameters

  • json format, parameters sample
{
    "executionId":"<execution id>"
}
Parameter NameRequiredTypeDescriptionNotes
executionIdNostringExecution ID/
taskIdNostringTask IDIf the taskId parameter is passed, at most the last 20 execution records will be returned.

Response Parameters

  • initParams

Current task's initial information

Parameter NameRequiredTypeDescriptionNotes
taskNameYesstringTask name/
originalImageYesstringOriginal image/

  • executions

Execution information

Parameter NameRequiredTypeDescriptionNotes
executionIdYesstringExecution ID/
statusYesstringExecution status:
Segmenting:In automatic segmentation
Pending:Queuing
Running :In progress
Success:Completed
/
paramsYesobjectTask execution related parameters/
executionTimeYesstringTask execution timestamp/
resultsYesarray[object]Task execution result information/

  • result

Execution result

Parameter NameRequiredTypeDescriptionNotes
statusYesstringExecution results
Running
Success
Failed
Pending
/
imageYesstringThe generated final image/
progressNostringProcessing progress, e.g. 0.71 means 71% has been processed/
errorNostringInformation if processing failedWhen the status is "Failed", this field will definitely be returned.

Information Query

Query information related to the AI agent. By passing in the agent name (agentName) and version number (agentVersion), you can obtain the corresponding configuration parameter information.

Request Parameters

Parameter NameRequiredTypeDescriptionNotes
agentNameYesstringAgent name:
"aimodel"
/
agentVersionYesstringAgent version:
"v1.0"
/

Response Parameters

  • data
Parameter NameRequiredTypeDescriptionNotes
locationsYesarray[object]Location information1. You can obtain complete Locations information through the AI agent information query interface (apiReference#info)
2. Please refer to the Locations data structure for details.Locations
fashionModelsYesarray[object]Model information1. You can obtain complete Locations information through the AI agent information query interface (apiReference#info)
2. Please refer to the Locations data structure for details.FashionModels
agentVersionYesstringAgent version/

Locations

  • location data structure
Parameter NameRequiredTypeDescriptionNotes
idYesintLocation ID/
imageYesstringLocation image/
nameYesstringLocation name/
categoriesYesarray[string]Location category/
tagsNoarray[object]Location tags/
statusNostringStatus of generation:
prepare: Prepare to generate
complete: Complete the generation
failed: Failed to Generation
Only when the status is complete, the location is ready for use.
typeYesstringModel type:
AI: Officially provided location
Yours: User-created location
/

  • tag data structure
Parameter NameRequiredTypeDescriptionNote
idYesintLocation ID(locationTagIds)/
nameYesstringLocation name/

locations

[
    {
 
        "id": 6000372,
        "image": "https://ai-global-image.weshop.com/b58e3c41-e7c3-4101-9c7c-ee2847b7c491_728x1088.png",
        "name": "White Studio",
        "categories": ["womenswear"],
        "tags": [
            {
                "id": 1002035,
                "name": "Film grain"
            },
          
            ......
          
            {
                "id": 1002036,
                "name": "Spot light"
            }
        ]
    },
  
      ......
  
    {
        "id": 6000392,
        "image": "https://ai-global-image.weshop.com/c8da5b9d-51c6-47a5-a41e-19328528e0ca_552x832.png",
        "name": "French Flagstone Pavement",
        "categories": ["menswear"],
        "tags": [
            {
                "id": 1002035,
                "name": "Film grain"
            },
          
            ......
          
            {
                "id": 1002036,
                "name": "Spot light"
            }
        ]
    }
  
    ......
]

FashionModels

  • fashionModel data structure
Parameter NameRequiredTypeDescriptionNotes
idYesintModel ID/
imageYesstringModel image/
nameYesstringModel name/
profileNoobjectModel informatoin, including country, style etc/
typeYesstringModel type:
AI: Officially provided model
Yours: User-created model
/
tagsNoarray[object]Model tags/
statusYesstringStatus when generating model:
prepare: prepare to generate
complete: generation is complete
failed: fail to generate
Only when the status is complete, the model is ready for use.
  • profile data structure
Parameter NameRequiredTypeDescriptionNotes
nationalityNointNationality of model/
styleNostringStyle of model/
priceDescriptionNostringPricing of model/
  • tag data structure
Parameter NameRequiredTypeDescriptionNotes
idYesintModel tag ID(fashionModelTagIds)/
nameYesstringModel tags/

fashionModels

[
    {
        "id": 4020082,
        "image": "https://ai-global-image.weshop.com/ebcdbdcf-be9c-463b-bcd9-bebcf058b112_763x763.png",
        "name": "Letitia",
        "profile": {
            "nationality": "Spain",
            "priceDescription": "Additional cost of 5 points / image",
            "style": "Chic, Sexy, Sophisticated"
        },
        "tags": [
            {
                "id": 1002003,
                "name": "Smiling"
            },
          
            ......
          
            {
                "id": 1002032,
                "name": "Lying"
            }
        ],
        "type": "AI"
    },
  
      ......
  
    {
        "id": 4020095,
        "image": "https://ai-global-image.weshop.com/a20ec42f-08b6-4b81-a4ea-36ce4a37fd2f_680x1024.png",
        "name": "Eve",
        "profile": {
            "nationality": "Poland",
            "priceDescription": "Additional cost of 5 points / image",
            "style": "Sweet, Cute"
        },
        "tags": [
            {
                "id": 1002003,
                "name": "Smiling"
            },
          
            ......
          
            {
                "id": 1002020,
                "name": "Fashionable"
            }
        ],
        "type": "AI"
    },
]

Extended API

My Models

Create My Model
POST https://openapi.weshop.ai/openapi/v1/agent/myFashionModel/create

Upload a model image (images) and specify the model's name (name) that meet the requirements. Each account can create up to 1000 entries.

Request Parameters

  • JSON Format
Parameter NameRequiredTypeDescriptionNotes
imagesYesarray[object]Uploaded model images1. Upload up to 4 images.
2. When using external image links, ensure the links are publicly accessible.
3. Image size must not exceed 5MB.
4. Supported image formats: png, jpeg, jpg, webp.
5. The image should fully display facial features, with a front-facing view. Light makeup or no makeup is preferred.
nameYesstringModel name/
agentNameYesstringAgent name:
'aimodel'
/
agentVersionYesstringAgegnt version:
'v1.0'
/

Response Parameters

  • data
Parameter NameRequiredTypeDescriptionNotes
fashionModelIdYesintMy model ID/

CURL Request Example

curl --location 'https://openapi.weshop.ai/openapi/v1/agent/myFashionModel/create' \
--header 'Authorization: <API Key>' \
--header 'Content-Type: application/json' \
--data '{
    "images": [
        "https://ai-image.weshop.ai/xxxxxxxx.png"
    ],
    "name": "fashionModelName",
    "agentName": "aimodel",
    "agentVersion" : "v1.0"
}'

Response Example

{
    "success": true,
    "code": "0",
    "msg": "success",
    "data": {
        "fashionModelId":00000000001
    }
}

Query My Models
GET https://openapi.weshop.ai/openapi/v1/agent/myFashionModel/query

Pass in the model ID (fashionModelId).

Request Parameters

Parameter NameRequiredTypeDescriptionNotes
fashionModelIdYesstringMy model ID/

Response Parameters

  • data
Parameter NameRequiredTypeDescriptionNotes
fashionModelIdYesintMy model ID/
nameYesstringModel name/
coverYesstringModel cover photo/
imagesYesarray[string]All images uploaded/
statusYesstringStatus when generating model:
prepare: prepare to generate
complete: generation is complete
failed: fail to generate
Only when the status is complete, the model is ready for use.

CURL Request Example

curl --location 'https://openapi.weshop.ai/openapi/v1/agent/myFashionModel/query?fashionModelId=<My model Id>' \
--header 'Authorization: <API Key>'

Response Example

{
    "success": true,
    "code": "0",
    "msg": "success",
    "data": {
        "cover": "https://ai-image.weshop.ai/xxxxxxxx.png",
        "fashionModelId": 00000000001,
        "images": [
            "https://ai-image.weshop.ai/xxxxxxxx.png"
        ],
        "name": "fashionModelName",
        "status": "complete"
    }
}

Delete My Model
POST https://openapi.weshop.ai/openapi/v1/agent/myFashionModel/delete

Pass in the model ID (fashionModelId) to delete the model.

Request Parameters

  • JSON Format
Parameter NameRequiredTypeDescriptionNotes
fashionModelIdYesintMy model ID/

Response Parameters

None

CURL Request Example

curl --location 'https://openapi.weshop.ai/openapi/v1/agent/myFashionModel/delete' \
--header 'Authorization: <API Key>' \
--header 'Content-Type: application/json' \
--data '{
    "fashionModelId": <fashionModelId>
}'

Response Example

{
    "success": true,
    "code": "0",
    "msg": "success"
}

Replicate Your Descired Location


Create My Location
POST https://openapi.weshop.ai/openapi/v1/agent/myLocation/create

Upload a location image and specify the location's name that meet the requirements. Each account can create up to 1000 entries.

Request Parameters

  • JSON Format
Parameter NameRequiredTypeDescriptionNotes
imageYesstringImages uploaded1. When using external image links, ensure that the image links are publicly accessible.
2. The resolution must not be lower than 512x512.
3. The image size must not exceed 5MB.
4. Supported image formats: png, jpeg, jpg, webp.
5. Images should include both a model and a location.
nameYesstringLocation name/
agentNameYesstringAgent name:
'aimodel'
/
agentVersionYesstringAgent version:
'v1.0'
/

Response Parameters

  • data
Parameter NameRequiredTypeDescriptionNotes
locationIdYesintMy location ID/

CURL Request Example

curl --location 'https://openapi.weshop.ai/openapi/v1/agent/myLocation/create' \
--header 'Authorization: <API Key>' \
--header 'Content-Type: application/json' \
--data '{
    "image": "https://ai-image.weshop.ai/xxxxxxxx.png",
    "name": "locationName",
    "agentName": "aimodel",
    "agentVersion" : "v1.0"
}'

Response Example

{
    "success": true,
    "code": "0",
    "msg": "success",
    "data": {
        "locationId": 00000000001
    }
}

Query My Location
GET https://openapi.weshop.ai/openapi/v1/agent/myLocation/query

Pass in the location ID (locationId).

Request Parameters

Parameter NameRequiredTypeDescriptionNotes
locationIdYesstringMy Location ID/

Response Parameters

  • data
Parameter NameRequiredTypeDescriptionNotes
locationIdYesintMy location ID/
nameYesstringLocation name/
coverYesstringLocation cover photo/
imageYesstringUploaded location image/
statusYesstringStatus of generation:
prepare: Prepare to generate
complete: Complete the generation
failed: Failed to Generation
Only when the status is complete, the location is ready for use.

CURL Request Example

curl --location 'https://openapi.weshop.ai/openapi/v1/agent/myLocation/query?locationId=<My location ID>' \
--header 'Authorization: <API Key>'

Response Example

{
    "success": true,
    "code": "0",
    "msg": "success",
    "data": {
        "cover": "https://ai-image.weshop.ai/xxxxxxxx.png",
        "locationId": 00000000001,
        "image": "https://ai-image.weshop.ai/xxxxxxxx.png",
        "name": "locationName",
        "status": "complete"
    }
}

Delete My Location
POST https://openapi.weshop.ai/openapi/v1/agent/myLocation/delete

Pass in the location ID (locationId) to delete the location.

Request Parameters

  • JSON Format
Parameter NameRequiredTypeDescriptionNotes
locationIdYesintMy location ID/

Response Parameters

None

CURL Request Example

curl --location 'https://openapi.weshop.ai/openapi/v1/agent/myLocation/delete' \
--header 'Authorization: <API Key>' \
--header 'Content-Type: application/json' \
--data '{
    "locationId": <locationId>
}'

Response Example

{
    "success": true,
    "code": "0",
    "msg": "success"
}

AI Product

Create stunning product images with few clicks from anywhere

Basic Information

AgentName

aiproduct 

AgentVersion

- v1.0

Note

  • When executing the task, please select at least one or more parameters from locationId , textDescription to execute.

    • If you prefer to use the template, you can provide the locationId parameter. You can query the valid locationId values through the AI entity's info API.
    • If you want to describe the image you want to generate with words/phrases/sentences, you can assign a value to the textDescription parameter.
    • Mask settings:
      • If you only need to change the background without replacing the model's face, please set maskType to "autoSubjectSegment" when executing the task. The AI entity will use automatic subject segmentation technology to generate the mask image, and you do not need to provide customMask and customMaskUrl parameters at this time.
      • If you need to select the areas to keep unchanged on your own instead of using automatic segmentation, please prepare the mask image before the operation and set maskType to "custom" when executing the task. In this case, you need to provide either customMask or customMaskUrl parameter.

Tasks

Create Tasks

Request Parameters

  • initParams

Parameters Sample:

{
    "initParams": {
        "taskName": "Create Task Api Test",
        "originalImage": "https://ai-image.weshop.ai/xxxxxxxx.png"
    }
}
Parameter NameRequiredTypeDescriptionNotes
taskNameNostringTask nameDo not exceed 20 characters
originalImageYesstringOriginal ImageWhen using an external image link, you must ensure that the image link is publicly accessible on the internet.

Response Parameters

  • data
Parameter NameRequiredTypeDescriptionNotes
taskIdYesstringTask ID - the unique identifier/

Execution

Request Parameters

  • params

Parameters Sample:

// Automatic Subject Segmentation
{
    "params": {
        "generatedContent": "referToOrigin",
        "maskType": "autoSubjectSegment", 
        "locationId": 2718,
        "textDescription": "A toy race car in front of a white wall.",
        "negTextDescription": "human faces",
    }
}
 
// Upload Custom Mask
{
    "params": {
        "generatedContent": "freeCreation",
        "maskType": "custom",
        "customMask": "<mask image base64 encoded>",
        "textDescription": "A toy race car in front of a white wall.", 
        "negTextDescription": "human faces",
    }
}
Parameter NameRequiredTypeDescriptionNotes
generatedContentYesstringSelect algorithm preference:
"freeCreation":Free creation
"referToOrigin":Refer to the original image
1. FreeCreation free creation will make the resulting image more free, without being constrained by the style of the uploaded original image.
2. referToOrigin reference original image will make the resulting image refer to the style of the uploaded original image during the generation process.
maskTypeYesstringSelect mask type: "autoSubjectSegment": Automatic subject segmentation
"custom": Manually upload mask information
1. autoSubjectSegment automatically segments the subject and the background, consistent with the 'change BG' on the web page.
2. For manual upload, ensure the uploaded mask image has the same dimensions as the original image.
customMaskNostringUpload the base64 encoded mask image1. When the mask type is "custom", this parameter must be uploaded, otherwise no need to upload.
2. The area outside the mask region is transparent.
3. Use base64 encoding, without the prefix "data:image/png;base64". 4. Must have the same dimensions as the original image.
customMaskUrlNostringURL of the uploaded mask imageWhen using an external image link, you must ensure that the image link is publicly accessible on the internet. The image format requirements are the same as customMask.
locationIdNointLocationOptional
locationTagIdsNoarray[int]Location tagsOptional, please refer to Locations
textDescriptionNostringText description of the content (optional)Optional
negTextDescriptionNostringDescription of content you don't want to appear (optional)Optional
resultImageFormatNostringSelect the format of the generated result image, options: "jpg" "png" (default is png)Default is png
resizeToOriginalImageNoboolWhether to resize the generated result image to the original image dimensionsDefault is false
batchCountNointSet the number of images to generate in this execution, minimum is 1, maximum is 16Default is 4, values out of range will use the default

Response Parameters

  • data
Parameter NameRequiredTypeDescriptionNotes
executionIdYesstringExecution ID - the unique identifier/

Query Task

Request Parameters

  • json format, parameters sample
{
    "executionId":"<execution id>"
}
Parameter NameRequiredTypeDescriptionNotes
executionIdNostringExecution ID/
taskIdNostringTask IDIf the taskId parameter is passed, at most the last 20 execution records will be returned.

Response Parameters

  • initParams

Current task's initial information

Parameter NameRequiredTypeDescriptionNotes
taskNameYesstringTask name/
originalImageYesstringOriginal image/

  • executions

Execution information

Parameter NameRequiredTypeDescriptionNotes
executionIdYesstringExecution ID/
statusYesstringExecution Status:
Segmenting:In automatic segmentation
Pending:Queuing
Running :In progress
Success:Completed
/
paramsYesobjectTask execution related parameters/
executionTimeYesstringTask execution timestamp/
resultsYesarray[object]Task execution result information/

  • result

Execution result

Parameter NameRequiredTypeDescriptionNotes
statusYesstringExecution results
Running
Success
Failed
Pending
/
imageYesstringThe generated final image/
progressNostringProcessing progress, e.g. 0.71 means 71% has been processed/
errorNostringInformation if processing failedWhen the status is "Failed", this field will definitely be returned.

Information Query

Query information related to the AI agent. By passing in the agent name (agentName) and version number (agentVersion), you can obtain the corresponding configuration parameter information.

Request Parameters

Parameter NameRequiredTypeDescriptionNotes
agentNameYesstringAgent name:
"aiproduct"
/
agentVersionYesstringAgent version:
"v1.0"
/

Response Parameters

  • data
Parameter NameRequiredTypeDescriptionNotes
locationsYesarray[object]Location information1. You can obtain complete Locations information through the AI agent information query interface (apiReference#info)
2. Please refer to the Locations data structure for details.Locations
agentVersionYesstringAgent version/

Locations

  • location data structure
Parameter NameRequiredTypeDescriptionNotes
idYesintLocation ID/
imageYesstringLocation image/
nameYesstringLocation name/
categoriesYesarray[string]Location category/
tagsNoarray[object]Location tags/

  • tag data structure
Parameter NameRequiredTypeDescriptionNote
idYesintLocation ID(locationTagIds)/
nameYesstringLocation Name/

locations

[
    {
        "id": 2002718,
        "image": "https://ai-global-image.weshop.com/e2541c55-a6ef-4333-87a7-f2bdd5341a85_800x800.png_256x256.jpeg",
        "name": "White Wall Shadow",
        "categories": ["Light Effect"]
    },
    {
        "id": 2002712,
        "image": "https://ai-global-image.weshop.com/59def4ad-5746-435a-991a-0ab83c190b2f_1024x1024.png_256x256.jpeg",
        "name": "Rooftop Terrace",
        "categories": ["Home Design"]
    },
 
    ......
 
    {
        "id": 2002680,
        "image": "https://ai-global-image.weshop.com/9431f1dc-d40e-46ce-aebe-76c7a49e352b_1024x1024.png_256x256.jpeg", 
        "name": "Forest Window View",
        "categories": ["Natural Scenery"]
    }
]

Expand Image

Expand images & backgrounds by maintaining the context to fit any platform

Basic Information

AgentName

expandimage 

AgentVersion

- v1.0

Tasks

Create Tasks

Request Parameters

  • initParams

Parameters Sample:

{
    "initParams": {
        "taskName": "Create Task Api Test",
        "originalImage": "https://ai-image.weshop.ai/xxxxxxxx.png"
    }
}
Parameter NameRequiredTypeDescriptionNotes
taskNameNostringTask nameDo not exceed 20 characters
originalImageYesstringOriginal ImageWhen using an external image link, you must ensure that the image link is publicly accessible on the internet.

Response Parameters

  • data
Parameter NameRequiredTypeDescriptionNotes
taskIdYesstringTask ID - the unique identifier/

Execution

Request Parameters

  • params

Parameters Sample:

// 1. Custom expansion margins, manually adjust the position of the original image so that it is 100px away from the left side and top of the target size.
 
{
    "params": {
        "fillLeft":100,
        "fillTop":100,
        "targetWidth": 1080,
        "targetHeight":1920
    }
}
// 2. Auto-centered expansion. When fillLeft and fillTop are not specified, the original image will be automatically centered within the target size.
{
    "params": {
        "targetWidth": 1080,
        "targetHeight":1920
    }
}
Parameter NameRequiredTypeDescriptionNotes
targetWidthYesintWidth of the target image (the width of the final generated image)Maximum support for 4096 pixels. You can fill in any value, or refer to the AI agent information query interface to get the Dimensions reference sizes, and choose a suitable width
targetHeightYesintThe height of the target image (the height of the final generated image)Maximum support for 4096 pixels. You can enter any value, or refer to the AI agent information query interface to get reference dimensions from Dimensions, and select an appropriate height
fillLeftNointCustom distance between the target image and the left side of the original image, determines the horizontal position of the original image in the target sizeValue range: -originalImageWidth+8 <= fillLeft <= targetWidth-8. When not filled in, the system will automatically center
fillTopNointCustom distance between the top of the target image and the top of the original image, determines the vertical position of the original image in the target sizeValue range: -originalImageHeight+8 <= fillTop <= targetHeight-8. When not filled in, the system will automatically center
batchCountNointSet the number of images to generate in this execution, minimum is 1, maximum is 16Default is 4, values out of range will use the default

Response Parameters

  • data
Parameter NameRequiredTypeDescriptionNotes
executionIdYesstringExecution ID - the unique identifier/

Query Task

Request Parameters

  • json format, parameters sample
{
    "executionId":"<execution id>"
}
Parameter NameRequiredTypeDescriptionNotes
executionIdNostringExecution ID/
taskIdNostringTask IDIf the taskId parameter is passed, at most the last 20 execution records will be returned.

Response Parameters

  • initParams

Current task's initial information

Parameter NameRequiredTypeDescriptionNotes
taskNameYesstringTask name/
originalImageYesstringOriginal image/

  • executions

Execution information

Parameter NameRequiredTypeDescriptionNotes
executionIdYesstringExecution ID/
statusYesstringExecution Status:
Segmenting:In automatic segmentation
Pending:Queuing
Running :In progress
Success:Completed
/
paramsYesobjectTask execution related parameters/
executionTimeYesstringTask execution timestamp/
resultsYesarray[object]Task execution result information/

  • result

Execution result

Parameter NameRequiredTypeDescriptionNotes
statusYesstringExecution results
Running
Success
Failed
Pending
/
imageYesstringThe generated final image/
progressNostringProcessing progress, e.g. 0.71 means 71% has been processed/
errorNostringInformation if processing failedWhen the status is "Failed", this field will definitely be returned.

Information Query

Query information related to the AI agent. By passing in the agent name (agentName) and version number (agentVersion), you can obtain the corresponding configuration parameter information.

Request Parameters

Parameter NameRequiredTypeDescriptionNotes
agentNameYesstringagent name:
"expandimage"
/
agentVersionYesstringagent version:
"v1.0"
/

Response Parameters

  • data
Parameter NameRequiredTypeDescriptionNotes
dimensionsYesarray[object]Reference size example parameter information1. You can obtain complete Dimensions information through the AI agent information query interface
2. Please refer to the Dimensions data structure for details.Dimensions
agentVersionYesstringAgent version/

Dimensions

  • dimension data structure
Parameter NameRequiredTypeDescriptionNotes
nameYesstringDimension Name/
widthYesintWidth/
heightYesintHeight/

dimensions

[
    {
        "name": "Logo 800*800px",
        "height": 800,
        "width": 800
    },
    {
        "name": "Instagram Square 1080*1080px",
        "height": 1080,
        "width": 1080
    },
    {
        "name": "Facebook Profile 1080*1080px",
        "height": 1080,
        "width": 1080
    },
    {
        "name": "Facebook Post 1200*630px",
        "height": 630,
        "width": 1200
    },
    {
        "name": "Instagram Story 1080*1920px",
        "height": 1920,
        "width": 1080
    },
    {
        "name": "Pinterest Pin 1000*1500px",
        "height": 1500,
        "width": 1000
    },
    {
        "name": "YouTube Banner 2560*1440px",
        "height": 1440,
        "width": 2560
    },
    {
        "name": "YouTube Thumbnail 1280*720px",
        "height": 720,
        "width": 1280
    },
    {
        "name": "Facebook Story 1080*1920px",
        "height": 1920,
        "width": 1080
    }
]

Remove BG

Removing background with lightning speed and ease

Basic Information

AgentName

removeBG 

AgentVersion

- v1.0

Note

  • If you wish to use a background color from a template, please set the backgroundId to the selected background color ID when executing the task. You can obtain valid backgroundId values through the AI agent's info API.
  • If you want to use a custom background color, set backgroundHex to your desired hexadecimal color value, for example: #ced2ce.
  • Mask Settings
    • When executing the task, set maskType to "autoSubjectSegment". The AI agent will automatically generate a mask using subject segmentation, and you do not need to provide customMask or customMaskUrl.
    • If you want to manually choose the areas to remain unchanged, prepare a mask image in advance. Then, set maskType to "custom" and provide either customMask or customMaskUrl during execution.

Tasks

Create Task

Request Parameters

  • initParams

Parameters Sample:

{
    "initParams": {
        "taskName": "Create Task Api Test",
        "originalImage": "https://ai-image.weshop.ai/xxxxxxxx.png"
    }
}
Parameter NameRequiredTypeDescriptionNotes
taskNameNostringTask nameDo not exceed 20 characters
originalImageYesstringOriginal imageWhen using an external image link, you must ensure that the image link is publicly accessible on the internet.

Response Parameters

  • data
Parameter NameRequiredTypeDescriptionNotes
taskIdYesstringTask ID - Unique Identifier/

Execution

Request Parameters

  • params

Parameters Sample:

// Automatically segment the subject, apply the template background color
{
    "params": {
        "maskType": "autoSubjectSegment",
        "backgroundId":457
    }
}
 
// Automatically segment the subject, apply the custom background color
{
    "params": {
        "maskType": "autoSubjectSegment",
        "backgroundHex":"#ced2ce"
    }
}
 
// Upload custom mask file, apply the template background color
{
    "params": {
        "maskType": "custom",
        "customMask": "<mask image base64 encoded>",
      	"backgroundId":457
    }
}
 
Parameter NameRequiredTypeDescriptionNotes
maskTypeYesstringSelect mask type: "autoSubjectSegment": Automatic subject segmentation "custom": Manually upload mask information1. autoSubjectSegment automatically segments the subject and the background. 2. For manual upload, ensure the uploaded mask image has the same dimensions as the original image.
customMaskNostringUpload the base64 encoded mask image1. When the mask type is "custom", this parameter must be uploaded, otherwise no need to upload. 2. The area outside the mask region is transparent. 3. Use base64 encoding, without the prefix "data:image/png;base64". 4. Must have the same dimensions as the original image.
customMaskUrlNostringURL of the uploaded mask imageWhen using an external image link, you must ensure that the image link is publicly accessible on the internet. The image format requirements are the same as customMask.
backgroundIdNointBackground ID
backgroundHexNostringCustom Background Color FormatThe background color should be represented in hexadecimal format, e.g., #ced2ce.
batchCountNointSet the number of images to generate in this execution, minimum is 1, maximum is 16Default is 4, values out of range will use the default

Response Parameters

  • data
Parameter NameRequiredTypeDescriptionNotes
executionIdYesstringExecution ID - the unique identifier/

Query Task

Request Parameters

  • json format, parameters sample
{
    "executionId":"<execution id>"
}
Parameter NameRequiredTypeDescriptionNotes
executionIdNostringExecution ID/
taskIdNostringTask IDIf the taskId parameter is passed, at most the last 20 execution records will be returned.

Response Parameters

  • initParams

Current task's initial information

Parameter NameRequiredTypeDescriptionNotes
taskNameYesstringTask name/
originalImageYesstringOriginal image/

  • executions

Execution information

Parameter NameRequiredTypeDescriptionNotes
executionIdYesstringExecution ID/
statusYesstringExecution Status:
Segmenting:In automatic segmentation
Pending:Queuing
Running :In progress
Success:Completed
/
paramsYesobjectTask execution related parameters/
executionTimeYesstringTask execution timestamp/
resultsYesarray[object]Task execution result information/

  • result

Execution result

Parameter NameRequiredTypeDescriptionNotes
statusYesstringExecution results Running Success Failed Pending/
imageYesstringThe generated final image/
progressNostringProcessing progress, e.g. 0.71 means 71% has been processed/
errorNostringInformation if processing failedWhen the status is "Failed", this field will definitely be returned.

Information Query

Query information related to the AI agent. By passing in the agent name (agentName) and version number (agentVersion), you can obtain the corresponding configuration parameter information.

Request Parameters

Parameter NameRequiredTypeDescriptionNotes
agentNameYesstringagent name: "removeBG"/
agentVersionYesstringagent version: "v1.0"/

Response Parameters

  • data
Parameter NameRequiredTypeDescriptionNotes
backgroundsYesarray[object]Background information1. You can obtain complete Locations information through the AI agent information query interface or view the Background section for details.
2. Please refer to the Backgrounds data structure for detailsBackgrounds
agentVersionYesstringAgent version/

Backgrounds

  • backgrounds data structure
Parameter NameRequiredTypeDescriptionNotes
idYesintBackground ID/
imageYesstringBackground Image/
nameYesstringBackground Name/

backgrounds

{
  "success": true,
  "code": "0",
  "msg": "Request succeeded.",
  "data": {
    "agentVersion": "v1.0",
    "backgrounds": [
      {
        "id": 306,
        "image": "https://ai-global-image.weshop.com/a502db42-4620-46ed-bb7d-d3c39204d607_576x576.png_256x256.jpeg",
        "name": "Transparent"
      },
      {
        "id": 2372,
        "image": "https://ai-global-image.weshop.com/3fa86647-19ed-4a8e-bf27-79dec178c28a_1024x1024.png_256x256.jpeg",
        "name": "White"
      },
      {
        "id": 2204,
        "image": "https://ai-global-image.weshop.com/a7356d04-f62e-4a01-945d-4be3235a99cf_600x600.png_256x256.jpeg",
        "name": "Translucent White"
      },
      {
        "id": 2210,
        "image": "https://ai-global-image.weshop.com/2b7ca98e-6f25-4b0c-bc92-c8bf15830ea1_256x256.png_256x256.jpeg",
        "name": "Almond Milk White"
      },
      {
        "id": 2201,
        "image": "https://ai-global-image.weshop.com/e8b21da4-0b78-4137-bfde-649f5e8461d8_600x600.png_256x256.jpeg",
        "name": "Misty Moon Grey"
      },
      {
        "id": 2224,
        "image": "https://ai-global-image.weshop.com/f099ff73-a90d-4375-8899-e0da20e5879a_256x256.png_256x256.jpeg",
        "name": "Swan White"
      },
      {
        "id": 2200,
        "image": "https://ai-global-image.weshop.com/fc410367-cc58-46bd-9800-0e9e4ed12b74_600x600.png_256x256.jpeg",
        "name": "Light Daffodil Yellow"
      },
      {
        "id": 2207,
        "image": "https://ai-global-image.weshop.com/2ebd9b20-7e61-40e9-9117-c69e7363a3de_600x600.png_256x256.jpeg",
        "name": "Sheepskin Beige"
      },
      {
        "id": 2211,
        "image": "https://ai-global-image.weshop.com/e7de0c40-3c4e-401c-a121-fcf8076815d9_256x256.png_256x256.jpeg",
        "name": "Sunburnt Brown"
      },
      {
        "id": 2202,
        "image": "https://ai-global-image.weshop.com/56f90597-3ddd-4db5-9604-25f25aa6aac0_600x600.png_256x256.jpeg",
        "name": "Sea Buckthorn Brown"
      },
      {
        "id": 2208,
        "image": "https://ai-global-image.weshop.com/664022b1-161d-4aa8-9d82-5dac3c37df75_600x600.png_256x256.jpeg",
        "name": "Wild Fern Green"
      },
      {
        "id": 2199,
        "image": "https://ai-global-image.weshop.com/33e1e623-1208-4d1d-8630-564cc48522f4_600x600.png_256x256.jpeg",
        "name": "Storm Grey"
      },
      {
        "id": 2203,
        "image": "https://ai-global-image.weshop.com/fa535fbb-bd46-47e9-85b1-c46b97a1c04c_600x600.png_256x256.jpeg",
        "name": "Pine Cone Brown"
      },
      {
        "id": 2206,
        "image": "https://ai-global-image.weshop.com/adc76671-58a5-4e13-ad6e-61b5e6306081_600x600.png_256x256.jpeg",
        "name": "Starlight Blue"
      },
      {
        "id": 2222,
        "image": "https://ai-global-image.weshop.com/20b16584-ae6f-4331-bdf8-d6b131e45b38_256x256.png_256x256.jpeg",
        "name": "Deep Seagull Grey"
      },
      {
        "id": 2217,
        "image": "https://ai-global-image.weshop.com/ae021312-3a60-4012-b17c-654bd18b8dd2_256x256.png_256x256.jpeg",
        "name": "Baritone Blue"
      },
      {
        "id": 2223,
        "image": "https://ai-global-image.weshop.com/29a36350-1e13-4b6c-b9ca-a6133bd42e90_256x256.png_256x256.jpeg",
        "name": "Raw Umber"
      },
      {
        "id": 2221,
        "image": "https://ai-global-image.weshop.com/63bc70fe-0f81-4773-a9f0-2e3a70ac0a01_256x256.png_256x256.jpeg",
        "name": "Eggplant Purple"
      },
      {
        "id": 2228,
        "image": "https://ai-global-image.weshop.com/09ada557-37f8-40e5-819c-a1d24e0947f0_256x256.png_256x256.jpeg",
        "name": "Dogwood Pink"
      },
      {
        "id": 2229,
        "image": "https://ai-global-image.weshop.com/dcdc138a-b5a8-45c5-af6b-6dd998be6ef4_256x256.png_256x256.jpeg",
        "name": "Peach Pink"
      },
      {
        "id": 2227,
        "image": "https://ai-global-image.weshop.com/96211cef-e887-45b8-afe1-4de7392ac63c_256x256.png_256x256.jpeg",
        "name": "Tomato Cream Brown"
      },
      {
        "id": 2225,
        "image": "https://ai-global-image.weshop.com/8260f5c7-be16-43fd-8cdc-89a870d1da6c_256x256.png_256x256.jpeg",
        "name": "Blood Orange Red"
      },
      {
        "id": 2205,
        "image": "https://ai-global-image.weshop.com/861dc689-052b-486b-ab03-fc2fd65c2b5b_600x600.png_256x256.jpeg",
        "name": "Smiling Scarlet"
      },
      {
        "id": 2209,
        "image": "https://ai-global-image.weshop.com/551ca48d-6602-496b-95de-36e4f5ccca4d_600x600.png_256x256.jpeg",
        "name": "Rainforest Green"
      },
      {
        "id": 2226,
        "image": "https://ai-global-image.weshop.com/1d6412c5-5ac1-43a5-806e-07b6321c8b0c_256x256.png_256x256.jpeg",
        "name": "Golden Palm"
      },
      {
        "id": 2216,
        "image": "https://ai-global-image.weshop.com/2c4c43d2-2852-4e1a-b304-72e4823aa879_256x256.png_256x256.jpeg",
        "name": "Blackthorn Green"
      },
      {
        "id": 2195,
        "image": "https://ai-global-image.weshop.com/20b1d1c8-0000-41c1-ac42-0d9d4999bbf6_600x600.png_256x256.jpeg",
        "name": "Red"
      },
      {
        "id": 2196,
        "image": "https://ai-global-image.weshop.com/a2007437-01b4-490c-b72b-8f07f5328cdc_600x600.png_256x256.jpeg",
        "name": "Blue"
      },
      {
        "id": 2198,
        "image": "https://ai-global-image.weshop.com/24dc6b67-1f08-4453-8ac2-dd886af6ccbd_600x600.png_256x256.jpeg",
        "name": "Grey "
      },
      {
        "id": 2212,
        "image": "https://ai-global-image.weshop.com/04a5524e-c4f8-4eaf-88b0-d5a6d52f7e44_256x256.png_256x256.jpeg",
        "name": "Wave Blue"
      },
      {
        "id": 2213,
        "image": "https://ai-global-image.weshop.com/0d4a9be9-e32f-4484-89c1-d72d283a713c_256x256.png_256x256.jpeg",
        "name": "Cherry Tomato Red"
      },
      {
        "id": 2214,
        "image": "https://ai-global-image.weshop.com/31e00e4d-c05a-47d3-8e4c-03ebaab7e734_256x256.png_256x256.jpeg",
        "name": "Pumpkin Mud Orange"
      },
      {
        "id": 2215,
        "image": "https://ai-global-image.weshop.com/8316e656-0f48-417e-bc98-46e5ad95bc7e_256x256.png_256x256.jpeg",
        "name": "Italian Plum Purple"
      },
      {
        "id": 2218,
        "image": "https://ai-global-image.weshop.com/d7825630-3750-4724-9625-47f511e6d828_256x256.png_256x256.jpeg",
        "name": "Sand Gold Green"
      }
    ]
  }
}