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.

Red children's shoes on a wooden table; the right half shows the same shoes cut out by the API4AI Background Removal API on a transparent background

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.bgAPI4AI
Remove a backgroundPOST https://api.remove.bg/v1.0/removebgPOST https://api4ai.cloud/img-bg-removal/v1/rbg/v1.0/removebg
BalanceGET https://api.remove.bg/v1.0/accountGET https://api4ai.cloud/img-bg-removal/v1/rbg/v1.0/account
Keyyour remove.bg key in the X-Api-Key headeran 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.png

Python (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.png

Node (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 monthremove.bg (subscription)Leonardo.AiPhotoroom (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.bgAPI4AI
EndpointPOST https://api.remove.bg/v1.0/removebgPOST https://api4ai.cloud/img-bg-removal/v1/results
KeyX-Api-Key headerX-API-KEY header
A fileform field image_fileform field image
A linkimage_urlurl
Resultthe image itselfJSON, with the PNG as base64 in results[0].entities[]
A photo it can't processan HTTP errorHTTP 200 with status.code = "failure" and the reason
Inputup to 25 megapixels with size=autoJPEG or PNG, under 16 MB, up to 4096×4096
size, format, crop, bg_colorparametersthe 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 imagebg_image_file, bg_image_urlimage-bg, url-bg
Shadows, type, roi, scale, position, ZIPsupportednot 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.png

API4AI

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.png

The 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

Before December 1

  1. Put five of your hardest photos through the demo: glass, hair, white on white.

  2. Get a key on the developer portal. No credit card; $5 free, then from $5 per 1,000 images.

  3. 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.