API v1 — Live

Background Removal API

Remove backgrounds from any image with one API call. Transparent PNG output. 2-4 second processing. Works with products, portraits, and everything in between.

$0.029 per image $0.20 remove.bg
remove_bg.py
import requests

response = requests.post(
    "https://pixelpanda.ai/api/v1/remove-background",
    headers={"Authorization": "Bearer pk_live_xxx"},
    files={"file": open("product.jpg", "rb")}
)

result = response.json()
# {"success": true, "image_url": "https://...", "credits_remaining": 199}

See it in action

Drop an image below. Same AI model, same output quality as the API.

Drop an image here JPG, PNG, or WebP — up to 10 MB
Result appears here
Removing background...

Three lines of code

Works with any language. Here are copy-paste examples to get started.

import requests

API_KEY = "pk_live_your_api_key"

# Upload an image and remove its background
response = requests.post(
    "https://pixelpanda.ai/api/v1/remove-background",
    headers={"Authorization": f"Bearer {API_KEY}"},
    files={"file": open("product.jpg", "rb")}
)

data = response.json()
print(data["image_url"])    # Transparent PNG URL
print(data["credits_remaining"])  # Credits left

# Download the result
img = requests.get(data["image_url"])
with open("product_nobg.png", "wb") as f:
    f.write(img.content)
// Browser — using fetch + FormData
const input = document.querySelector('input[type="file"]');
const form = new FormData();
form.append('file', input.files[0]);

const response = await fetch('https://pixelpanda.ai/api/v1/remove-background', {
    method: 'POST',
    headers: { 'Authorization': 'Bearer pk_live_your_api_key' },
    body: form
});

const data = await response.json();
console.log(data.image_url);  // Transparent PNG URL

// Display the result
document.querySelector('img').src = data.image_url;
const fs = require('fs');
const FormData = require('form-data');

const form = new FormData();
form.append('file', fs.createReadStream('product.jpg'));

const response = await fetch('https://pixelpanda.ai/api/v1/remove-background', {
    method: 'POST',
    headers: {
        'Authorization': 'Bearer pk_live_your_api_key',
        ...form.getHeaders()
    },
    body: form
});

const data = await response.json();
console.log(data.image_url);

// Download the result
const img = await fetch(data.image_url);
const buffer = Buffer.from(await img.arrayBuffer());
fs.writeFileSync('product_nobg.png', buffer);
<?php

$apiKey = 'pk_live_your_api_key';

$ch = curl_init();
curl_setopt_array($ch, [
    CURLOPT_URL            => 'https://pixelpanda.ai/api/v1/remove-background',
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ["Authorization: Bearer $apiKey"],
    CURLOPT_POSTFIELDS     => [
        'file' => new CURLFile('product.jpg')
    ],
]);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);
echo $data['image_url'];    // Transparent PNG URL
echo $data['credits_remaining'];

// Download the result
file_put_contents('product_nobg.png', file_get_contents($data['image_url']));
require 'net/http'
require 'json'
require 'uri'

uri = URI('https://pixelpanda.ai/api/v1/remove-background')
request = Net::HTTP::Post::Multipart.new(uri, {
    'file' => UploadIO.new(File.new('product.jpg'), 'image/jpeg')
})
request['Authorization'] = 'Bearer pk_live_your_api_key'

response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
    http.request(request)
end

data = JSON.parse(response.body)
puts data['image_url']      # Transparent PNG URL
puts data['credits_remaining']
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "io"
    "mime/multipart"
    "net/http"
    "os"
)

func main() {
    file, _ := os.Open("product.jpg")
    defer file.Close()

    body := &bytes.Buffer{}
    writer := multipart.NewWriter(body)
    part, _ := writer.CreateFormFile("file", "product.jpg")
    io.Copy(part, file)
    writer.Close()

    req, _ := http.NewRequest("POST",
        "https://pixelpanda.ai/api/v1/remove-background", body)
    req.Header.Set("Authorization", "Bearer pk_live_your_api_key")
    req.Header.Set("Content-Type", writer.FormDataContentType())

    resp, _ := http.DefaultClient.Do(req)
    defer resp.Body.Close()

    var data map[string]interface{}
    json.NewDecoder(resp.Body).Decode(&data)
    fmt.Println(data["image_url"])  // Transparent PNG URL
}
# Remove background from an image
curl -X POST https://pixelpanda.ai/api/v1/remove-background \
  -H "Authorization: Bearer pk_live_your_api_key" \
  -F "file=@product.jpg"

