Background removal APIs compared: inputs, limits and how to choose

Six background removal APIs side by side, from remove.bg and its move to Leonardo.Ai to self-hosted open-source models, with the details that decide which one fits your code.

Updated October 28, 2026 · 9 min read

Skip the steps: remove the background in one click. Upload an image

Most background removal APIs look alike from a distance: you POST an image with an API key and get a cut-out back. The differences that matter show up once you build on one. How do you send the image? What formats come back? How big can the input be? What happens when an image is slow? And what happens to your integration when the provider changes its plans?

This guide compares six options developers use today: remove.bg (and its successor at Leonardo.Ai), Photoroom, Clipdrop, Picsart, self-hosting an open-source model with rembg, and removebackground.dev. Every detail below comes from each provider's own documentation, checked in October 2026 and linked in the sources. Where a provider's docs do not state something, the table says so rather than guessing. Prices are left out on purpose: they change often, and each provider's pricing page is the only reliable place to check them.

The comparison table

remove.bgLeonardo.Ai (remove-bg model)PhotoroomClipdropPicsartrembg (self-hosted)removebackground.dev
Endpointapi.remove.bg/v1.0/removebgcloud.leonardo.ai/api/rest/v2/generationssync (and an async variant)sdk.photoroom.com/v1/segmentclipdrop-api.co/remove-background/v1api.picsart.io/tools/1.0/removebgYour own server (rembg s)removebackground.dev/v1/remove
AuthX-Api-Key headerBearer tokenx-api-key headerx-api-key headerX-Picsart-API-Key headerNone by default; you add your ownx-api-key header
Send a fileYes (image_file)Via an uploaded image idYes (image_file)Yes (image_file)Yes (image)YesYes (image_file)
Send a URLYes (image_url)YesNot on this endpointNot documentedYes (image_url)YesYes (image_url)
Send base64Not documentedYesYes (image_file_b64, JSON)Not documentedNot documentedNot documentedYes (image_file_b64, JSON)
Input formatsNot listed on the API pageNot listedPNG, JPEG, WebP, HEICPNG, JPG, WebPJPG, PNG, WebP, TIFF, BMP, MPO, MJPEG, HEICNot listedJPG, PNG, WebP
Output formatsPNG, JPG, WebP, ZIP (color plus alpha matte)PNG, JPG, WebPPNG, JPG, WebPPNG, WebP, JPGPNG, JPG, WebP; cut-out or maskPNGPNG, JPG, WebP; cut-out, RGB or alpha mask
Size limitsUp to 50 MP output for JPG, WebP and ZIP; 10 MP for PNGPNG output capped at 10 MP50 MB file, 6,000 px on the widest side30 MB file, 25 MP100 MB fileYour RAM, VRAM and patience25 MB file; inputs over 25 MP scaled down; output up to 6,000 px per side
How results come backImage in the responseSync: JSON with a result URL or base64 (about 27 s timeout). Async: generation id plus polling or webhookImage in the responseImage in the responseJSON with a URL to the result, kept 24 hoursImage in the responseImage in the response; a job id (202) if it takes longer than about 55 s; batch endpoint for up to 100 URLs
Default rate limit500 images a minute, scaled by megapixelsNot stated on the page60 images a minute60 requests a minuteNot stated; reported in response headersNone (your hardware)60 requests a minute
Official toolingCLI and Ruby gemREST API docsCode samples for JavaScript, Node.js, Python, iOSNone listedPostman collection, CLIPython library, CLI, HTTP server, DockerOpenAPI 3.1 schema, MCP server, n8n node

Two things stand out. First, input options differ more than you would expect: Photoroom's background removal endpoint takes a file or base64 but not a URL, Clipdrop documents only file uploads, and Picsart and remove.bg take a file or a URL. If your images already live on a CDN, a URL input saves you a download and re-upload step. Second, size limits are stated in different units (file size, megapixels, pixels on the longest side), so check yours against the one that applies.

remove.bg, and its move to Leonardo.Ai

remove.bg has the longest track record of the group, and many tools and plugins were built on its API. Its endpoint takes image_file or image_url, authenticates with an X-Api-Key header, and returns PNG, JPG, WebP or a ZIP that holds a color image and a separate alpha matte you combine yourself. Its docs list output up to 50 megapixels for JPG, WebP and ZIP, and up to 10 megapixels for PNG. The default rate limit is 500 images a minute, scaled by input size, with HTTP 429 when you exceed it. Billing is credit-based, with some free calls each month.

