BG-API — Background Removal API
Send an image, get it back with the background removed. One endpoint, transparent PNG or WebP out.
Base URL: https://bg-api.sikasio.com
The API is synchronous: POST /v1/remove processes your image and returns the cutout in the
same response — either as raw image bytes (default) or, with response=json, as a hosted URL
that stays live for 24 hours.
Authentication
Every /v1 request must include your API key in the X-API-Key header:
X-API-Key: bg_live_YOUR_KEY
Missing, wrong, or disabled keys return 401 with code invalid_key. Each successful
removal costs one credit from your monthly quota — failed requests are never charged.
Plans & quotas
| Plan | Images / month | Rate limit |
|---|---|---|
free | 50 | 6 requests / minute |
starter | 500 | 30 requests / minute |
pro | 5,000 | 60 requests / minute |
Quotas reset on the 1st of each month (UTC). Every successful response includes an
X-Credits-Remaining header; check GET /v1/account any time.
Quick start
Multipart upload (returns the PNG directly)
curl -X POST "https://bg-api.sikasio.com/v1/remove" \
-H "X-API-Key: bg_live_YOUR_KEY" \
-F "file=@photo.jpg" \
-o cutout.png
Base64 JSON body with options
curl -X POST "https://bg-api.sikasio.com/v1/remove?format=webp&bg_color=ffffff&size=1024" \
-H "X-API-Key: bg_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d "{\"image_base64\": \"$(base64 -w0 photo.jpg)\"}" \
-o cutout.webp
Hosted URL instead of bytes (response=json)
curl -X POST "https://bg-api.sikasio.com/v1/remove?response=json" \
-H "X-API-Key: bg_live_YOUR_KEY" \
-F "file=@photo.jpg"
{
"url": "https://bg-api.sikasio.com/files/3f9c…a1.png",
"width": 1200,
"height": 800,
"format": "png",
"credits_remaining": 4999,
"expires_in_hours": 24
}
Remove a background
Provide the image one of two ways:
| Input | How |
|---|---|
| Multipart | multipart/form-data with the image in a file field. |
| JSON | application/json body with image_base64 (raw base64 or a data:image/…;base64, URL). |
Options (see Options) go in the query string or the JSON body — query wins.
Default response is the processed image bytes (image/png or image/webp) plus
X-Credits-Remaining and X-RateLimit-Limit headers. With response=json
the image is stored and a hosted URL is returned instead (expires after 24 hours).
Check your account
{
"name": "my-app",
"plan": "pro",
"monthly_quota": 5000,
"used_this_month": 132,
"remaining": 4868,
"resets_at": "2026-08-01T00:00:00.000Z",
"rate_limit_per_minute": 60
}
Fetch a hosted result
Serves images created with response=json. Hosted files are deleted after
24 hours — download anything you need to keep.
Health check
{ "ok": true, "worker": true, "queue": 0 }
Options
All optional. Pass as query parameters (?format=webp&size=1024) or JSON body fields.
| Option | Type | Default | Notes |
|---|---|---|---|
format | string | png | Output format: png or webp. |
bg_color | string | transparent | Flatten the cutout onto a solid 6-digit hex color, e.g. ffffff. |
size | integer | original | Fit the result inside a size×size box (16–8192). Never enlarges. |
response | string | bytes | json → store the result and return a hosted URL instead of image bytes. |
Limits
| Upload size | ≤ 12 MB per image (base64 bodies may be up to ~17 MB of text) |
|---|---|
| Resolution | ≤ 25 megapixels |
| Input formats | JPG, PNG, WebP (detected by decoding — extensions and headers are not trusted) |
| Hosted URLs | Expire 24 hours after creation |
If the server is momentarily saturated you get 429 busy with a Retry-After
header — retry after a few seconds. Only successful removals consume credits.
Errors
All errors are JSON with a stable machine-readable code:
{ "error": { "code": "…", "message": "…" } }
| Status | Code | Meaning |
|---|---|---|
| 401 | invalid_key | Missing, unknown, or disabled API key. |
| 429 | rate_limited | Per-minute plan rate limit hit — see Retry-After. |
| 429 | quota_exceeded | Monthly image quota used up. |
| 429 | busy | Processing queue is full — retry in a few seconds. |
| 400 | no_image | No file field and no image_base64 in the body. |
| 400 | invalid_image | Bytes could not be decoded as an image. |
| 400 | unsupported_format | Decoded, but not JPG / PNG / WebP. |
| 413 | too_large | Image or request body over the 12 MB limit. |
| 413 | too_many_pixels | Image over the 25 megapixel limit. |
| 400 | bad_format | format must be png or webp. |
| 400 | bad_bg_color | bg_color must be a 6-digit hex color. |
| 400 | bad_size | size must be an integer between 16 and 8192. |
| 504 | inference_timeout | Processing took too long — try a smaller image. |
| 503 | processing_unavailable | Processing backend is restarting — retry shortly. |
| 502 | processing_failed | Background removal failed for this image. |
Get an API key
Get an API key: ahmedskfound@gmail.com