Remove backgrounds automatically with 1 API call
Integrate background removal into your app or workflow. POST an image, get a transparent PNG back — metered by credits, undercutting the big names on price.
Get API KeyNot a developer? Use the web app instead — no code required.
Easy to integrate
A simple HTTP interface with sensible options:
- Source images
- Direct upload (
image_file), a URL (image_url), or a base64 string (image_base64). - Result images
- Binary image file by default, or JSON-encoded data (base64 + dimensions) with
Accept: application/json. - Output resolution
- Up to 32 megapixels. Requires an image with a clear foreground (people, products, animals, cars, graphics…).
Get started
Create an API key in your dashboard, top up credits, then send your first request. One credit per successful full-resolution removal — failed calls are never charged. Authenticate with X-Api-Key: bg_live_… (or Authorization: Bearer bg_live_…).
Sample code
The only request you need:
curl -H "X-Api-Key: bg_live_..." \
-F "image_file=@/path/to/file.jpg" \
-F "size=auto" \
-f https://usely.tools/api/v1/removebg \
-o no-bg.pngOutput formats
Request one of the formats below via the format parameter. PNG and WebP support transparency; JPG does not. ZIP is the fastest for transparent results.
| Format | Transparency | Pros & cons |
|---|---|---|
png | Yes | + Simple integration · + Supports transparency · − Larger file size |
jpg | No | + Simple integration · + Smallest file size · − No transparency |
webp | Yes | + Small file size · + Supports transparency · − Not universally supported |
zip | Yes | + Fastest · + Small file size · + Transparency · − Needs composition |
If you don't need transparency (e.g. a solid white background), use JPG. For the fastest processing of transparent results, use ZIP.
How to use the ZIP format
The ZIP format has the best runtime performance for transparent images — the result is smaller (faster to download) and faster to generate than PNG. The archive always contains two files:
color.jpg- A non-transparent RGB image with the colors for each pixel (edge-corrected).
alpha.png- A grayscale alpha matte — white is foreground, black is background.
To compose the final image: extract the files, apply the alpha matte to the color image, then save in your chosen format.
# Linux (requires zip + imagemagick)
unzip no-bg.zip && \
convert color.jpg alpha.png \
-compose CopyOpacity \
-composite no-bg.pngAPI Reference
POST /api/v1/removebg
Removes the background of a JPG / PNG / WebP image. File size up to 12 MB; input resolution up to 32 megapixels. Image source: file upload (binary or base64) or download from URL. Requires an API key in the X-Api-Key header (or a Bearer token in Authorization).
Request body — multipart/form-data or application/json
| Parameter | Type | Description |
|---|---|---|
image_file | binary | Source image file (binary). If present, the other image source parameters must be empty. |
image_base64 | string | Source image as a base64-encoded string. Mutually exclusive with the other sources. |
image_url | string | Source image URL to fetch. Mutually exclusive with the other sources. |
size | string | Output resolution: preview (≤0.25 MP, free), full (original up to 32 MP, 1 credit), or auto (default). |
format | string | Result format: png (transparent, default), jpg (no transparency), webp, or zip. |
bg_color | string | Solid background color as a 6-digit hex (e.g. #ffffff) composited behind the subject. |
crop | boolean | Crop off empty transparent regions around the subject (default false). Cropping does not change the credits charged. |
Request headers
| Header | Description |
|---|---|
X-Api-Key | Your API key (bg_live_…). Also accepted as Authorization: Bearer …. |
Accept | application/json to receive base64 + dimensions instead of binary. |
Idempotency-Key | Optional. Retries with the same key return the original response and are never double-charged. |
Responses
| Code | Description |
|---|---|
200 | Background removed. Binary image (or JSON when Accept: application/json). Response headers include X-Credits-Charged, X-Credits-Remaining, and rate-limit headers. |
400 | Invalid parameters or unprocessable input (no credits charged). Envelope: { "error": { "code", "message" } }. |
402 | Insufficient credits (no credits charged). |
401 | Authentication failed — missing or invalid API key (no credits charged). |
429 | Rate limit exceeded (no credits charged). Includes a Retry-After header. |
Response headers
| Header | Description |
|---|---|
X-Width / X-Height | Dimensions of the result image. |
X-Credits-Charged | Credits charged for this call. |
X-Credits-Remaining | Remaining wallet balance after the call. |
X-RateLimit-Remaining | Requests remaining in the current window. |
Account endpoint
GET /api/v1/account
Fetch the current credit balance for the authenticated key. Balance changes may lag a few seconds; to track locally, read this once and then adjust using the X-Credits-Charged header returned by each removal.
{
"data": {
"credits": { "balance": 200 }
}
}