Skip to contentremove.bg closes on 1 December — switch in one minute, your API code included →
removingbackground.io

Developer API

Background removal API

Remove backgrounds and upscale images from your own app, store or workflow with one HTTP request. Same AI quality as the website, same credits.

  • • 50 free preview calls every month
  • • HD from $0.005 per image
  • • Transparent PNG, WebP or JPG with any background colour
  • • AI upscaling 2× / 4× via /v1/upscale
  • • Moving from remove.bg? /v1.0/removebg accepts the same requests — migration guide
curl -X POST https://www.removingbackground.io/v1/removebg \
  -H "X-Api-Key: YOUR_API_KEY" \
  -F "image_file=@photo.jpg" \
  -F "size=full" \
  -o photo-no-bg.png

Authentication

Create a key in your dashboard and send it in the X-Api-Key header (or as Authorization: Bearer …). Never expose keys in client-side code.

POST /v1/removebg

Send multipart/form-data. The response body is the image itself.

ParameterTypeDescription
image_filefileThe image (JPG, PNG, WebP, HEIC; max 25 MB). One of image_file, image_file_b64 or image_url is required.
image_file_b64stringBase64-encoded image (a data: URL prefix is allowed).
image_urlstringPublic http(s) URL of the image.
sizestringpreview (free, max 800×800px, counts against monthly free calls), full (1 credit) or auto (default — full if you have credits, else preview).
typestringauto (default) or person — uses a portrait-tuned model for people.
formatstringpng (default), webp, or jpg (jpg needs bg_color or gets white).
bg_colorstringHex colour like #ffffff to fill the background instead of transparency.
cropbooleantrue to crop the result to the subject.
crop_marginnumberMargin around the crop as a fraction of the image size (0–0.5).

Response headers

  • X-Width, X-Height — result dimensions
  • X-Type — preview or full
  • X-Credits-Charged, X-Credits-Remaining

POST /v1/upscale

Parameters: image_file / image_file_b64 / image_url, scale (2 or 4), size, format. Costs 1 credit for 2× and 2 credits for 4×. Transparency is preserved.

curl -X POST https://www.removingbackground.io/v1/upscale \
  -H "X-Api-Key: YOUR_API_KEY" \
  -F "image_file=@small.jpg" \
  -F "scale=4" -F "size=full" \
  -o large.png

Errors

Errors return JSON: {"error": {"code": "…", "message": "…"}}

StatusCodeMeaning
400invalid_imageMissing, empty, unsupported or corrupt image.
401invalid_api_keyMissing or revoked X-Api-Key.
402insufficient_credits / free_quota_exceededTop up credits or wait for next month's free calls.
413file_too_largeImage over 25 MB, or upscale output over 8,000px.
429rate_limitedToo many requests — back off and retry.
502processing_failedTemporary processing error. Credits are refunded automatically.

API questions

Still have questions? Contact us

Is there a free background removal API?

Yes. Every account gets 50 free preview calls per month (results up to 800×800px). Full-resolution calls use credits.

How fast is the API?

Typical requests finish in a few seconds on GPU. Send requests in parallel for bulk jobs; the per-key rate limit is 10 requests per second.

Is the API compatible with remove.bg?

The request style is similar (multipart image_file / image_url, size, bg_color, crop), so migrating usually only means changing the URL and the API key.

Do you store images sent to the API?

No. API images are processed in memory and discarded right after the response is sent.