Real-time API

Remove background API: one request in, finished PNG out.

Upload a file, send a public image URL, or supply base64. Most single images come back finished in the same HTTP response, typically in a few seconds. If one takes longer, you get a job id to fetch the result with, without sending the image again. A batch endpoint covers bulk.

1 credit per successful image · failed images are free · keys in your account

$ curl -X POST https://removebackground.dev/v1/remove \
    -H "x-api-key: $REMOVEBG_API_KEY" \
    -F 'image_file=@dog.jpg' -o dog.png

← 200 OK · image/png · typically a few seconds
  saved dog.png (transparent, full resolution)
1 Your image2 One HTTP request3 PNG in the response

Quick start

Copy, paste, replace YOUR_API_KEY. Each example saves the result straight to a file, and the JavaScript and Python ones also wait for a 202.

curl -X POST https://removebackground.dev/v1/remove \
  -H 'x-api-key: YOUR_API_KEY' \
  -F 'image_file=@photo.jpg' \
  -o photo-no-bg.png

Send your image

POST /v1/remove takes the image in any of four ways. Send one of them; if a request carries several, image_file wins, then image_file_b64, then image_url, then the raw body. These examples read your key from the REMOVEBG_API_KEY environment variable (set it with export REMOVEBG_API_KEY=…); note the double quotes, which let the shell fill it in.

curl -X POST https://removebackground.dev/v1/remove \
  -H "x-api-key: $REMOVEBG_API_KEY" \
  -F 'image_file=@photo.jpg' \
  -o photo-no-bg.png

Multipart form data, field image_file. JPG, PNG or WebP, up to 25 MB.

Every example saves the body to a file. That file is only an image when the status is 200; see Handle the response.

Handle the response

Most single images come back finished in the same response. When the queue is unusually busy and an image takes longer than about 55 seconds, you get 202 Accepted with a job id instead. The job keeps running: fetch its result with the id. Sending the image again would start a second job and could cost a second credit.

StatusBodyWhat to do
200The image (image/png, image/jpeg or image/webp)Save it. Use the Content-Type to pick the file extension.
202JSON: { id, status, status_url, result_url }Not an image. Wait a couple of seconds, then GET result_url. Don't send the image again.
4xx / 5xxJSON: { "error": { "code", "message" } }Not an image. Read the code (see Errors) and don't save the body as a picture.

A complete example

Handles the finished image, a 202, a job that fails, and a local time limit. It sends the image once and only retries the safe status checks.

import os
import time
import uuid

import requests

API = "https://removebackground.dev"
KEY = os.environ["REMOVEBG_API_KEY"]  # keep the key on your server
EXT = {"image/png": ".png", "image/jpeg": ".jpg", "image/webp": ".webp"}


def save(res, stem):
    """Save an image response with the right extension; raise on anything else."""
    mime = res.headers.get("Content-Type", "").split(";")[0]
    if res.status_code != 200 or mime not in EXT:
        raise RuntimeError(f"HTTP {res.status_code}: {res.text[:500]}")
    path = stem + EXT[mime]
    with open(path, "wb") as f:
        f.write(res.content)
    return path


def remove_background(image_url, stem="result", max_wait=300):
    s = requests.Session()
    s.headers["x-api-key"] = KEY

    # One key per image: resending with the same key returns the same job, never a second
    # charge, so this POST is safe to retry after a timeout or a dropped connection.
    idem = {"Idempotency-Key": str(uuid.uuid4())}
    for attempt in range(3):
        try:
            res = s.post(f"{API}/v1/remove", data={"image_url": image_url}, headers=idem, timeout=(10, 120))
            break
        except requests.ConnectionError:
            if attempt == 2:
                raise
            time.sleep(2)
    if res.status_code != 202:
        return save(res, stem)  # 200 = the image; anything else raises

    # 202: still processing. Wait for the same job; never send the image again.
    job_id = res.json()["id"]
    deadline = time.monotonic() + max_wait
    while time.monotonic() < deadline:
        time.sleep(2)  # the API sends Retry-After: 2
        res = s.get(f"{API}/v1/jobs/{job_id}/result", timeout=30)
        if res.status_code == 409 and res.json()["error"]["code"] == "not_ready":
            continue
        return save(res, stem)  # the image, or the job's own error
    raise TimeoutError(f"Job {job_id} is still running. Check it later at /v1/jobs/{job_id}.")


print(remove_background("https://example.com/photo.jpg"))