The important news is the end of the self-serve API. remove.bg's owner announced that the standalone remove.bg website and self-serve API end on 1 December 2026 at 09:00 CET, and that background removal moves to Leonardo.Ai (a Canva company). The remove.bg API page itself now says that starting 1 December 2026, background removal moves to Leonardo.Ai. Moving there is not a key swap: Leonardo's API uses a Bearer token, a different endpoint and a JSON request body with the image as an uploaded image id, a URL or base64.

Leonardo's remove-bg model has a sync endpoint, recommended for single images, that answers with JSON containing a result URL or base64 data and times out after about 27 seconds, and an async endpoint for batches and large images that returns a generation id you poll or receive by webhook. Output is PNG, JPG or WebP, with PNG capped at 10 megapixels; Leonardo's docs suggest WebP when you need transparency above that.

If you would rather keep your existing remove.bg code, removebackground.dev runs a remove.bg-compatible endpoint at https://removebackground.dev/v1.0/removebg that accepts remove.bg's parameter names and the same X-Api-Key header, so the change is the endpoint URL and the key. The migration guide lists which options are supported and how responses differ.

Photoroom

Photoroom offers a dedicated Remove Background API (POST /v1/segment) and a broader Image Editing API. The background removal endpoint takes the image as a multipart image_file upload or as base64 in a JSON body (image_file_b64, without the data: prefix). It does not take a URL; Photoroom's docs suggest downloading the image first or using the Image Editing API, which has a URL option and is billed differently.

It accepts PNG, JPEG, WebP and HEIC, returns PNG (default), JPG or WebP, and allows files up to 50 MB and 6,000 pixels on the widest side, with 25 megapixels recommended for performance. The default rate limit is 60 images a minute, with 429 above that. A sandbox mode, enabled by prefixing your key with sandbox_, gives watermarked results for testing. Each call is billed as a call; see Photoroom's pricing page for current rates.

Clipdrop

Clipdrop's remove background API, now part of Jasper, is a single multipart POST with image_file. It accepts PNG, JPG and WebP up to 30 MB and 25 megapixels, and returns an image with the same dimensions as the input: PNG by default, or WebP or JPG if you ask for it in the accept header. Each successful call uses one credit, and the remaining balance comes back in an x-remaining-credits header. The default limit is 60 requests a minute per key.

For development, Clipdrop lets you claim 100 free credits after logging in. URL and base64 inputs are not documented, so plan to upload files.

Picsart

Picsart's endpoint is POST https://api.picsart.io/tools/1.0/removebg with your key in X-Picsart-API-Key. It takes a file (image) or a public image_url, and has the widest input format list here: JPG, PNG, WebP, TIFF, BMP, MPO, MJPEG and HEIC, up to 100 MB. You choose PNG, JPG or WebP output and either a cut-out or a mask, and you can supply a replacement background image.

Unlike the others, Picsart answers with JSON that contains a URL to the result rather than the image itself, and results stay available for 24 hours. That is one extra request per image, but convenient if you only need to pass a link along. The rate limit is not published as a number; responses carry X-Picsart-Ratelimit-* headers and 429 when you exceed it.

Self-hosting: rembg and BiRefNet

rembg is an MIT-licensed tool that runs open-source background removal models as a Python library, a CLI, an HTTP server or a Docker container. rembg s --port 7000 starts a server where POST /api/remove accepts an uploaded file and GET /api/remove?url=... fetches one. It needs Python 3.11 to 3.13, and runs on CPU, NVIDIA GPUs (CUDA) or AMD GPUs (ROCm).

The software is free, but you run and pay for the hardware, and model licenses are separate from rembg's own. The default model, BRIA's RMBG-2.0, requires a paid agreement for commercial use. BiRefNet, available in rembg as birefnet-general and other variants, is MIT-licensed and a common choice when you want a permissive license with soft, well-shaped edges. Self-hosting makes sense when images must not leave your infrastructure, when you already have spare GPUs, or when volume is high enough that a server is cheaper than per-image billing. The Python batch guide walks through rembg setup, model choice and a resumable script.

removebackground.dev

This is our API, so here is what it does without the sales pitch. POST https://removebackground.dev/v1/remove with an x-api-key header accepts a multipart image_file, a JSON image_url, base64 in image_file_b64, or raw image bytes. It takes JPG, PNG or WebP up to 25 MB and returns PNG, JPG or WebP: a transparent cut-out, a solid background color, or an alpha mask, with sizes from preview to full resolution and optional cropping to the subject.

