Pro Model Documentation#
REST API reference for cloud-hosted background removal, alpha matte extraction, and the dedicated car pipeline (including uncomposited cutout + shadow layers). Managed infrastructure at api.withoutbg.com, billed per image.
Quickstart#
- Get an API key. Sign up (50 free credits, no credit card), then copy the key from your account.
- Send an image.
Remove a background
curl -X POST https://api.withoutbg.com/v1.0/image-without-background \ -H "X-API-Key: $WITHOUTBG_API_KEY" \ -F "file=@photo.jpg" \ -o cutout.png - Use the result.
cutout.pngis a transparent RGBA PNG. Each HTTP 200 costs 1 credit.
Binary or Base64? Binary endpoints take multipart/form-data and return image bytes: use them from servers, CLIs and file pipelines. Base64 endpoints take and return JSON: use them from browsers, serverless functions and JSON-only pipelines.
Endpoints#
- Background Removal (Binary)Upload a file, get a transparent PNG back. Start here.
- Background Removal (Base64)Same cutout, as JSON in and out. For browsers and serverless.
- Alpha Matte (Binary)Grayscale mask only, so you composite the full-res original yourself.
- Alpha Matte (Base64)The alpha matte as Base64 JSON.
- Car Background Removal (Binary)Car photos: cutout with the cast shadow baked in.
- Car Background (Binary)Car placed on a studio backdrop, returned as JPEG.
- Car Layers (Base64)Car composite, cutout, shadow and backdrop layers in one JSON call.
- CreditsCheck the remaining balance and expiry for a key. Free to call.
Errors and limits#
Every endpoint returns these status codes on failure. Failed calls cost no credits.
| Status | Meaning |
|---|---|
401 | Invalid API Key |
402 | Insufficient credit. Please top up API credits. |
403 | Credits Expired. Please top up API credits. If you have existing credits, they will be reactivated. |
413 | File size too large. Maximum file size is 20.0 MB. |
415 | Unsupported Media Type. Supported formats are: JPEG, PNG, WebP, AVIF, HEIC, TIFF, BMP, GIF. |
422 | Validation Error |
429 | Rate limit exceeded (product policy: 30 requests/minute per API key). May be returned by the API gateway. Retry with exponential backoff. |
500 | Internal Server Error |
| Limit | Value |
|---|---|
| Rate limit (product) | 30 requests/minute per API key (gateway may return 429) |
| Max input size | 20.0 MB: binary: HTTP 413; base64: HTTP 422 |
| Unsupported format | Binary: HTTP 415; base64: HTTP 422 |
| Prep downscale | Longest side > 5000 px or > 25 MP → auto-downscale (not rejected) |
| Paid call cost | 1 credit on HTTP 200 (credits endpoint is free) |
| Inference size | Max ~1024 px on the longer side; matte/cutout mapped back to full-res RGB. Edge detail is capped at inference resolution. |