SnapEditDocs
API HomeGet API Key
API Reference

Remove background from image

remove-background

Remove the background from an image. Returns a mask of the foreground object.

post/v1/images/remove-background

Credit cost: 1

Authorization β€” This endpoint requires an API key. Pass it in the api-key header on every request. See the quickstart

Body

NameTypeStatusDescription
input_image
fileRequiredImage file or URL to remove the background from.

Responses

Background removed successfullyRemoveBackgroundResponse

NameTypeDescription
output_image_urlstringURL to download the result image (RGBA with transparent background)
boxnumber[]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
{
  "output_image_url": "https://outputs.snapapi.ai/outputs/abc123.png",
  "box": [
    10,
    20,
    300,
    400
  ]
}