Remove Background
Isolate the subject of an image and receive a clean transparent PNG cutout.
/api/v1/remove-backgroundfrom $0.06 per imagePredictable price
Want to see the result first? Try the background remover in your browser.
Request
Headers
x-api-keystringYour SudoMock API key. Bearer authentication is also supported.
Content-TypestringRequiredMust be application/json.
Request body
Provide an image as url or raw base64. If both are supplied, base64 is used.
urlstringA directly reachable HTTP or HTTPS image URL. Required unless base64 is provided.
base64stringRaw base64 image bytes without a data URL prefix. Required unless url is provided.
content_typestring= image/pngMIME type for base64 input: image/png, image/jpeg, image/webp, or image/gif. Defaults to image/png.
Maximum request size
1{2 "url": "https://your-domain.com/product-photo.jpg"3}
Code examples
1curl -X POST "https://api.sudomock.com/api/v1/remove-background" \2 -H "Content-Type: application/json" \3 -H "x-api-key: sm_your_api_key" \4 -d '{"url":"https://your-domain.com/product-photo.jpg"}'
Response
The response includes a signed cutout URL, its pixel dimensions, and the final credit charge. Download or use the URL within seven days.
1{2 "success": true,3 "data": {4 "url": "https://cdn.sudomock.com/bg-cutouts/...png",5 "width": 1600,6 "height": 1600,7 "credits_charged": 258 }9}
data.urlstringRequiredSigned URL of the transparent PNG cutout.
data.widthintegerRequiredCutout width in pixels.
data.heightintegerRequiredCutout height in pixels.
data.credits_chargedintegerRequiredAccount charge reported for the successful operation.
Use it inside a render
For PSD renders, set smart_objects[].asset.remove_background to true. For 2D renders, set print_areas[].remove_background to true. Pricing starts at about $0.06 per unique artwork source in that render.
Reusable cutout or render-time cleanup
Errors
| Status | Meaning | What to do |
|---|---|---|
| 401 | Missing or invalid credentials | Check the API key or Bearer token. |
| 402 | Insufficient credits | Add credits, then retry. |
| 413 | Encoded JSON request exceeds 40 MB | For base64 input, use an original image below about 30 MB. |
| 422 | Image source is missing, unreadable, or unsupported | Check the URL, base64 data, and file type. |
| 502 | The background could not be removed | Retry, or use a different image. The charge is returned. |