Move from remove.bg in one line
remove.bg closes on 1 December 2026. If your code calls its API, point it at Erase BG instead. The path, the header and the parameters stay the same:
- https://api.remove.bg/v1.0/removebg
+ https://erasebg.org/v1.0/removebgThen swap your remove.bg key for an Erase BG key. You get one from API keys in your account once you have Pro. Read what is changing at remove.bg for the rest of the story.
Pricing and limits
- Included with Pro. $7.99 a month or $59 a year, with no separate API bill.
- 1,000 images a month, counted per account, reset on the 1st (UTC). Only successful images count.
- 30 calls a minute per account.
- Full resolution, up to 4000 px on the longest side, with no watermark.
- Photos up to 12 MB as JPG, PNG, WebP or HEIC.
See pricing for everything else Pro includes.
Quick start
Send a photo and save the cut-out as a PNG:
curl -H "X-Api-Key: YOUR_KEY" \
-F "image_file=@photo.jpg" \
-F "size=auto" \
-o cutout.png \
https://erasebg.org/v1.0/removebgIn Python, with the requests library:
import requests
response = requests.post(
"https://erasebg.org/v1.0/removebg",
files={"image_file": open("photo.jpg", "rb")},
data={"size": "auto"},
headers={"X-Api-Key": "YOUR_KEY"},
)
if response.ok:
open("cutout.png", "wb").write(response.content)
else:
print(response.status_code, response.json()["errors"][0]["title"])In Node.js 18 or newer:
import { readFile, writeFile } from 'node:fs/promises';
const form = new FormData();
form.append('image_file', new Blob([await readFile('photo.jpg')]), 'photo.jpg');
form.append('size', 'auto');
const response = await fetch('https://erasebg.org/v1.0/removebg', {
method: 'POST',
headers: { 'X-Api-Key': 'YOUR_KEY' },
body: form,
});
if (!response.ok) throw new Error((await response.json()).errors[0].title);
await writeFile('cutout.png', Buffer.from(await response.arrayBuffer()));Parameters
Send them as multipart form data, a URL-encoded form or JSON. Give exactly one of the three image fields.
| Parameter | What it does |
|---|---|
| image_file | The photo as a file upload. |
| image_file_b64 | The photo as base64 text. |
| image_url | A public http or https link to the photo. Private and local addresses are refused. |
| size | auto or full (up to 4000 px, the default), 4k, hd (about 4 megapixels), medium (1.5 MP), preview, small or regular (0.25 MP). |
| format | auto (PNG, or JPG when bg_color is set), png, jpg or webp. |
| bg_color | A hex colour such as 81d4fa to fill the background instead of leaving it see-through. |
| crop | true trims empty space around the subject. |
| channels | rgba (the default) for the cut-out, or alpha for the black and white mask only. |
Responses
A successful call returns the image itself with these headers: X-Width, X-Height, X-Credits-Charged (always 1) and X-Type. Send Accept: application/json to get {"data": {"result_b64": "..."}} instead.
GET https://erasebg.org/v1.0/account with your key returns the images left this month as data.attributes.credits.total, the same place remove.bg reports credits, so plugins that show a balance keep working.
Errors
Errors come back as JSON in remove.bg’s shape, {"errors": [{"title": "...", "code": "..."}]}:
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_parameters, invalid_image | A parameter is wrong, or the file is not a photo we can read. |
| 400 | unknown_foreground | No subject could be found in the photo. |
| 402 | insufficient_credits | Pro is not active, or this month’s images are used up. |
| 403 | auth_failed | The key is missing, wrong or revoked. |
| 429 | rate_limit_exceeded | More than 30 calls in a minute. Wait for Retry-After seconds. |
Your images are used only to make your results and are never shared. Erase BG is not affiliated with remove.bg or Canva.