🍊 Need custom software, an app or an AI integration? Tangerine AI builds it for you.Talk to us →
removebg.win

API reference

Base URL: https://api.removebg.win. Authenticate with your key in the X-Api-Key header. Each successful image costs 1 credit; failed calls are free.

Migrating from remove.bg

Replace https://api.remove.bg with https://api.removebg.win and use your removebg.win key. Paths, parameters, response headers and error codes are the same.

POST /v1.0/removebg

Removes the background. Send the body as multipart/form-data, application/x-www-form-urlencoded or JSON, with one image source.

ParameterValuesNotes
image_filefileUpload (multipart). Max 25 MB.
image_file_b64stringBase64 image, with or without a data: prefix.
image_urlURLPublic http(s) URL of the image.
sizeauto, preview, full, …Accepted for compatibility. Results are always at the original resolution.
typeauto, person, product, carEchoed in X-Type.
formatauto, png, jpg, webpauto: PNG when transparent, JPG when a background is added.
channelsrgba, alphaalpha returns the grayscale mask.
bg_colorhex or color namee.g. 81d4fa, #fff, white. Empty = transparent.
bg_image_url / bg_image_fileURL / fileBackground image, resized to cover the canvas.
croptrue, falseTrims empty space around the subject.
crop_margin10px, 5%, 10px 20px…CSS-style shorthand. px up to 500, % up to 50.
type_level, roi, scale, position, add_shadow, semitransparencyAccepted and ignored, so existing requests do not fail.

Response

By default, the image bytes with the matching Content-Type and these headers: X-Credits-Charged, X-Type, X-Width, X-Height (and X-Foreground-Top/Left/Width/Height when crop=true).

With Accept: application/json:

{ "data": { "result_b64": "iVBORw0…", "foreground_type": "other", "credits_charged": 1 } }

Examples

curl -H 'X-Api-Key: YOUR_KEY' -F 'image_file=@photo.jpg' -F 'size=auto' \
  -f https://api.removebg.win/v1.0/removebg -o no-bg.png

curl -H 'X-Api-Key: YOUR_KEY' -H 'Content-Type: application/json' \
  -d '{"image_url":"https://example.com/photo.jpg","bg_color":"ffffff","format":"jpg"}' \
  -f https://api.removebg.win/v1.0/removebg -o white-bg.jpg
// Node.js 18+
const form = new FormData();
form.append('image_file', new Blob([fs.readFileSync('photo.jpg')]), 'photo.jpg');
const res = await fetch('https://api.removebg.win/v1.0/removebg', {
  method: 'POST', headers: { 'X-Api-Key': process.env.REMOVEBG_WIN_KEY }, body: form,
});
fs.writeFileSync('no-bg.png', Buffer.from(await res.arrayBuffer()));

POST /v2/remove

Same parameters as /v1.0/removebg, but always answers in JSON. Handy for no-code tools (Bubble, Zapier, Make) that handle JSON better than binary files. Extra parameter response:

responseReturns
url (default)A hosted result URL, valid for 24 hours.
b64result_b64 with the image in base64.
binaryThe image bytes, like v1.
{
  "url": "https://api.removebg.win/r/4fJk…Qz.png",
  "expires_at": "2026-12-02T12:00:00.000Z",
  "width": 3000, "height": 4500, "format": "png",
  "credits_charged": 1, "credits_remaining": 41,
  "foreground": null
}

GET /v1.0/account

Your balance, in the remove.bg format:

{ "data": { "attributes": {
  "credits": { "total": 42, "subscription": 40, "payg": 2, "enterprise": 0 },
  "api": { "free_calls": 0, "sizes": "all" } } } }

GET /v2/account returns a simpler shape: { "email", "credits": { "total", "trial", "subscription", "pack", "manual" }, "buy_url" }.

Errors

{ "errors": [ { "title": "Insufficient credits", "code": "insufficient_credits", "detail": "Buy credits at https://removebg.win/app#buy" } ] }
StatusCodeMeaning
400missing_source, invalid_parameters, invalid_image, failed_to_download, file_too_large, unknown_foregroundFix the request. Not charged.
402insufficient_creditsBuy credits.
403auth_failed, key_blockedInvalid or blocked key.
429rate_limit_exceededUp to 120 requests per minute per key. Retry after Retry-After seconds.
503service_unavailable, processing_failedTemporary. Retry later. Not charged.