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.

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

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

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.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 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.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 $5 per 1,000 images.

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