← Blog
2 min read

Background Removal API

Integrate automatic background removal into your app or workflow with a simple HTTP API — upload an image, get a transparent cutout back in seconds.

  • api
  • developers
  • tutorial
Background Removal API

You can now integrate removerbg's automatic background removal directly into your website, app, or workflow. It's a simple HTTP API: send an image and get back a clean cutout with a transparent background in seconds.

# What you can do

- Upload an image as multipart form data — PNG, JPEG, or WebP, up to 10 MB. - Choose your output format — a transparent PNG (default), or JPEG/WebP with adjustable quality. - Get the result your way — the binary image directly, or a JSON response with a temporary download URL.

Every request runs through our best‑quality model, so there are no tiers to pick from — you always get the highest‑quality cutout. Each successful removal costs 1 credit, and failed requests (such as an invalid key or insufficient credits) are never charged.

# Authentication

Create an API key from your dashboard and send it as a Bearer token:

`` Authorization: Bearer rmbg_YOUR_API_KEY ``

Wondering what happens to the images you send? The API follows the same practices as the rest of the product — here's how we approach security and privacy at remover.bg.

# Quick start

Remove a background with a single request:

`` curl -X POST "https://api.remover.bg/remove-bg?format=png" \ -H "Authorization: Bearer rmbg_YOUR_API_KEY" \ -F "file=@photo.jpg" \ --output result.png ``

Or from JavaScript:

``` const form = new FormData(); form.append("file", fileInput.files[0]);

const res = await fetch("https://api.remover.bg/remove-bg", { method: "POST", headers: { Authorization: "Bearer rmbgYOURAPI_KEY" }, body: form, });

if (!res.ok) throw new Error(await res.text()); const blob = await res.blob(); // your transparent PNG ```

# Options

- formatpng (default), jpeg, or webp. - quality — a value from 0 to 1 for JPEG/WebP compression. - trimtrue (default) crops away the empty transparent margins. - responseimage for the binary file (default), or url for a JSON response with a temporary link (valid for ~24 hours).

> Every response includes an X-Credits-Remaining header, so you can keep track of your usage.

# Processing at scale

One request handles one image, but the same endpoint powers entire catalogs: run it on upload, in nightly batch scripts, or inside a PIM/DAM pipeline. Our guide to bulk background removal walks through those patterns, plus the QA sampling tactics that keep thousands of cutouts consistent.

# Get started in minutes

With our API docs and ready‑to‑copy code samples, you can be up and running in just a few minutes. We'd love to hear what you build.

Keep reading