| 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 |
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
}'{
"code": 0,
"data": {
"id": "string"
},
"msg": "string",
"success": true,
"traceId": "string"
}