# Response:
# {
#   "success": true,
#   "image_url": "https://pub-xxx.r2.dev/results/abc123.png",
#   "credits_remaining": 199
# }

# Download the transparent PNG
curl -o product_nobg.png "https://pub-xxx.r2.dev/results/abc123.png"

8x cheaper than remove.bg

Same AI quality. Fraction of the price. No subscriptions required.

Remove.bg
$0.20 /image

Background removal only. Pay-per-image or subscription.

  • Background removal
  • No image upscaling
  • No text removal
  • No product photo generation
  • No AI product photos
  • 50 free previews/month (low res)
PhotoRoom
$0.15 /image

Background removal + basic editing. API starts at $49/mo.

  • Background removal
  • No image upscaling
  • No text removal
  • AI scene generation
  • $49/mo minimum for API
  • Limited free tier

Built for production

Everything you need to integrate background removal into your app.

2-4s

Fast processing

State-of-the-art BiRefNet model delivers results fast enough for real-time user flows.

1px

Hair & fine edge handling

Graduated alpha transparency on hair, fur, and wispy edges. No jagged cutouts.

10MB

Large file support

Upload images up to 10MB. Automatically optimized for processing. No pre-resizing needed.

pk_*

Simple auth

Bearer token authentication. Generate API keys from your dashboard. No OAuth complexity.

.png

All formats supported

Input JPEG, PNG, or WebP. Output is always a high-quality transparent PNG with alpha channel.

v1/

Full image suite

Same API key for upscaling, text removal, and AI product photos. One integration, all tools.

Common questions

Background removal costs 1 credit per image. At our starter pricing, that's $0.029 per image — 7x cheaper than remove.bg's $0.20 per image. Get started with 280 credits/week for $7.99 weekly (cancel anytime). Monthly plans start at $24/month for 1,125 credits.
PixelPanda uses the same class of AI models as remove.bg (BiRefNet/RMBG-2.0) and delivers comparable quality. The key difference is price: $0.029/image vs $0.20/image — 7x cheaper. We also include upscaling, text removal, and AI product photo generation in the same API, while remove.bg only does background removal.
Average processing time is 2-4 seconds per image. The API processes images asynchronously and returns the result URL immediately upon completion. For batch processing, you can submit up to 100 images per batch via our Batch API endpoint.
Try the $10 Impulse pack (50 credits, one-time, no subscription) for a quick API test — 50 background removals. For higher volume, the $7.99/week subscription gives 280 credits/week (cancel anytime), or monthly plans start at $24/month for 1,125 credits. Credits never expire.
Yes. You can call the API endpoint for each image in your catalog. With a simple loop in Python, JavaScript, or any language, you can process hundreds of images automatically. Credits are deducted per image (1 credit each).
The REST API works with any programming language that can make HTTP requests. We provide ready-to-use code examples for Python, JavaScript/Node.js, and cURL. Any HTTP client library can integrate with the API in minutes.
Yes. Our AI model is specifically trained to handle fine details like hair strands, fur, feathers, and semi-transparent edges. Rather than making hard edge decisions, the model generates graduated transparency at boundaries for natural-looking results.
Absolutely. The background removal API is perfect for creating Amazon, Shopify, and eBay compliant product images with white or transparent backgrounds. Many ecommerce businesses use our API to process their entire product catalogs automatically.
Use Bearer token authentication. Include your API key in the Authorization header: "Authorization: Bearer pk_live_xxx". Generate your API key from your PixelPanda dashboard under account settings.
The API accepts JPEG, PNG, and WebP images up to 10MB. Output is always a high-quality PNG with a transparent alpha channel. Images are automatically optimized for processing speed and quality.
Free to sign up · cancel anytime

Start removing backgrounds today

280 credits/week for $7.99. One API key. Production-ready in minutes.