Most images come back in the same response. If one takes longer than about 55 seconds, the API answers 202 with a job id you poll instead of uploading again. POST /v1/batch queues up to 100 image URLs as one job. An Idempotency-Key header makes retries safe from double charges, the default rate limit is 60 requests a minute, and the contract is published as OpenAPI 3.1. Every new account gets 50 free credits, each successful image costs 1 credit, failed images are free, and results are deleted after 48 hours.

A minimal request

Every API above follows the same shape. This is one call to removebackground.dev, saving a transparent PNG:

curl -f -X POST https://removebackground.dev/v1/remove \
  -H "x-api-key: $REMOVEBG_API_KEY" \
  -F image_file=@photo.jpg \
  -F format=png \
  -o no-bg.png

-f makes cURL exit with an error instead of saving a JSON error body as no-bg.png. In production, also check for a 202 status, which means the body is a job id rather than an image. Photoroom, Clipdrop and remove.bg use the same shape: a multipart image_file field and an API key header, with a different URL. Picsart uses image instead of image_file and returns JSON with a link to the result.

How to choose

Start from your constraints, not from feature lists:

  • Your images are already online. Pick an API with URL input: remove.bg (until 1 December 2026), Picsart, Leonardo.Ai, removebackground.dev or a self-hosted rembg server. With Photoroom's segment endpoint or Clipdrop, you download and re-upload.
  • You receive base64 from a browser or mobile app. Photoroom, Leonardo.Ai and removebackground.dev accept it directly.
  • Your inputs are HEIC from iPhones, or TIFF. Photoroom and Picsart accept HEIC; Picsart also takes TIFF and BMP. Elsewhere, convert first.
  • You need very large outputs. Check the exact limit: remove.bg allows up to 50 MP for JPG and WebP, Photoroom caps the widest side at 6,000 px, Clipdrop takes up to 25 MP.
  • You process thousands of images at a time. Look at rate limits and batch support. A batch endpoint or async jobs with polling or webhooks save you from managing hundreds of parallel connections.
  • You have an existing remove.bg integration. Decide before 1 December 2026: rewrite for Leonardo.Ai's API, rewrite for another provider, or point your code at a remove.bg-compatible endpoint.
  • Images must stay on your servers. Self-host rembg with a model whose license fits your use, and budget for GPUs and maintenance.
  • Quality on your images. No table answers this. Run the same 20 to 50 representative images (hair, glass, white products on white, low contrast) through your top two or three candidates and compare at 100% zoom on dark and light backgrounds.

Whichever you pick, keep your API key on the server, never in browser or app code, and save results when you get them, since several providers delete them after a day or two.

Questions

Is there a free background removal API?

Not an unlimited one. removebackground.dev gives every new account 50 free credits (1 credit per image, failed images free), Clipdrop lets developers claim 100 free credits, and Photoroom has a sandbox mode with watermarked results. Self-hosting an open-source model with rembg is free software, but you run and pay for the server, and some models, including rembg's default, need a paid license for commercial use.

Is the remove.bg API shutting down?

remove.bg's owner announced that the standalone remove.bg website and self-serve API end on 1 December 2026 at 09:00 CET, and that the API moves to Leonardo.Ai. Leonardo's API uses different authentication and request formats, so existing integrations need changes either way.

What can I use instead of a remove.bg API key without rewriting my code?

Use a remove.bg-compatible endpoint. removebackground.dev accepts remove.bg's parameter names and X-Api-Key header at https://removebackground.dev/v1.0/removebg, so you change the endpoint URL and put in a removebackground.dev key. The migration guide lists supported options and differences.

Which background removal API accepts image URLs?

remove.bg, Picsart, Leonardo.Ai and removebackground.dev accept a URL, and so does a self-hosted rembg server. Photoroom's background removal endpoint and Clipdrop take uploaded files instead.

Can I self-host a background removal API?

Yes. rembg runs as an HTTP server (rembg s) or Docker container with models such as BiRefNet, which is MIT-licensed. You manage the hardware, scaling and model licenses yourself, and a GPU makes a large difference in speed.

Which output format should I request from a background removal API?

PNG or WebP if you need transparency, JPG on a solid color if the destination does not support transparency, such as many marketplaces. Note that some APIs cap PNG output lower than JPG or WebP: remove.bg and Leonardo.Ai limit PNG to 10 megapixels.

Try it on your own image

New accounts get 50 free credits. One credit per image, no subscription, and credits never expire.

Remove a background

Sources