Background Replacer
POST
https://api.sellerpic.ai/v1/api/generate/replaceBackground
Replace Type | Description | Required Parameters | Output Images | Credit Cost |
---|---|---|---|---|
AI_BACKGROUND | Replaces the background using a preset style Retrieve available styles (type: AI_BACKGROUND ) | presetBackgroundId - ID of selected background style | 4 | 4 |
TEXT_TO_BACKGROUND | Generates backgrounds based on text prompts | customBackgroundPrompt - Descriptive text input | 4 | 4 |
PRESET_BACKGROUND_IMAGE | Applies a predefined image as background Retrieve available images (type: BACKGROUND ) | presetBackgroundId - ID of preset background image | 1 | 1 |
CUSTOM_BACKGROUND_IMAGE | Uses user-uploaded image as background Upload Process: 1. Get upload URL 2. Upload file | backgroundImageKey - Key of uploaded image | 1 | 1 |
SOLID_COLOR_BACKGROUND | Sets background using HEX color code (e.g. #80c699 ) | backgroundColor - Valid HEX color string | 1 | 1 |
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.sellerpic.ai/v1/api/generate/replaceBackground' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"replaceType": "string",
"productImageKey": "string",
"productMaskKey": "string",
"presetBackgroundId": "string",
"customBackgroundPrompt": "string",
"backgroundColor": "string",
"backgroundImageKey": "string",
"productImageScale": 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