
Background Remover API
Design
Remove the background from a photo with AI and get a transparent PNG in seconds. Preview it on a checkerboard or a solid colour, then download or copy it. Free, no sign-up.
Authentication
All API requests require a valid API key passed in the Authorization header as a Bearer token.
Rate Limit
10 requests per minute
Endpoints
1 endpoint available
Overview
Removes the background from one photo with an AI segmentation model (BiRefNet) and returns a PNG. The subject keeps its pixels and everything else becomes transparent, or is filled with background if you send one.
Limits and behavior
- Send the photo as multipart/form-data in the
filefield: JPEG, PNG, WebP, GIF (first frame), AVIF or TIFF, up to 20 MB. HEIC is not supported. - Photos larger than 2048 px on the long edge are scaled down to 2048 px first, so the PNG is at most 2048 px across. EXIF rotation is applied.
- This calls a paid AI model, so it uses the AI tier: 10 requests a minute and 200 a day per API key.
- Photos and results are not stored.
- The response body is the PNG itself. Errors are JSON:
{"success": false, "error": "..."}. - If curl sends
application/octet-streamfor your file (it does for .webp and .avif), add the type:-F "file=@photo.webp;type=image/webp".
Endpoints
POST
https://opentools.ca/api/v1/tools/background-removerRemove the background from a photo and return a PNG
Request Body
Content-Type: multipart/form-data
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | file | Required | The photo. JPEG, PNG, WebP, GIF, AVIF or TIFF, up to 20 MB. |
| background | string | Optional | Hex colour (#rgb or #rrggbb) to fill the removed background with. Leave out for a transparent PNG. |
Response Example
The body is the cut-out image (Content-Type: image/png), sent as an attachment named "<photo name>-no-background.png". Errors return JSON, for example:
{
"success": false,
"error": "The AI model could not process that image. Try a different photo."
}Error Codes
400
Bad Request - No file, invalid background colour, or the image could not be read401
Unauthorized - Invalid or missing API key403
Forbidden - API key inactive, expired, or not allowed from this IP413
Payload Too Large - The file is over 20 MB415
Unsupported Media Type - The file is not a JPEG, PNG, WebP, GIF, AVIF or TIFF image422
Unprocessable - The AI model could not process that image429
Too Many Requests - Over 10 a minute or 200 a day for this key500
Internal Server Error502
Bad Gateway - The AI model is busy or returned no image503
Service Unavailable - Background removal is not available right now504
Gateway Timeout - The model took too longCode Examples
# Transparent PNG
curl -X POST https://opentools.ca/api/v1/tools/background-remover -H "Authorization: Bearer YOUR_API_KEY" -F "file=@photo.jpg" -o photo-no-background.png
# On a white background
curl -X POST https://opentools.ca/api/v1/tools/background-remover -H "Authorization: Bearer YOUR_API_KEY" -F "file=@photo.jpg" -F "background=#ffffff" -o photo-white.pngRather use it in your browser? Open the Background Remover