API reference · v1.0

Remove backgrounds with one request.

The BG ByeBye API is a REST API that takes a photo and returns a cutout. It's wire-compatible with the remove.bg v1.0 API, so existing integrations keep working once you change the base URL.

https://api.bgbyebye.com

Quickstart

1. Get a free API key (50 credits a month, no card). 2. Send an image:

curl -H "X-Api-Key: YOUR_API_KEY" \
     -F image_file=@photo.jpg \
     -F size=auto \
     https://api.bgbyebye.com/v1.0/removebg \
     -o cutout.png

You get back a transparent PNG. Response headers report the credits charged and where the subject sits in the frame.

Authentication

Send your API key in the X-Api-Key header on every request. Keys look like bgb_live_…. Keep them on your server; never ship them in browser or mobile code.

Credits

Result sizeMax outputCost
preview, small, regular0.25 megapixels¼ credit
medium1.5 megapixels1 credit
hd4 megapixels1 credit
4k10 megapixels1 credit
full, autoInput size, up to 25 megapixels1 credit

Monthly plan credits are used first, then prepaid credits. Failed requests are refunded automatically.

Remove background

POST/v1.0/removebg

Send the image as multipart/form-data (file upload), or as application/json with image_url or image_file_b64.

Parameters

NameTypeDescription
image_filefileSource image (JPG, PNG, WebP), up to 25 MB.
image_file_b64stringBase64-encoded source image, as an alternative to image_file.
image_urlstringPublic http(s) URL to fetch the source image from.
sizestringauto (default), preview, small, regular, medium, hd, 4k, full. See Credits.
formatstringauto (default), png, jpg, webp. auto returns PNG, or JPG when a bg_color is set.
bg_colorstringFill the background with a color: hex like 81d4fa or fff, or a name like white.
cropbooleanCrop to the subject's bounding box. Default false.
crop_marginintegerPixels of padding to keep around the subject when crop=true.
channelsstringrgba (default) for the cutout, or alpha for a grayscale mask only.

Response

By default the body is the image itself. Send Accept: application/json to get JSON instead:

{
  "data": {
    "result_b64": "iVBORw0KGgoAAAANSUhEUgAA…",
    "foreground_top": 112,
    "foreground_left": 86,
    "foreground_width": 640,
    "foreground_height": 918
  }
}
HeaderDescription
X-Credits-ChargedCredits used by this request, e.g. 1 or 0.25.
X-Width, X-HeightDimensions of the result.
X-Foreground-Top, -Left, -Width, -HeightSubject bounding box in the result, in pixels.

Account

GET/v1.0/account

Returns your current plan and credit balance.

{
  "data": { "attributes": {
    "plan": "growth",
    "credits": { "total": 5412.25, "subscription": 5012.25, "payg": 400, "enterprise": 0 },
    "api": { "free_calls": 20049, "sizes": "all" }
  } }
}

Errors

Errors return a non-2xx status and a body in the same shape remove.bg uses:

{ "errors": [ { "title": "Insufficient credits.", "code": "insufficient_credits" } ] }
StatusCodeMeaning
400missing_source, invalid_size, invalid_image_url, failed_to_download, unknown_foregroundSomething about the request or image can't be processed. Not charged.
402insufficient_creditsOut of credits. Upgrade or buy a credit pack.
403auth_failedMissing or invalid API key.
413file_too_largeImage is over 25 MB.
429rate_limit_exceededToo many requests. Wait for Retry-After seconds.
502 / 503upstream_error, service_unavailableTemporary problem on our side. Retry with backoff. Not charged.

Limits

Migrating from remove.bg

Change the base URL from https://api.remove.bg to https://api.bgbyebye.com and use your BG ByeBye key. Paths, parameters, headers and error bodies stay the same.

- https://api.remove.bg/v1.0/removebg+ https://api.bgbyebye.com/v1.0/removebg
Using a remove.bg SDK or plugin? Most let you override the API base URL or endpoint. Point it at https://api.bgbyebye.com and swap the key.

Compatibility

remove.bg featureStatus
image_file, image_file_b64, image_url✅ Supported
size, format (png, jpg, webp), bg_color, crop, crop_margin (pixels), channels✅ Supported
Binary and JSON responses, X-* result headers, error bodies✅ Supported
GET /v1.0/account✅ Supported
type, type_levelAccepted; subject type is detected automatically
format=zip, bg_image_url, bg_image_file🛠 On the roadmap
roi, scale, position, add_shadow, semitransparency, percentage crop_margin🛠 On the roadmap