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

PlanImages / monthRate limit
free506 requests / minute
starter50030 requests / minute
pro5,00060 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

POST/v1/removerequires X-API-Key

Provide the image one of two ways:

InputHow
Multipartmultipart/form-data with the image in a file field.
JSONapplication/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

GET/v1/accountrequires X-API-Key
{
  "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

GET/files/:namepublic

Serves images created with response=json. Hosted files are deleted after 24 hours — download anything you need to keep.

Health check

GET/healthpublic
{ "ok": true, "worker": true, "queue": 0 }

Options

All optional. Pass as query parameters (?format=webp&size=1024) or JSON body fields.

OptionTypeDefaultNotes
formatstringpngOutput format: png or webp.
bg_colorstringtransparentFlatten the cutout onto a solid 6-digit hex color, e.g. ffffff.
sizeintegeroriginalFit the result inside a size×size box (16–8192). Never enlarges.
responsestringbytesjson → 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 formatsJPG, PNG, WebP (detected by decoding — extensions and headers are not trusted)
Hosted URLsExpire 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": "…" } }
StatusCodeMeaning
401invalid_keyMissing, unknown, or disabled API key.
429rate_limitedPer-minute plan rate limit hit — see Retry-After.
429quota_exceededMonthly image quota used up.
429busyProcessing queue is full — retry in a few seconds.
400no_imageNo file field and no image_base64 in the body.
400invalid_imageBytes could not be decoded as an image.
400unsupported_formatDecoded, but not JPG / PNG / WebP.
413too_largeImage or request body over the 12 MB limit.
413too_many_pixelsImage over the 25 megapixel limit.
400bad_formatformat must be png or webp.
400bad_bg_colorbg_color must be a 6-digit hex color.
400bad_sizesize must be an integer between 16 and 8192.
504inference_timeoutProcessing took too long — try a smaller image.
503processing_unavailableProcessing backend is restarting — retry shortly.
502processing_failedBackground removal failed for this image.

Get an API key

Get an API key: ahmedskfound@gmail.com