Developer API

Remove backgrounds with ClearBG AI

Simple, fast, production-ready API for background removal at scale. Built for developers, creators, and enterprise automation.

Code Examples

Start integrating in seconds

curl

curl -X POST https://api.clearbg.ai/removebg \
  -H "X-API-Key: YOUR_API_KEY" \
  -F "image=@/path/input.jpg" \
  -o output.png

js

import fetch from "node-fetch";

const form = new FormData();
form.append("image", fs.createReadStream("input.jpg"));

const res = await fetch("https://api.clearbg.ai/removebg", {
  method: "POST",
  headers: { "X-API-Key": process.env.CLEARBG_KEY },
  body: form
});

const blob = await res.blob();

python

import requests

files = {"image": open("input.jpg", "rb")}
headers = {"X-API-Key": "YOUR_KEY"}

r = requests.post("https://api.clearbg.ai/removebg", headers=headers, files=files)

open("output.png", "wb").write(r.content)

Built for developers

Fast & scalable

1–2 seconds per image with enterprise-grade throughput.

Secure by default

All data processed securely with automatic cleanup.

Simple integration

Works with any backend — Node, Python, PHP, Go, Rust, etc.

API Endpoints

Clean, simple REST API

POST

/removebg

Remove background from one image.

POST

/bulk

Process up to 50 images at once.

GET

/usage

Check credit usage.

Simple Pricing

Pay only for what you use

$0.01 / image

HD processing uses 3 credits per image

Start building with ClearBG AI

Get your API key and integrate in under 2 minutes.