SudoMock
POST

Remove Background

Isolate the subject of an image and receive a clean transparent PNG cutout.

POST/api/v1/remove-backgroundfrom $0.06 per image

Predictable price

Pricing starts at about $0.06 per image on annual Pro 50K. Your exact price depends on your plan. Failed attempts are not charged.

Want to see the result first? Try the background remover in your browser.

Request

Headers

x-api-keystring

Your SudoMock API key. Bearer authentication is also supported.

Content-TypestringRequired

Must be application/json.

Request body

Provide an image as url or raw base64. If both are supplied, base64 is used.

urlstring

A directly reachable HTTP or HTTPS image URL. Required unless base64 is provided.

base64string

Raw base64 image bytes without a data URL prefix. Required unless url is provided.

content_typestring= image/png

MIME type for base64 input: image/png, image/jpeg, image/webp, or image/gif. Defaults to image/png.

Maximum request size

URL images can be up to 40 MB. For base64 input, keep the original image below about 30 MB so the encoded JSON request stays within the 40 MB limit. Larger requests return 413Payload Too Large.
Request body
1{
2 "url": "https://your-domain.com/product-photo.jpg"
3}

Code examples

Remove background
bash
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

200OK

The response includes a signed cutout URL, its pixel dimensions, and the final credit charge. Download or use the URL within seven days.

Response 200
1{
2 "success": true,
3 "data": {
4 "url": "https://cdn.sudomock.com/bg-cutouts/...png",
5 "width": 1600,
6 "height": 1600,
7 "credits_charged": 25
8 }
9}
data.urlstringRequired

Signed URL of the transparent PNG cutout.

data.widthintegerRequired

Cutout width in pixels.

data.heightintegerRequired

Cutout height in pixels.

data.credits_chargedintegerRequired

Account 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

Use this endpoint when you want a transparent PNG you can reuse. Use the render flag when you want the artwork cleaned as part of one render request.

Errors

StatusMeaningWhat to do
401Missing or invalid credentialsCheck the API key or Bearer token.
402Insufficient creditsAdd credits, then retry.
413Encoded JSON request exceeds 40 MBFor base64 input, use an original image below about 30 MB.
422Image source is missing, unreadable, or unsupportedCheck the URL, base64 data, and file type.
502The background could not be removedRetry, or use a different image. The charge is returned.