About this endpoint
What it does
Removes the background from an input image and returns result metadata plus the processed image payload. The request accepts either a public image URL or base64-encoded image data, along with optional output and cropping settings.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| image | Object | Yes | Image source. Provide one of image.url or image.base64. |
| image.url | String | No | Public http(s) URL of the image (≤ 20 MB). Private and internal addresses are refused. |
| image.base64 | String | No | The image as base64 (a data: URI is fine), ≤ 20 MB decoded. |
| crop | Boolean | No | Crop the result to the subject's bounding box. Default: false. |
| format | ENUM | No | Output encoding. Allowed values: json, png, webp, jpeg. Default: json.json returns metadata plus a PNG data URI.png and webp return the image bytes.jpeg needs an opaque background. |
| padding | Integer | No | Pixels kept around the subject when crop is true. Default: 0. Minimum: 0. Maximum: 1000. |
| quality | ENUM | No | Processing quality. Allowed values: best, fast. Default: best.best prioritizes detail.fast is suitable for previews. |
| max_size | Integer | No | Longest side of the output in pixels. Default: null (original size). Minimum: 64. Maximum: 4096. |
| background | String | No | Background color to place the subject on. Default: transparent.Allowed values: transparent or a hex color in #RRGGBB format. |
Response
Returns a JSON object with format, media_type, width, height, bytes, data_uri, bbox, foreground_ratio, and quality fields. bbox is either an object with x, y, width, and height, or null; the other fields describe the generated output and its encoding.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| bbox | Object | Yes | Subject bounding box in the original image, or null when nothing was found. |
| bbox.x | Integer | Yes | X coordinate of the bounding box. |
| bbox.y | Integer | Yes | Y coordinate of the bounding box. |
| bbox.width | Integer | Yes | Width of the bounding box. |
| bbox.height | Integer | Yes | Height of the bounding box. |
| bytes | Integer | Yes | Size of the output in bytes. |
| width | Integer | Yes | Output width in pixels. |
| format | String | Yes | Encoding of data_uri. |
| height | Integer | Yes | Output height in pixels. |
| quality | ENUM | Yes | Processing quality used in the result. Allowed values: best, fast. |
| data_uri | String | Yes | data:<media_type>;base64,… |
| media_type | String | Yes | MIME type of the returned data. |
| foreground_ratio | Number | Yes | Share of the original image covered by the subject, from 0 to 1. |



