API Reference
Remove background from image
Remove the background from an image. Returns a mask of the foreground object.
Model:
remove-backgroundCredit:2
post
/v1/images/remove-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 | Image file or URL to remove the background from. |
Responses
Background removed successfullyRemoveBackgroundResponse
| Field | Type | Description |
|---|---|---|
data | object[] | |
url | string | URL to download the result image (RGBA with transparent background) |
box | number[] | Bounding box [x1, y1, x2, y2] of foreground object |
curl -X POST "https://api.snapapi.ai/v1/images/remove-background" \
-H "api-key: YOUR_API_KEY" \
-F "input_image=@./image.jpg"Response
{
"data": [
{
"url": "https://outputs.snapapi.ai/outputs/abc123.png",
"box": [
10,
20,
300,
400
]
}
]
}
