Moving from the remove.bg API
remove.bg's standalone website closes 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 the code change for ours, the API4AI Background Removal API.
$5 free, no subscription, your balance never expires. $5 covers 1,000 background removals. Try the demo first.
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 at $0.005 an image, with no subscription. The request is close to remove.bg's; the response is different (JSON with the image inside), so a few lines of your code change. They're shown below.
If you need zero code changes, Photoroom is the honest answer. If you can spend half an hour on the code, read on.
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.
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.
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 Background Removal API has no shadows or product modes (see the table above). 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 closes 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.
-
No. The request is close (a new address, key and field names), but the result comes back as JSON with the image inside, not as the image itself. The samples above show the change; it's about a dozen lines.
-
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. 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 $5 per 1,000 images.
Swap the call, and run a day's photos through both before your remove.bg credits run out.
$5 free, no subscription, your balance never expires.