02 — API
Familiar fields, on our host.
If an integration already speaks that request shape, the fields here are familiar on purpose, so the move can stay small. remover.dev is its own product. The model is U²-NetP (Apache-2.0), a compatibility matte, not the remove.bg model. type is echoed and does not switch models. Shadows and semitransparency are accepted and ignored.
Create a key
The key is shown once. A new email receives 5 test credits.
- Create a key. POST /api/keys with an email, or use the form on this page. The key is shown once.
- Send the image. POST /v1.0/removebg with header X-Api-Key and one of image_file, image_file_b64, or image_url.
- Read credits. GET /v1.0/account. credits.payg does not expire. credits.subscription is the current monthly allowance. credits.total is the sum.
- POST /v1.0/removebg
- Remove a background. Header X-Api-Key. One of image_file, image_file_b64, image_url.
- GET /v1.0/account
- credits.payg is purchased and signup credits (they do not expire). credits.subscription is the current monthly allowance (it resets). credits.total is the sum. enterprise is 0. api.free_calls is 0. api.sizes is "all".
- size
- preview (default), medium, hd, 4k, full, 50mp, auto. small and regular mean preview. auto is full when the balance is at least 1 credit, otherwise preview.
- format
- auto, png, jpg, webp, zip. zip contains color.jpg and alpha.png. channels=alpha returns a grayscale mask.
- Credits
- Preview is 0.25. Every other size is 1, then reduced to 0.25 when the output is at most 0.25 megapixels. Response header X-Credits-Charged.
- Errors
- JSON {"errors":[{"title","code"}]}. 400 invalid parameters or file, 402 insufficient credits, 403 auth, 429 rate limit, 502 processing failed, 503 service_unavailable when the processing line is full. 429 and 503 carry Retry-After in seconds. Only a successful image is charged; errors cost nothing.
- Concurrency
- Images are processed one at a time, in arrival order. A request waits up to about 10 seconds for its turn, then gets 503 with Retry-After. Retry with the same Idempotency-Key and it is charged once.
- Idempotency-Key
- Optional. 1–200 letters, numbers, or . _ : ~ -. The same key charges a request once, including a retry after a crash.
curl -H "X-Api-Key: $REMOVER_API_KEY" \ -F "image_file=@image.png" \ -F "size=auto" \ -o no-bg.png \ https://remover.dev/v1.0/removebg
import { readFile, writeFile } from "node:fs/promises";
const body = new FormData();
body.set("image_file", new Blob([await readFile("image.png")]), "image.png");
body.set("size", "auto");
const response = await fetch("https://remover.dev/v1.0/removebg", {
method: "POST",
headers: { "X-Api-Key": process.env.REMOVER_API_KEY },
body,
});
if (!response.ok) throw new Error(await response.text());
await writeFile("no-bg.png", Buffer.from(await response.arrayBuffer()));import os, requests
response = requests.post(
"https://remover.dev/v1.0/removebg",
headers={"X-Api-Key": os.environ["REMOVER_API_KEY"]},
files={"image_file": open("image.png", "rb")},
data={"size": "auto"},
)
response.raise_for_status()
open("no-bg.png", "wb").write(response.content)connection = RemoveBg::HttpConnection.build("https://remover.dev")
client = RemoveBg::ApiClient.new(connection: connection)
client.remove_from_file(
"image.png",
RemoveBg::RequestOptions.new(api_key: ENV["REMOVER_API_KEY"], size: "auto")
).save("no-bg.png")$request = curl_init("https://remover.dev/v1.0/removebg");
curl_setopt_array($request, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: " . getenv("REMOVER_API_KEY")],
CURLOPT_POSTFIELDS => ["image_file" => new CURLFile("image.png"), "size" => "auto"],
]);
file_put_contents("no-bg.png", curl_exec($request));// The official remove.bg plugin always calls api.remove.bg.
// If your own plugin or theme posts the image, this is the endpoint:
$endpoint = "https://remover.dev/v1.0/removebg";
$request = wp_remote_post($endpoint, [
"headers" => ["X-Api-Key" => getenv("REMOVER_API_KEY")],
"body" => ["image_url" => $product_image_url, "size" => "auto"],
]);# The remove.bg Shopify app cannot point at another host. # Call the HTTP API from a custom app with the same POST body. curl -H "X-Api-Key: $REMOVER_API_KEY" \ -F "image_url=$PRODUCT_IMAGE_URL" \ -F "size=auto" \ -o no-bg.png \ https://remover.dev/v1.0/removebg
The Ruby gem’s high-level helper always uses api.remove.bg. Build RemoveBg::HttpConnection with this origin, then use RemoveBg::ApiClient. Rate limit is 60 requests per minute per key. Maximum upload is 22 MB; image_url is the path for larger files when the platform request-body limit is lower. PNG output above 10 megapixels is not offered — use jpg, webp, or zip.