API Documentation

Everything you need to integrate PoofBG background removal into your application.

Introduction

The PoofBG API lets you remove image backgrounds programmatically. Upload an image or provide a URL, and get back a link to the transparent PNG result in seconds.

Base URL

http
https://api.poofbg.com/v1

All API requests must be made over HTTPS. Responses are returned as JSON unless otherwise noted. Each background removal costs 1 credit.

Authentication

Authenticate by including your API key in the Authorization header of every request. API keys use the pk_live_ prefix.

You can create and manage API keys from the developer dashboard.

Example header

http
Authorization: Bearer pk_live_YOUR_API_KEY

Requests without a valid API key will receive a 401 Unauthorized response.

Remove Background

POST/v1/remove-background

The primary endpoint. Accepts an image file or URL, removes the background, and returns a JSON response with a result_url to download the transparent PNG. The request blocks for up to 30 seconds while processing. If the job takes longer, a 202 response is returned with the job ID for polling.

Option 1: File upload

Send the image as multipart/form-data with a file field. Accepted formats: JPEG, PNG, WebP. Maximum file size: 10 MB.

cURL
curl -X POST https://api.poofbg.com/v1/remove-background \
  -H "Authorization: Bearer pk_live_YOUR_API_KEY" \
  -F "[email protected]"

Option 2: Image URL

Send a JSON body with an image_url field. For URL-based processing, only JPEG and PNG images are supported. If the remote file is inaccessible or unsupported, the job can still be accepted and later finish with a failed status.

cURL
curl -X POST https://api.poofbg.com/v1/remove-background \
  -H "Authorization: Bearer pk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"image_url": "https://example.com/photo.jpg"}'

Response (200 - completed)

JSON
{
  "id": "job_abc123",
  "status": "completed",
  "error": null,
  "created_at": "2026-03-18T12:00:00Z",
  "completed_at": "2026-03-18T12:00:02Z",
  "credits_used": 1,
  "credits_remaining": 42,
  "result_url": "https://cdn.poofbg.com/results/..."
}

Download the result by fetching the result_url. The URL is a signed link valid for 1 hour.

Response (202 - still processing)

If processing exceeds 30 seconds, the API returns a 202 Accepted response. Poll GET /v1/jobs/:id to check for completion.

JSON
{
  "id": "job_abc123",
  "status": "processing",
  "error": null,
  "created_at": "2026-03-18T12:00:00Z",
  "completed_at": null,
  "credits_used": 1,
  "credits_remaining": 42,
  "result_url": null
}

Get Job

GET/v1/jobs/:id

Retrieve the current status and result of a background removal job. Use this to poll for completion after receiving a 202 response.

Example request

cURL
curl https://api.poofbg.com/v1/jobs/job_abc123 \
  -H "Authorization: Bearer pk_live_YOUR_API_KEY"

Response

JSON
{
  "id": "job_abc123",
  "status": "completed",
  "error": null,
  "created_at": "2026-03-18T12:00:00Z",
  "completed_at": "2026-03-18T12:00:02Z",
  "credits_used": 1,
  "credits_remaining": 42,
  "result_url": "https://cdn.poofbg.com/results/..."
}

The result_url is only present when status is "completed". Possible statuses: pending, processing, completed, failed.

List Jobs

GET/v1/jobs

List your recent background removal jobs, sorted by creation date (newest first).

Query parameters

ParameterTypeDescription
limitintegerNumber of jobs to return. Default: 20, max: 100.
offsetintegerNumber of jobs to skip for pagination. Default: 0.

Response

JSON
{
  "data": [
    {
      "id": "job_abc123",
      "status": "completed",
      "created_at": "2026-03-18T12:00:00Z",
      "completed_at": "2026-03-18T12:00:02Z"
    }
  ],
  "limit": 20,
  "offset": 0
}

Account

GET/v1/account

Returns information about your account, including your current plan, remaining credits, and rate limits.

Response

JSON
{
  "plan": "pro",
  "credits_remaining": 487,
  "credits_monthly_quota": 500,
  "rate_limit": {
    "requests_per_minute": 120
  }
}

Rate Limiting

API requests are rate-limited per account based on your plan. Limits are enforced using a sliding window of 60 seconds.

PlanRequests per minute
Free10
Pay-as-you-go30
Lite60
Pro120
Enterprise300

Response headers

Every response includes rate limit information in the headers:

HeaderDescription
X-RateLimit-LimitMaximum requests allowed per window
X-RateLimit-RemainingRemaining requests in current window
Retry-AfterSeconds until the rate limit resets (only on 429 responses)

Errors

The API uses standard HTTP status codes. Error responses include a JSON body with a machine-readable code and a human-readable message.

Error format

JSON
{
  "error": {
    "message": "Insufficient credits",
    "code": "INSUFFICIENT_CREDITS"
  }
}

Error codes

CodeHTTPDescription
UNAUTHORIZED401Missing or invalid API key
INSUFFICIENT_CREDITS402Not enough credits to process the image
FORBIDDEN403Resource does not belong to your account
NOT_FOUND404Job not found
RATE_LIMITED429Too many requests, slow down
INVALID_REQUEST400Bad input - missing file, malformed body, etc.
INVALID_IMAGE_TYPE400Unsupported image format
FILE_TOO_LARGE400Image exceeds the 10 MB limit

Plans & Pricing

Each API call to remove a background costs 1 credit. Credits and rate limits depend on your plan.

PlanCreditsRate limit
Free3 one-time10/min
Pay-as-you-goBuy as needed30/min
Lite100/month60/min
Pro500/month120/min
EnterpriseUnlimited300/min

See pricing for full details and current prices.