Needs Python 3 and requests (pip install requests).

  • Stopping your script doesn't stop the job; it may still finish and be charged. Its result shows up in your Studio.
  • The time limits are your choice, not a promise from us; most images finish in a few seconds.
  • The remove.bg-compatible endpoint behaves differently: it never answers 202 (see below).

Authentication

Send your API key in the x-api-key header. Create and revoke keys on your account page; every call spends that account's credits. All endpoints live under https://removebackground.dev and accept CORS requests, but CORS doesn't make a key safe to put in a web page: keep it on your server (see Security). Errors are JSON: { "error": { "code": "…", "message": "…" } }.

The full contract is published as OpenAPI 3.1 (openapi.json), for client generators, Postman or tests; AI coding assistants can start from llms.txt.

POST /v1/remove

Real-time. Remove the background from one image. Usually the finished image is the response body (image/png, image/jpeg or image/webp), typically after a few seconds. Parameters can be form fields, JSON keys or query-string values; you can also POST the raw image bytes with Content-Type: image/jpeg, image/png, image/webp or application/octet-stream. Maximum 25 MB. See Send your image for each input method.

ParameterTypeDescription
image_filefileThe image (JPG, PNG or WebP), as multipart form data.
image_file_b64stringThe image as base64, with or without a data:image/…;base64, prefix (25 MB after decoding). Handy from JSON.
image_urlstringA public http(s) URL of the image. We download it (up to 3 redirects, 15 s). If several are sent, image_file wins, then image_file_b64, then image_url, then the raw body.
formatpng | jpg | webpOutput format. Default png. JPG has no transparency: it is flattened onto bg_color, or white.
bg_colorcolourFill the background: hex (ffffff, #fff), rgb(255, 255, 255), or white, black, red, green, blue, yellow, gray / grey. transparent (default) keeps it transparent.
sizepreview | medium | hd | fullMegapixel cap, aspect ratio kept, never upscaled: preview ≤ 0.25 MP, medium ≤ 1.5 MP, hd ≤ 4 MP, full (default) the original resolution (up to 25 MP). Ignored when width or height is set.
croptrue | false | W:HTrim to the subject's bounding box. With an aspect ratio (1:1, 4:5, 4:3, 16:9…), the box is then expanded (never shrunk) to that ratio around the subject; area outside the photo is transparent (or bg_color). Default false.
paddingpx | fraction | %With crop: margin added to each side. 0.1 or 10% = a tenth of the subject's width (left/right) and height (top/bottom); "10%,7.5%" sets horizontal and vertical separately; 24px (or a bare whole number above 1) is pixels, up to 500. Default 0.
channelsrgba | rgb | alphargba (default): transparent cut-out. rgb: opaque, flattened onto bg_color or white. alpha: grayscale PNG mask (white = subject), same size and crop as the cut-out. type=mask still works as an alias of alpha.
width / height1–6000Exact output size in pixels, applied after crop (overrides size). With only one, the other follows the aspect ratio. Never stretched.
roix1 y1 x2 y2Region of interest, in px or % (e.g. 0% 0% 50% 100%). Only the subject inside it is kept; everything outside becomes background. Coordinates refer to the original image. Default: the whole image.
fitcontain | cover | scale-downWith width and height. contain (default): fit inside, centred, the rest transparent (or bg_color). cover: fill the box, cropping overflow around the subject. scale-down: like contain, but never enlarged.

Options apply in this order: roi, size (or width/height later), crop + padding + aspect ratio, width/height + fit, then channels or background colour, then the format. Every option costs the same 1 credit. Unknown parameters are ignored.

Example: HD JPG on white, cropped to the subject with 40 px padding

curl -X POST https://removebackground.dev/v1/remove \
  -H 'x-api-key: YOUR_API_KEY' \
  -F 'image_file=@product.jpg' \
  -F 'bg_color=ffffff' \
  -F 'format=jpg' \
  -F 'size=hd' \
  -F 'crop=true' \
  -F 'padding=40' \
  -o product-no-bg.jpg

Example: square marketplace image, subject centred with 10% padding

curl -X POST https://removebackground.dev/v1/remove \
  -H 'x-api-key: YOUR_API_KEY' \
  -F 'image_file=@product.jpg' \
  -F 'crop=1:1' -F 'padding=10%' \
  -F 'width=1000' -F 'height=1000' \
  -F 'format=jpg' -F 'bg_color=white' \
  -o product-square.jpg

Example: base64 in, alpha mask out

printf '{"image_file_b64":"%s","channels":"alpha"}' "$(base64 < portrait.jpg | tr -d '\n')" > request.json

curl -X POST https://removebackground.dev/v1/remove \
  -H 'x-api-key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  --data-binary @request.json \
  -o portrait-mask.png

200 OK

The image bytes, with these headers:

HeaderMeaning
X-Image-Width / X-Image-HeightSize of the result in pixels (also sent as X-Width / X-Height).
X-Request-IDYour X-Request-ID if you sent one, otherwise a generated id. Quote it when contacting support.
X-Processing-Time-MsTime spent on the request (also X-Processing-Ms).
X-Matte-Confidence0–1: how decisive the mask is (mean of |2a − 1| over pixels, a = alpha). Near 1 is a clean cut-out; lower values mean lots of soft or uncertain edges.
X-Matte-Ambiguous-RatioFraction of pixels with alpha strictly between 0.1 and 0.9 (hair, glass, motion blur). Useful to flag images for review.
X-Credits-RemainingYour balance after this image.
X-Removal-IdId of the stored result.
X-Job-IdId of the job behind the request (usable with /v1/jobs/:id).

202 Accepted (fallback for long queues)

If the image isn't finished within about 55 seconds, for example when the queue is unusually busy, you get 202 with JSON { id, status, status_url, result_url } (plus Location and Retry-After: 2). Poll status_url until done is true, then download result_url. You're charged once, only when the image succeeds. Don't send the image again without an Idempotency-Key: that starts a second job. See Handle the response for a complete example.

GET /v1/jobs/:id

Status of a job created by /v1/remove or /v1/batch. Same key; you only see your own jobs.

FieldMeaning
statusqueued, processing, succeeded, partial, failed or canceled
donetrue once nothing is left to run
total, succeeded, failed, skippedimage counts
credits_chargedcredits this job used (1 per successful image)
status_url, result_urlwhere to poll, and where to download
items[]per image: position, input, status, error { code, message }, and on success removal_id, width, height, format, result_url

GET /v1/jobs/:id/result

The image bytes of a finished job, with the same headers as /v1/remove. ?item=N picks an image of a batch job (default 0). Answers 409 not_ready with Retry-After: 2 while it's still running, or the image's own error if it failed.

POST /v1/batch

Queue up to 100 image URLs as one job: JSON { "image_urls": ["https://…", …], "format": "jpg", "bg_color": "ffffff", "size": "hd", "crop": "1:1", "padding": "10%" }, with the same options as /v1/remove (channels, width, height and fit too). Answers 202 at once with { id, status, total, invalid, duplicates, status_url }. Poll the job, then fetch each item's result_url. 1 credit per image that succeeds; at most 3 batch jobs open per account. Walkthrough with example responses in Batches, start to finish.

remove.bg-compatible endpoint

remove.bg's self-serve API ends 1 December 2026, 09:00 CET (announcement). Existing remove.bg integrations work here by changing one line: https://api.remove.bg/v1.0/removebg → https://removebackground.dev/v1.0/removebg, with a removebackground.dev key in the same X-Api-Key header. Same queue, same 1 credit per successful image, same output quality as /v1/remove. Migration guide.

POST /v1.0/removebg

Multipart, urlencoded or JSON body with remove.bg's parameter names. Answers with the image bytes and remove.bg's headers, or { "data": { "result_b64", "foreground_top", "foreground_left", "foreground_width", "foreground_height" } } when you send Accept: application/json. Errors use remove.bg's shape: { "errors": [{ "title", "code", "detail" }] }. Unlike /v1/remove it never answers 202: it waits up to 110 seconds, then returns a 503 timeout. The job keeps running and is charged if it succeeds, so retrying that request starts a second job.

ParameterStatusNotes
image_file / image_file_b64 / image_urlSupportedMultipart, urlencoded or JSON bodies. JPG, PNG or WebP up to 25 MB.
sizeSupportedauto, full, 4k and 50MP give the original resolution (up to 25 MP); preview, small and regular ≈ 0.25 MP; medium 1.5 MP; hd 4 MP. Always 1 credit.
formatSupportedauto (PNG if transparent, else JPG), png, jpg, webp and zip (color.jpg + alpha.png).
crop / crop_marginSupportedpx or % of the subject, 1–4 CSS-style values ("10% 20%" = vertical, horizontal); at most 500px or 50% per side.
roiSupported"x1 y1 x2 y2" in px or %: only the subject inside the region is kept.
scale / positionSupportedscale 10%–100% or original; position center, original or "x% y%".
channelsSupportedrgba (cut-out) or alpha (grayscale mask).
bg_colorSupportedHex with or without # (81d4fa), or a colour name. An 8-digit hex keeps the colour and drops its alpha.
bg_image_url / bg_image_fileSupportedThe cut-out is composited over your background image, cover-fit to the output size.
Accept: application/jsonSupportedReturns { data: { result_b64, foreground_top, foreground_left, foreground_width, foreground_height } }.
type / type_levelAccepted, ignoredThe subject is detected automatically; X-Type is always "other".
semitransparencyAccepted, ignoredSoft edges and semi-transparent areas come from the model's matte as they are.
shadow_type / shadow_opacity / add_shadowAccepted, ignoredNo shadows are added.
Long-running requestsDifferenceWe wait up to 110 seconds; if an image isn't ready by then you get a retryable 503 (not charged unless it finished).

Example

curl -H "X-Api-Key: $REMOVEBG_API_KEY" \
  -F 'image_file=@photo.jpg' -F 'size=auto' \
  -F 'crop=true' -F 'crop_margin=10%' -F 'bg_color=ffffff' \
  -o no-bg.jpg https://removebackground.dev/v1.0/removebg

Response headers

HeaderMeaning
X-Width / X-HeightSize of the result in pixels.
X-Credits-ChargedCredits this image used: always 1 (failed images cost 0).
X-TypeAlways "other" (subject detection is automatic).
X-Foreground-Top / -Left / -Width / -HeightBounding box of the subject in the result, in pixels.
X-Request-IDEchoes your X-Request-ID, or a generated id. Extra.
X-Matte-Confidence / X-Matte-Ambiguous-RatioHow clean the mask is (0–1), and the share of soft pixels. Extra: useful to flag images for review.

Errors

StatusMeaning
400Invalid parameter or image (codes such as invalid_size, invalid_crop_margin, missing_source, file_too_large, unknown_foreground).
402insufficient_credits: top up on the pricing page.
403auth_failed: missing or invalid X-Api-Key.
429rate_limit_exceeded.
500 / 503Processing failed, timed out or the service is briefly unavailable. Retry; failed images are free.

GET /v1.0/account

Your balance in remove.bg's account shape: { "data": { "attributes": { "credits": { "total", "subscription": 0, "payg", "enterprise": 0 }, "api": { "free_calls": 0, "sizes": "all" } } } }. All credits are pay-as-you-go and never expire, so total equals payg. GET https://removebackground.dev/v1.0/account with your X-Api-Key.

Errors (/v1 endpoints)

Failed images are never charged.

StatusCodesMeaning
400missing_image, invalid_url, invalid_body, invalid_json, invalid_image_b64, invalid_format, invalid_bg_color, invalid_size, invalid_crop, invalid_padding, invalid_type, invalid_channels, invalid_width, invalid_height, invalid_fit, invalid_roi, fetch_failed, fetch_timeout, rejected, too_many_images, invalid_imagesThe request or the image URL can't be used.
401unauthorizedMissing, wrong or revoked x-api-key.
402insufficient_credits, out_of_creditsYour balance is empty. Top up on the pricing page.
404not_foundNo such job (or it isn't yours).
409not_ready, canceled, idempotency_key_reusedGET …/result while the job is still running (retry after 2 s), the job was canceled, or an Idempotency-Key was reused for a different request.
410result_unavailableThe result was deleted or expired.
413too_largeThe image is larger than 25 MB.
422processing_failed, invalid_image, missing_uploadThe file isn't a readable image. Not charged.
429rate_limited, too_many_batchesOver the per-account request limit (wait for Retry-After), or you already have 3 batch jobs running.
502model_unavailable, upstream_error, …We couldn't process the image after retries. Not charged.
503server_paused, unavailableThe API is paused (before launch) or briefly unavailable. Retry later.

Batches, start to finish

1. Submit

curl -X POST https://removebackground.dev/v1/batch \
  -H "x-api-key: $REMOVEBG_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{ "image_urls": ["https://example.com/front.jpg", "https://example.com/back.jpg"], "format": "png", "size": "hd" }'

Up to 100 public image URLs plus any of the /v1/remove options. The two placeholder URLs above would cost up to 2 credits if they were real images. The answer comes at once:

202 Accepted
{
  "id": "3f6c2a9e-8d1b-4c7a-9e2f-5b8d0a1c4e77",
  "status": "queued",
  "total": 2,
  "invalid": 0,
  "duplicates": 0,
  "status_url": "https://removebackground.dev/v1/jobs/3f6c2a9e-8d1b-4c7a-9e2f-5b8d0a1c4e77"
}

invalid counts entries that aren't http(s) URLs and duplicates counts repeats; both are dropped and never charged. Save the id: it's how you pick the job up again after a restart.

2. Poll the job

GET /v1/jobs/:id every few seconds until done is true. status moves from queued to processing, then ends as succeeded, partial (some images failed) or failed. An item that is being retried shows retrying.

{
  "id": "3f6c2a9e-…",
  "status": "partial",
  "done": true,
  "total": 2, "succeeded": 1, "failed": 1, "skipped": 0,
  "credits_charged": 1,
  "items": [
    { "position": 0, "input": "https://example.com/front.jpg", "status": "succeeded",
      "removal_id": "…", "width": 1600, "height": 1200, "format": "png",
      "result_url": "https://removebackground.dev/v1/jobs/3f6c2a9e-…/result?item=0" },
    { "position": 1, "input": "https://example.com/back.jpg", "status": "failed",
      "error": { "code": "fetch_failed", "message": "…" } }
  ]
}

3. Download each result

GET /v1/jobs/:id/result?item=N for each succeeded item (or use its result_url). item is the zero-based position. Positions follow your list after invalid and repeated URLs are removed, so when either count is above 0, match results by input rather than by index.

  • A batch stops counting toward the limit of 3 open batches once done is true.
  • The API has no cancel endpoint, webhooks or ZIP download. Batches started on the Bulk page can be canceled or downloaded as a ZIP there.

Retries, duplicates and billing

Send an Idempotency-Key and retries can't charge twice. Add an Idempotency-Key header (any unique string up to 255 characters, such as a UUID) to POST /v1/remove or POST /v1/batch, one key per image or batch. If you send the same request again with the same key, you get the job the first one created, with Idempotent-Replayed: true: no new job and no new charge, even if the first request is still running. The same key with a different image or options answers 409 idempotency_key_reused. Keys belong to your account and don't expire.

Without a key, every POST creates a new job, and each job that succeeds costs 1 credit (the remove.bg-compatible POST /v1.0/removebg has no keys). Reading a job (GET /v1/jobs/…) is always free and safe to repeat.

IDEMPOTENCY_KEY=$(uuidgen)   # one per image; send the same one on every retry

curl -X POST https://removebackground.dev/v1/remove \
  -H "x-api-key: $REMOVEBG_API_KEY" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -F 'image_file=@photo.jpg' \
  -o photo-no-bg.png

What costs a credit

SituationCharge
Request rejected before processing (bad key, bad option, too large, out of credits)Free.
The image can't be processed (422 invalid image, 502 after our retries)Free.
The image succeeds1 credit, charged once, when it succeeds. Our own internal retries don't add charges.
You get a 202Nothing yet. The job keeps running and is charged 1 credit only if it succeeds.
Your client times out or disconnects while waitingThe job keeps running and is charged if it succeeds. The result appears in your Studio.
You send the same request twice with the same Idempotency-KeyOne job, at most 1 credit. The repeat gets the same job (header Idempotent-Replayed: true).
You send the same image twice without a keyTwo separate jobs; each one that succeeds costs 1 credit.
You download a finished result againFree, as often as you like while it is stored.
A batch partly succeeds1 credit per image that succeeded; credits_charged on the job shows the total.
A batch lists the same URL twiceRepeats inside one batch are dropped before queueing and never charged. Identical URLs in different batches are separate jobs.
Credits run out during a batchImages already finished stay paid; the rest are marked skipped (out_of_credits) and are free. Buy credits, then send the remaining URLs as a new batch.

When to retry

What happenedWhat to do
GET /v1/jobs/:id or …/result fails (network error, 5xx)Safe to retry: reading a job never creates work or charges. Back off a little between tries.
GET …/result answers 409 not_readyWait for Retry-After (2 s) and ask again. Don't resubmit the image.
GET …/result answers 410 result_unavailableThe stored result was deleted. Processing the image again is a new job and costs 1 credit.
POST answers 400, 413 or 422Fix the request or the image first; sending it unchanged gives the same answer.
POST answers 401 or 402Fix the key or top up. Don't loop.
POST answers 429 rate_limitedWait the seconds in Retry-After, then send it again (with the same Idempotency-Key). Over 60 images a minute? Use POST /v1/batch: one request for up to 100.
POST /v1/batch answers 429 too_many_batchesWait until one of your 3 open batches is done (poll it), then submit.
POST /v1/… answers 503 (unavailable, server_paused)No job was created. Retry after a short wait. (The remove.bg-compatible endpoint is different: its 503 timeout means the job is still running.)
POST /v1/remove answers 502That job failed and wasn't charged. One retry is a new job.
POST times out, the connection drops, or you get 500With an Idempotency-Key: resend the same request with the same key; you get the original job. Without one, the job may already exist and may be charged: check your Studio first.
POST answers 409 idempotency_key_reusedThat key was already used for a different image or options. Make a new key for each new image.

Limits and storage

LimitValueError when exceeded
Image file25 MB (25 × 1024 × 1024 bytes); JPG, PNG or WebP, detected from the file's bytes413 too_large · 422 processing_failed
Base64 / JSON body25 MB after decoding (the request body may be about a third larger)413 too_large
Input resolutionImages over 25 MP are scaled down to 25 MP before processing—
Output sizewidth and height each 1–6000 px400 invalid_width / invalid_height
image_url downloadhttp(s) only, 15 s timeout, up to 3 redirects; private, loopback and link-local addresses are refused, at every redirect400 invalid_url · fetch_failed · fetch_timeout
Waiting in POST /v1/removeAbout 55 s, then 202 with the job id202
Batch size100 image URLs per POST /v1/batch400 too_many_images
Open batches3 unfinished multi-image jobs per account (single images don't count)429 too_many_batches
Request rate60 requests a minute per account, across POST /v1/remove, /v1/batch and /v1.0/removebg. A batch counts once, whatever its size. Reading jobs isn't limited429 rate_limited (with Retry-After)

How long results are kept

Every result is stored privately in your account for 48 hours after it is made, then deleted. Until then you can download it again for free with GET /v1/jobs/:id/result or from your Studio. After that, result links answer 410 result_unavailable; processing the image again is a new job. Job status records stay readable after the image is gone. See the privacy policy for how uploads are handled; we don't use your images to train models.

Security

Keep your API key on a server you control. Don't put it in browser code, mobile apps, public repositories or URLs. To let your own users remove backgrounds, send their images through your backend, and add your own sign-in and spending limits there.

  • The API allows CORS so it works from tools and server-side code. That does not make it safe to put a key in a web page: anyone can read it there.
  • All keys on an account spend the same credit balance. Create a separate key per app or environment on your account page, so you can revoke one without breaking the others.
  • If a key leaks, revoke it on the account page right away (it stops working immediately) and create a new one. We store only a hash of each key, so we can't show it to you again.

Troubleshooting

SymptomWhat's going on
My PNG won't openThe body was JSON (a 202 job or an error), not an image. Check the HTTP status and Content-Type before saving.
My script timed out but the image shows up in StudioThe job kept running after you stopped waiting. Fetch it with its job id instead of resending.
I was charged twice for one imageIt was sent twice without an Idempotency-Key (often an automatic retry after a timeout). Send one key per image and reuse it on retries.
The URL opens in my browser but the API can't fetch itThe host may need cookies or a login, block servers, redirect more than 3 times, take over 15 s, or the signed URL expired. Upload the file instead.
My batch stopped halfwayLook at items[] in the job: failed items have an error code; skipped items with out_of_credits mean the balance ran out.
An option seems to do nothingUnknown parameter names are ignored silently. Check the spelling against the parameter table. On /v1.0/removebg, some remove.bg options are accepted but ignored (see that table).
The background isn't transparentJPG can't be transparent. Use format=png or webp and leave bg_color unset.
The result link gives 410The stored result was deleted. Processing again costs 1 credit.

Questions

Is there an API?

Yes. The Real-time API takes one HTTP request and returns the finished PNG in the same response. It costs 1 credit per successful image; failed images are free and credits never expire.

What does a credit buy?

Through the API or Bulk, 1 credit is one successful background removal at full resolution. In the editor, a Preview costs 1 credit and HD costs 2 credits in total (1 more after its Preview).

Am I charged when an image fails?

No. A credit is only used when the background is removed successfully. Unreadable files, failed downloads and errors are free.

Can I remove backgrounds from many images at once?

Yes. Bulk processes up to 100 images or image URLs in one go and gives you a ZIP. It uses the same credits as the API.

Is there a subscription?

No subscriptions. Only top-ups as you need. You buy a credit pack once, nothing renews, and your credits never expire. When you run low, top up again.