1 credit per call

Background Removal API

Remove image backgrounds programmatically with a single POST request. One API key, transparent PNG output, and a stateless service that never stores the images you send.

  • REST · JSON
  • No watermark
  • Nothing stored
endpoint

POST /v1/remove-background

Base URL
https://app.imggen.ai
Auth
Authorization: Bearer sk_live_…
Cost
1 credit
Input
JPEG (JPG), PNG and WebP · max 25 MB

01 — Overview

What is the Background Removal API?

The ImgGen AI background removal API is a REST endpoint that separates the foreground subject from the background of a photo and returns a transparent PNG. You upload an image over HTTPS, the AI detects the subject automatically, and the cutout comes back base64-encoded in the JSON response. No mask or manual selection is needed.

It is one of seven endpoints in the ImgGen AI image editing API, all of which share a single API key, a single base URL, and the same request and response shape. If you also need this capability in a browser rather than from code, the same AI model powers the Background Remover tool.

02 — Request

Request parameters

Send a POST request to https://app.imggen.ai/v1/remove-background, authenticated with an API key in the Authorization header.

Parameters accepted by this endpoint
ParameterTypeRequiredDefaultDescription
imagefileREQUIREDThe input image to process. Accepts JPEG (JPG), PNG and WebP, up to 25 MB.
03 — Integrate

How do I integrate the background removal API?

Create an API key in your ImgGen account, set it as an environment variable, and call the endpoint. Here is the same request in cURL, Node.js and Python.

curl --request POST \
  --url 'https://app.imggen.ai/v1/remove-background' \
  --header 'Authorization: Bearer sk_live_YOUR_API_KEY' \
  --form image=@/path/to/photo.jpg
04 — Response

Response

A successful call returns JSON. The result is base64-encoded — decode it before writing to disk or object storage. Every successful response also carries an X-Credit-Remaining header with your balance after the call.

{
  "success": true,
  "message": "Background removed successfully",
  "image": "iVBORw0KGgoAAAANSUhEUgAA...SUVORK5CYII="
}
05 — Limits

Limits and behaviour worth knowing

The endpoint accepts JPEG (JPG), PNG and WebP with a 25 MB maximum file size, and responds synchronously within 60 seconds — there is no job to poll and no webhook to configure.

Transparent PNG output

The result is returned with a real alpha channel, so you can composite it onto any background, colour, or template without a second request.

No mask required

Subject detection is automatic — the foreground is separated from the background for you. There is nothing to brush, trace, or pass as a second parameter: send the input image and read the result.

Nothing is stored

The input is held in a temporary object for the duration of the call and deleted afterwards. Useful when you are processing customer photos you are not allowed to retain.

06 — In production

What is the background removal API used for?

Where teams put this endpoint into production to process images programmatically, at scale.

E-commerce catalogs

Strip backgrounds from supplier product images on upload so every listing shows a clean, consistent cutout without a manual editing step.

Marketplaces and classifieds

Normalize seller-uploaded photos automatically. Run each upload through the endpoint and store the transparent PNG alongside the original.

Print-on-demand

Isolate artwork and subjects before compositing them onto mockups, so previews render correctly at any product size.

Design and editor SaaS

Give your users one-click background removal inside your own product without training a model, hosting it, or running your own inference on AWS or anywhere else.

07 — Cost

How much does the background removal API cost?

Each successful call costs 1 credit, so your effective cost per image follows whichever plan you are on. Credits come from your plan and are shared across every endpoint and the web editor, so you are not buying a separate quota per tool. A call that fails is refunded automatically. See the full pricing page for details.

ImgGen AI plans and API access
PlanPriceCreditsAPI
Free$050 one-time free creditsNo API access
Starter$9.99 / month400 credits / monthAPI access included
Pro$29.99 / month1,400 credits / monthAPI access + priority support
EnterpriseCustomCustom volumeDedicated infrastructure

Credit costs and limits last verified 2026-08-27.

08 — Related

Teams using the background removal API usually reach for these next.

Watermark Removal APIText Removal APIBackground Remover (web tool)All API endpoints

Also available: Image Upscaling, Photo Restoration, Photo Colorization, Image Generation.

FAQ

Background Removal API FAQ

It is an HTTP endpoint that takes a photo and returns the same photo with the background removed and the subject preserved on a transparent layer. Because it is an API rather than an editor, you can call it from a backend job, a queue worker, or a user upload handler and process thousands of images without anyone opening a browser.

Get started

Start calling the Background Removal API

One key unlocks all seven endpoints. No watermark, full commercial rights, and nothing you send is stored after the response is returned.

Get your API key