API Reference
Generate background for RGBA image
Generate a new background for a single RGBA input image using a text prompt. The RGB channels contain the source image and the alpha channel is used as the foreground mask.
Model:
generate-backgroundCredit:7
post
/v1/images/generates-backgroundAuthorization — This endpoint requires an API key. Pass it in the api-key header on every request. Learn more
Parameters
| Name | Type | Status | Description |
|---|---|---|---|
input_image | file | Required | RGBA image file or URL. RGB contains the source image; alpha contains the mask. |
prompt | string | Required | Text prompt describing the generated background. |
Responses
Background generated successfullySingleImageResponse
| Field | Type | Description |
|---|---|---|
created | integer | Unix timestamp of when the response was created |
data | object[] | |
url | string | URL to download the result image |
curl -X POST "https://api.snapedit.app/v1/images/generates-background" \
-H "api-key: YOUR_API_KEY" \
-F "input_image=@./image.png" \
-F "prompt=value"Response
{
"created": 1745827200,
"data": [
{
"url": "https://outputs.snapedit.app/outputs/abc123.png"
}
]
}
