Background Removal API

Remove image backgrounds with AI. Simple REST API. 5 free images/month. From $0.01/image — the $10/mo remove.bg alternative.

Quickstart

Get started in 30 seconds. No credit card required.

1. Get your API key

Sign up at cleanbg.pages.dev, then go to your dashboard to generate an API key. Or use the API:

2. Remove a background

Send a POST request with your image (base64 JSON or raw binary):

curl -X POST https://cleanbg-api.sundeen10.workers.dev/api/v1/remove-bg \
  -H "X-API-Key: cbg_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"image": "BASE64_IMAGE_DATA"}'

Or send raw binary:

curl -X POST https://cleanbg-api.sundeen10.workers.dev/api/v1/remove-bg \
  -H "X-API-Key: cbg_your_api_key_here" \
  -H "Content-Type: image/png" \
  --data-binary @photo.png

JavaScript Example

// Node.js / Browser
var response = await fetch("https://cleanbg-api.sundeen10.workers.dev/api/v1/remove-bg", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-API-Key": "cbg_your_api_key_here"
  },
  body: JSON.stringify({
    image: base64ImageData,  // base64-encoded image
    type: "image/jpeg"       // optional: image/jpeg, image/png, image/webp
  })
});

var data = await response.json();
// data.image = base64-encoded PNG with transparent background
// data.usage = { used: 5, limit: 50, remaining: 45 }

Python Example

import requests, base64

with open("photo.jpg", "rb") as f:
    image_b64 = base64.b64encode(f.read()).decode()

resp = requests.post(
    "https://cleanbg-api.sundeen10.workers.dev/api/v1/remove-bg",
    headers={"X-API-Key": "cbg_your_api_key_here"},
    json={"image": image_b64, "type": "image/jpeg"}
)

result = resp.json()
with open("result.png", "wb") as f:
    f.write(base64.b64decode(result["image"]))

API Reference

POST/api/v1/remove-bg

Remove the background from an image. Returns a PNG with transparent background.

Headers

HeaderRequiredDescription
X-API-KeyYesYour API key (starts with cbg_)
Content-TypeYesapplication/json or image/*

JSON Body

FieldTypeDescription
imagestringBase64-encoded image data (max 10MB)
typestringOptional. MIME type: image/jpeg, image/png, image/webp
Success Response (200)
{
  "image": "iVBORw0KGgo...",        // base64 PNG with transparent bg
  "format": "image/png",
  "usage": {
    "used": 6,
    "limit": 50,
    "remaining": 44
  }
}
Error Responses
StatusCodeDescription
401missing_api_keyNo X-API-Key header provided
401invalid_api_keyAPI key not found or revoked
413too_largeImage exceeds 10MB limit
429limit_reachedMonthly usage limit exceeded
500processing_errorImage processing failed

GET/api/v1/usage

Check your current usage and remaining quota.

Success Response (200)
{
  "tier": "free",
  "tier_name": "Free",
  "monthly_limit": 50,
  "monthly_used": 12,
  "monthly_remaining": 38,
  "period": "2026-03"
}

API Pricing

Start free. Scale as you grow. All plans include the same AI quality.

Free
$0
forever
  • 5 images/month
  • Full resolution
  • PNG output
  • No credit card
Starter
$10/mo
$0.01/image
  • 1,000 images/month
  • Full resolution
  • PNG output
  • Email support
Business
$299/mo
$0.003/image
  • 100,000 images/month
  • Full resolution
  • PNG output
  • Priority support

vs. remove.bg API Pricing

PlanCleanBGremove.bgSavings
5 images/moFree$9 (40 credits)100%
1,000 images/mo$10/mo$99/mo90%
10,000 images/mo$49/mo$399/mo88%
100,000 images/mo$299/moCustom ($2K+)85%+

Embed Widget

Add background removal to your website with one line of code. Your users upload images, CleanBG processes them.

<iframe
  src="https://cleanbg.pages.dev?embed=true&key=cbg_your_api_key"
  width="100%" height="500"
  style="border:none;border-radius:12px"
></iframe>

The widget uses your API key and counts against your monthly quota. Style it with CSS to match your site.

Support

Questions? Email support@fliplistai.com or open an issue on GitHub.