Quickstart
The API removes image backgrounds over HTTPS. The base URL is https://api.cutoutlabs.com and every request is authenticated with an API key. It is free during launch: 150 images per key per calendar month, with no card and no sales call. You create the key yourself, and it works immediately.
- Enter your email in the form above and open the verification link. Your key is shown once on the dashboard; store it as a secret.
- Send POST https://api.cutoutlabs.com/v1.0/removebg with the key in the X-Api-Key header and an image as image_file, image_file_b64, or image_url.
- Save the returned image, and read the RateLimit headers to see how many calls you have left.
Authentication
Send your key in the X-Api-Key header on every request. The hosted MCP server also accepts it as Authorization: Bearer YOUR_API_KEY. A missing, invalid, or revoked key returns HTTP 403 with the error code auth_failed.
Keys are self-serve. Sign in at https://api.cutoutlabs.com/v1/dashboard with your email to see usage for this month and the last 30 days, replace or revoke a key, request a higher limit, or delete your account. Keep keys on your server or in your agent's secret store, never in browser code or a public repository.
Endpoints
Each operation has a stable operationId that matches the OpenAPI 3.1 description at https://api.cutoutlabs.com/openapi.json, so tool-calling frameworks and code generators can use it directly as a function name.
| Method and path | operationId | What it does |
|---|---|---|
| POST /v1.0/removebg | removeBackground | Removes the background from one image and returns the cutout as PNG, JPG, WebP, or ZIP, or as JSON with Accept: application/json. Uses one request from your quota; failed requests are refunded. |
| GET /v1.0/account | getAccount | Returns the free calls left this month for the key. Does not use quota. |
| GET /openapi.json | (spec) | OpenAPI 3.1 description with typed request and response schemas. No key needed. |
| POST /mcp | remove_background, get_quota | Model Context Protocol server over Streamable HTTP for AI agents. |
Example requests
Request bodies can be multipart/form-data, application/x-www-form-urlencoded, or application/json. Parameters follow remove.bg's /v1.0/removebg; see the parameter reference on the background removal API page for every option.
curl -sS https://api.cutoutlabs.com/v1.0/removebg \
-H "X-Api-Key: $CUTOUTLABS_API_KEY" \
-F "image_file=@photo.jpg" \
-F "size=auto" \
-F "format=png" \
-o cutout.pngcurl -sS https://api.cutoutlabs.com/v1.0/removebg \
-H "X-Api-Key: $CUTOUTLABS_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"image_url": "https://example.com/product.jpg", "size": "medium", "bg_color": "ffffff"}'{
"data": {
"result_b64": "iVBORw0KGgo...",
"foreground_top": 42,
"foreground_left": 118,
"foreground_width": 760,
"foreground_height": 1104,
"foreground_type": "auto"
}
}curl -sS https://api.cutoutlabs.com/v1.0/account \
-H "X-Api-Key: $CUTOUTLABS_API_KEY"import os, time, requests
def remove_background(path: str) -> bytes:
while True:
with open(path, "rb") as image:
response = requests.post(
"https://api.cutoutlabs.com/v1.0/removebg",
headers={"X-Api-Key": os.environ["CUTOUTLABS_API_KEY"]},
files={"image_file": image},
data={"size": "auto"},
)
if response.status_code == 429:
time.sleep(int(response.headers.get("Retry-After", "60")))
continue
response.raise_for_status()
return response.contentRate limits and quotas
Each key can make 10 requests per minute and 150 successful requests per calendar month. The monthly quota resets on the 1st at 00:00 UTC. Failed requests are refunded and do not count.
Every metered response reports the quota so agents can throttle themselves before they hit a limit. When a limit is reached, the API returns 429 (per-minute burst) or 402 (monthly quota) with a Retry-After header in seconds. Wait at least that long before retrying, and don't retry 402 before the reset.
| Header | Example | Meaning |
|---|---|---|
| RateLimit | "monthly";r=149;t=691200 | IETF RateLimit field (draft-ietf-httpapi-ratelimit-headers): r is the remaining requests and t the seconds until the quota resets. |
| RateLimit-Policy | "monthly";q=150;w=2592000, "burst";q=10;w=60 | The policies that apply: q requests per w seconds. |
| RateLimit-Limit / RateLimit-Remaining / RateLimit-Reset | 150 / 149 / 691200 | The same values as separate fields, for clients that read the older draft. |
| X-Quota-Limit / X-Quota-Remaining / X-Quota-Reset | 150 / 149 / 1796083200 | remove.bg-style quota fields; X-Quota-Reset is a Unix timestamp. |
| Retry-After | 60 | On 429, 402, and 503 responses: seconds to wait before retrying. |
Versioning and deprecation policy
The API version is part of the URL path. The current and only version is v1.0 (/v1.0/removebg and /v1.0/account). Within a version we only make additive changes: new optional parameters, new response headers, new enum values, or new error codes. Clients should ignore fields and headers they don't recognise.
Breaking changes, such as removing or renaming a parameter, changing a default, or changing the response shape, ship only under a new path such as /v2/. The previous version keeps working after the new one launches.
When a version is scheduled for removal, its responses start carrying a Deprecation header (RFC 9745) and a Sunset header (RFC 8594) with the removal date, plus a Link header pointing to the migration notes. We announce it on this page and email every key holder at least 6 months before the Sunset date. No version is deprecated today.
Errors
Errors use one JSON shape: {"errors": [{"title": "…", "code": "…"}]}. The code is stable and machine-readable; the title is a human-readable explanation. Common codes are auth_failed (403), invalid_parameters (400), insufficient_credits (402), rate_limit_exceeded (429), and service_unavailable (503).