Moving from the remove.bg API
remove.bg's standalone website and self-serve API close on December 1, 2026, at 9:00 CET. Its API docs say background removal moves to Leonardo.Ai from that day, and its pay-as-you-go credits expire at the same moment. If your code, shop plugin or no-code flow calls api.remove.bg, it needs a new provider within weeks.
This page compares what the options cost and shows how to switch to ours: keep your code and change the URL and the key, or move to our native API.
$5 free, no subscription, your balance never expires. $5 covers 1,000 background removals. Try the demo first.
New URL and key, same code
Since November 9 we answer remove.bg's API calls: the same paths, almost all of its parameters, the image itself in the response, and remove.bg's error format. For most code, only the URL and the key change. What isn't supported is listed below, so check it against what your code uses, and run a day's photos through both before Dec 1.
Price per image, the same for every size:
type=car: $0.03
type=person: $0.015
everything else, including type=auto (general background removal): $0.005
For cars and people, set type=car or type=person for the best results.
| remove.bg | API4AI | |
|---|---|---|
| Remove a background | POST https://api.remove.bg/v1.0/removebg | POST https://api4ai.cloud/img-bg-removal/v1/rbg/v1.0/removebg |
| Balance | GET https://api.remove.bg/v1.0/account | GET https://api4ai.cloud/img-bg-removal/v1/rbg/v1.0/account |
| Key | your remove.bg key in the X-Api-Key header | an API4AI key in the X-Api-Key header, created on portal.api4.ai ($5 free, no card) |
cURL
curl -H "X-Api-Key: $API4AI_KEY" \
-F "image_file=@car.jpg" \
-F "size=auto" \
-F "type=car" \
-f https://api4ai.cloud/img-bg-removal/v1/rbg/v1.0/removebg -o no-bg.pngPython (requests)
import requests
r = requests.post(
"https://api4ai.cloud/img-bg-removal/v1/rbg/v1.0/removebg", # was https://api.remove.bg/v1.0/removebg
headers={"X-Api-Key": API4AI_KEY},
files={"image_file": open("car.jpg", "rb")},
data={"size": "auto", "type": "car"},
)
r.raise_for_status()
open("no-bg.png", "wb").write(r.content)Python (the removebg package)
import removebg.removebg
from removebg import RemoveBg
removebg.removebg.API_ENDPOINT = "https://api4ai.cloud/img-bg-removal/v1/rbg/v1.0/removebg"
rmbg = RemoveBg(API4AI_KEY, "error.log")
rmbg.remove_background_from_img_file("photo.jpg") # writes photo.jpg_no_bg.pngNode (18+)
import fs from "node:fs";
const form = new FormData();
form.append("image_file", await fs.openAsBlob("car.jpg"), "car.jpg");
form.append("size", "auto");
form.append("type", "car");
const res = await fetch("https://api4ai.cloud/img-bg-removal/v1/rbg/v1.0/removebg", {
method: "POST",
headers: { "X-Api-Key": process.env.API4AI_KEY },
body: form,
});
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
fs.writeFileSync("no-bg.png", Buffer.from(await res.arrayBuffer()));Supported: image_file, image_url and image_file_b64; size, type, type_level, format (including zip and webp), channels, bg_color, bg_image_url and bg_image_file, roi, crop, crop_margin, scale, position, shadow_type (car, drop, auto), shadow_opacity, add_shadow; JSON output with Accept: application/json; GET /account.
Not supported:
3D shadows: shadow_type=3D returns an error, and shadow_type=auto gives people no shadow.
Semi-transparent car windows: semitransparency is accepted but has no effect.
OAuth: API keys only.
Rate-limit headers and 429 responses.
Results above 4096×4096 pixels (larger photos are scaled down to fit).
Works differently:
Amounts are in US dollars, not credits: /account shows your balance in dollars, and X-Credits-Charged gives each call's cost in dollars.
X-Type is person, car or other.
The cut-outs come from our own models, so edges and crop sizes can differ from remove.bg's by a few pixels.
Errors from our gateway (a wrong path, an upload over 32 MB) don't use remove.bg's error format.
How we handle your images: Terms of Use.
Three ways out
Leonardo.Ai is remove.bg's official successor. It's a new API, not the same one at a new address: JSON requests with a Bearer key, the image as a link or base64 instead of a file upload, and the result as a link or base64. $0.1047 an image.
Photoroom built its API as a drop-in: by its own migration post, you change the endpoint and the key, and the main remove.bg parameters carry over. $0.02 an image on its Basic plan.
API4AI is pay as you go, with no subscription. Our remove.bg-compatible endpoint takes most remove.bg code as it is: change the URL and the key (above). $0.005 an image for general background removal, $0.015 for people, $0.03 for cars.
Photoroom and API4AI both take most remove.bg code with a new URL and key. The table below compares what each costs.
What it costs per month
| Images a month | remove.bg (subscription) | Leonardo.Ai | Photoroom (Basic) | API4AI |
|---|---|---|---|---|
| 1,000 | $189 (1,200-credit plan) | $104.70 | $20 | $5 |
| 10,000 | $989 | $1,047 | $200 | $50 |
| 50,000 | $3,950 | $5,235 | $1,000 | $250 |
List prices from each company's public page, checked October 27, 2026: remove.bg, Leonardo.Ai, Photoroom. For remove.bg, the smallest subscription that covers the volume; it ends on Dec 1, so this is what you pay now, not an option. API4AI prices are for general background removal; car photos cost $0.03 an image and people $0.015.
We're not the cheapest background removal API on the market, and we don't claim to be. What we offer: pay as you go with no subscription, a balance that never expires, no GPU to run, commercial use of the results, and $5 free to start.
Photoroom gives volume discounts on its Enterprise plan from 200,000 images a year; we give a volume price from about 15,000 images a month: ask us.
Or move to our native API: what changes in the call
| remove.bg | API4AI | |
|---|---|---|
| Endpoint | POST https://api.remove.bg/v1.0/removebg | POST https://api4ai.cloud/img-bg-removal/v1/results |
| Key | X-Api-Key header | X-API-KEY header |
| A file | form field image_file | form field image |
| A link | image_url | url |
| Result | the image itself | JSON, with the PNG as base64 in results[0].entities[] |
| A photo it can't process | an HTTP error | HTTP 200 with status.code = "failure" and the reason |
| Input | up to 25 megapixels with size=auto | JPEG or PNG, under 16 MB, up to 4096×4096 |
size, format, crop, bg_color | parameters | the result is always a full-size PNG with a transparent background; crop, color and JPG are a few lines in your code |
| Your own background image | bg_image_file, bg_image_url | image-bg, url-bg |
Shadows, type, roi, scale, position, ZIP | supported | not available |
Our native API has no shadows or product modes (see the table above); the compatible endpoint takes shadow_type car, drop or auto. If your images depend on them, run a few of your own photos through the API before you switch: the demo shows only the basic cut-out, and the $5 free credit covers 1,000 test images. For car photos we have a separate Car Background Removal API, with optional realistic shadows, background replacement and license-plate blurring.
The same call, before and after
cURL
remove.bg
curl -H "X-Api-Key: $REMOVEBG_KEY" \
-F "image_file=@car.jpg" \
-F "size=auto" \
-f https://api.remove.bg/v1.0/removebg -o no-bg.pngAPI4AI
curl -s -X POST "https://api4ai.cloud/img-bg-removal/v1/results" \
-H "X-API-KEY: $API4AI_KEY" \
-F "image=@car.jpg" \
| jq -r '.results[0].entities[] | select(.kind == "image") | .image' \
| base64 --decode > no-bg.pngThe PNG is inside the JSON, so jq picks it out and base64 decodes it.
Python
remove.bg
import requests
r = requests.post(
"https://api.remove.bg/v1.0/removebg",
headers={"X-Api-Key": REMOVEBG_KEY},
files={"image_file": open("car.jpg", "rb")},
data={"size": "auto"},
)
r.raise_for_status()
open("no-bg.png", "wb").write(r.content)API4AI
import base64
import requests
r = requests.post(
"https://api4ai.cloud/img-bg-removal/v1/results",
headers={"X-API-KEY": API4AI_KEY},
files={"image": open("car.jpg", "rb")},
)
r.raise_for_status()
result = r.json()["results"][0]
if result["status"]["code"] != "ok": # HTTP 200 can still be a failure
raise RuntimeError(result["status"]["message"])
image = next(e for e in result["entities"] if e["kind"] == "image")
open("no-bg.png", "wb").write(base64.b64decode(image["image"]))Node (18+)
remove.bg
import fs from "node:fs";
const form = new FormData();
form.append("size", "auto");
form.append("image_file", await fs.openAsBlob("car.jpg"), "car.jpg");
const res = await fetch("https://api.remove.bg/v1.0/removebg", {
method: "POST",
headers: { "X-Api-Key": process.env.REMOVEBG_KEY },
body: form,
});
if (!res.ok) throw new Error(`${res.status}: ${res.statusText}`);
fs.writeFileSync("no-bg.png", Buffer.from(await res.arrayBuffer()));API4AI
import fs from "node:fs";
const form = new FormData();
form.append("image", await fs.openAsBlob("car.jpg"), "car.jpg");
const res = await fetch("https://api4ai.cloud/img-bg-removal/v1/results", {
method: "POST",
headers: { "X-API-KEY": process.env.API4AI_KEY },
body: form,
});
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
const result = (await res.json()).results[0];
if (result.status.code !== "ok") throw new Error(result.status.message);
const image = result.entities.find((e) => e.kind === "image");
fs.writeFileSync("no-bg.png", Buffer.from(image.image, "base64"));The one line not to skip. When our service can't process a photo (it's corrupted, isn't really a JPEG or PNG, or is larger than 4096×4096), it still answers HTTP 200, with "failure" and the reason in the JSON. remove.bg code usually checks only the HTTP status. Port that check as it is, and a failed photo looks like a success that wrote nothing. Every sample above checks status.code; keep that line.
Full reference: Background Removal API docs.
No-code flows
If a Zapier, Make or n8n flow has a remove.bg step, you don't need a new app or template. Replace the step with the tool's plain HTTP request (Webhooks by Zapier, Make's HTTP module, n8n's HTTP Request node): POST to https://api4ai.cloud/img-bg-removal/v1/results, an X-API-KEY header with your key, and a form field "url" with a public link to the photo (or "image" with the file). The cut-out comes back as base64 in results[0].entities[0].image. In n8n the Convert to File node turns it into a file; in Make the toBinary() function does; in Zapier you'll need a short Code step.
FAQ
-
remove.bg's standalone website and self-serve API close on December 1, 2026, at 9:00 CET. Its API docs say background removal moves to Leonardo.Ai from that day, and its pay-as-you-go credits expire at the same moment.
-
In most cases, yes. Change the URL to https://api4ai.cloud/img-bg-removal/v1/rbg/v1.0/removebg and put an API4AI key in the X-Api-Key header; almost all remove.bg parameters work, and the response and the errors keep remove.bg's format. Not supported: 3D shadows, semi-transparent car windows, OAuth and results above 4096×4096 (the full list is at the top of this page). Per image: $0.005 for general background removal (type=auto), $0.015 for type=person, $0.03 for type=car. For cars and people, set the type for the best results.
-
No subscription. You get $5 of free credit when you sign up, enough for 1,000 background removals, then pay as you go at $5 per 1,000 images for general background removal ($15 for people, $30 for cars). Your balance never expires. From about 15,000 images a month, ask us for a volume price.
-
Yes. The results are yours to use in your own products, ads and listings (Terms of Use).
-
JPEG or PNG, under 16 MB and up to 4096×4096 pixels, as a file or a public link. The result is a full-size PNG with a transparent background.
Before December 1
Put five of your hardest photos through the demo: glass, hair, white on white.
Get a key on the developer portal. No credit card; $5 free, then from $5 per 1,000 images.
Change the URL and the key, and run a day's photos through both before your remove.bg credits run out.
$5 free, no subscription, your balance never expires.