All guides

API

remove.bg API Alternative

The remove.bg self-service API stops on December 1, 2026. Your two options, the one-request change to PhotoFig, a field-by-field map, limits, and cost per image.

12 min read Karolis Tamutis

A curl request to the PhotoFig API beside the cutout it returns: a dried flower wreath kit lifted from a wooden table onto a transparent background

If your code calls api.remove.bg, it has a deadline. On December 1, 2026, the remove.bg website closes at 9:00 CET, and the self-service API stops accepting requests the same day.

The worst time to deal with that is the last week of November, in the middle of Black Friday traffic. So this is the practical version: what your options are, the smallest change that moves a cutout call to PhotoFig, how each remove.bg field maps, what it costs, and where PhotoFig is the wrong choice.

Quick answer: Leonardo.Ai is the official successor and keeps most remove.bg parameters, but it is JSON in and JSON out, at about $0.10 per image. PhotoFig accepts the same X-Api-Key header and image_file field and returns the PNG in the same request, from $15 a month for 2,000 cutouts. It does not read remove.bg’s options such as size or bg_color, and it is a different model, so test it on your own photos first.

What happens to the remove.bg API on December 1?

From remove.bg’s FAQ, checked November 5, and its API page, checked November 12:

  • The self-service API stops accepting requests on December 1, 2026.
  • Enterprise API contracts continue as normal. If you have one, nothing changes yet, but ask your account contact what comes next.
  • API access moves to Leonardo.Ai, which is also part of Canva.
  • Accounts close with the website. Export your invoices and credit usage report before then. Unused pay-as-you-go credits expire.

There is no redirect. Requests to the old endpoint will simply fail, so every caller that still uses it needs to be found and switched before that morning. The PhotoFig vs remove.bg comparison covers the rest of the closure, including subscriptions and refunds.

What are your options?

There are two realistic paths.

Leonardo.AiPhotoFig API
RequestJSON only: image as URL or base64Multipart or JSON, same field names as remove.bg
ResponseJSON with a link or base64The PNG itself, or a job
remove.bg options (size, crop, bg_color…)Most kept, under parametersNot read; use the resize tool or a template
Price$0.1047 per imageFrom $15 a month for 2,000 cutouts
Beyond the cutoutUpscale, scene generation, videoMarketplace sizes, AI backgrounds, shadows, templates, batches
AccountNew Leonardo account and keyNew PhotoFig account and key

Leonardo.Ai is where remove.bg sends you, and for callers that lean on remove.bg’s options it is the closest match. Its migration guide maps size, type, crop, bg_color, the shadow options and more to the same names under parameters. What changes is the envelope: a Bearer token, a JSON body with the image as a URL or base64 (multipart uploads are not supported), a JSON response instead of raw image bytes, and errors that can come back as HTTP 200 with an errors array. One detail to catch: Leonardo stores inputs and outputs in your library by default. Set ephemeral: true if you process customer images and want the remove.bg behaviour of keeping nothing.

The PhotoFig API is built for product photos. A plain cutout call moves over almost unchanged, as the next section shows. And if your remove.bg call is only the first step, with your own code then padding the product onto a square canvas, adding a background, faking a shadow, and exporting three marketplace sizes, PhotoFig can do all of that in one template.

What is the smallest change that works?

For a call that sends a photo and saves the cutout, three lines change: the URL, and two new headers.

# remove.bg
curl https://api.remove.bg/v1.0/removebg \
  -H "X-Api-Key: $REMOVE_BG_KEY" \
  -F "image_file=@product.jpg" \
  -o product.png

# PhotoFig
curl https://api.photofig.com/v1/tools/mask/edit \
  -H "X-Api-Key: $PHOTOFIG_KEY" \
  -H "Prefer: wait=60" \
  -H "Accept: image/png" \
  -F "image_file=@product.jpg" \
  -o product.png

Prefer: wait=60 asks PhotoFig to hold the response until the cutout is ready, for up to 60 seconds. Accept: image/png asks for the image itself instead of JSON. Together they give you what remove.bg gave you: one request, PNG bytes back. The response also carries X-Width, X-Height, and an X-Job-Id you can log.

image_url works the same way, as a form field or in a JSON body.

Three things behave differently, and your code should know about them:

  • A slow job answers 202. If the cutout is not ready when the wait ends, you get JSON with the job and a statusUrl instead of the image. The job keeps running. Check the status code before writing the body to a .png file.
  • A failed job answers 422 with code: "job_failed" and the reason. A photo with no clear subject is the usual cause.
  • Errors are { "code", "message" }, not an errors array. The code values are stable, so match on those.

Add an X-Idempotency-Key header if your worker retries. A repeat with the same key waits for the first job instead of starting, and charging, a second one.

How does each remove.bg field map to PhotoFig?

The PhotoFig mask tool takes no parameters. It finds the product, cuts it out, and returns a transparent PNG. remove.bg’s options are not read, so a call that sends them still works, but they have no effect.

remove.bgPhotoFigNotes
POST /v1.0/removebgPOST /v1/tools/mask/editAdd Prefer: wait=60 for the result in the same response
X-Api-Key headerX-Api-Key, or Authorization: BearerKeys are created in the app, on every plan
image_fileimage_fileJPEG, PNG, WebP, or HEIC, up to 10 MB
image_urlimage_urlMust be a public HTTP(S) URL
image_file_b64noneSend multipart, or create an upload session and PUT the bytes
sizenoneUp to 4096 px on the long side
formatnonePNG with transparency
type, type_levelnoneProduct detection is automatic; no X-Type header
channels=alphanoneThe PNG carries the alpha channel
crop, crop_margin, scale, positionresize tool, or a templateExact canvas size, fit or fill, alignment, padding
bg_colorresize with background, or a template#RRGGBB, transparent, or a gradient
bg_image_url, bg_image_fileai-bg toolGenerates a scene around the product instead of pasting a photo
shadow_type, shadow_opacityai-shadows tool, or a templateOne AI credit per photo
roi, semitransparencynone
GET /v1.0/accountGET /v1/accountPlan limits, API cutouts used and left, AI credits
X-Credits-ChargednoneOne API cutout per completed job; failed and cancelled jobs cost nothing
429 with Retry-After429 with Retry-AfterPlus the X-RateLimit-* headers
{ "errors": [...] }{ "code", "message" }

When should you use jobs and webhooks instead?

Holding a connection open is the simplest thing to port, but it is not always the best fit. Leave out the Prefer header and the same endpoint answers at once with a job:

{
  "id": "3f0c6a8e-5b7d-4c1e-9d2a-7e4b1c9f0a12",
  "tool": "mask",
  "status": "queued",
  "statusUrl": "https://api.photofig.com/v1/jobs/3f0c6a8e-5b7d-4c1e-9d2a-7e4b1c9f0a12",
  "resultUrl": null
}

Then either poll statusUrl, which does not use your allowance for new requests, or register a webhook once and let PhotoFig call you:

curl https://api.photofig.com/v1/webhooks \
  -H "X-Api-Key: $PHOTOFIG_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/hooks/photofig",
       "events": ["job.completed", "job.failed"]}'

The response includes a signing secret. It is shown only once. Every delivery carries PhotoFig-Webhook-Timestamp and PhotoFig-Webhook-Signature: an HMAC-SHA256, made with that secret, of the timestamp, a dot, and the raw request body. In Node with Express:

import crypto from "node:crypto";
import express from "express";

const app = express();
const secret = process.env.PHOTOFIG_WEBHOOK_SECRET;

app.post("/hooks/photofig", express.raw({ type: "application/json" }), async (req, res) => {
  const timestamp = req.get("PhotoFig-Webhook-Timestamp") ?? "";
  const received = (req.get("PhotoFig-Webhook-Signature") ?? "").replace(/^v1=/, "");
  const expected = crypto
    .createHmac("sha256", secret)
    .update(`${timestamp}.`)
    .update(req.body) // the raw bytes, not re-serialized JSON
    .digest("hex");

  const fresh = Math.abs(Date.now() / 1000 - Number(timestamp)) < 300;
  const valid = received.length === expected.length &&
    crypto.timingSafeEqual(Buffer.from(received), Buffer.from(expected));
  if (!fresh || !valid) return res.sendStatus(401);

  res.sendStatus(204); // answer within 10 seconds, then do the work

  const event = JSON.parse(req.body);
  if (event.event === "job.completed") {
    const png = await fetch(event.data.resultUrl).then((r) => r.arrayBuffer());
    // save png wherever your remove.bg results used to go
  }
});

Use this path when nobody is waiting on the request: nightly imports, supplier feeds, anything behind a queue. A few things that will save you a debugging session:

  • Answer fast. Anything other than a 2xx within 10 seconds is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, and 12 hours.
  • Ignore repeats. PhotoFig-Webhook-Id stays the same across retries, so store it and skip events you have already handled.
  • Download within a day. resultUrl is a signed link, and results are kept for 24 hours after the job finishes. Copy the PNG to your own storage.
  • Test it. POST /v1/webhooks/{id}/test sends a webhook.test event to your endpoint.

What if remove.bg was only the first step?

Many remove.bg integrations do more work after the cutout: center the product on a square, add padding, set a white background, export 2000 px for Amazon and 1200 px for the store. That is usually where the real code lives.

In PhotoFig, that whole chain is a template: background removal, placement and scale, padding, a solid or gradient background, an optional shadow, export sizes, and the output format. You can build the template in the app and use it from the API, or create it with POST /v1/templates. Templates made either way open and edit in both places.

Then send the photos as a batch: create the batch, upload the photos, process it with the template, and wait for one batch.completed webhook. Each photo uses one API cutout, whatever the template does, and downloading the results, one by one or as a ZIP, costs nothing more.

If you want to understand why matching product scale matters more than a fixed margin, I wrote about it in how to make product photos consistent across a catalog. The sizes each marketplace expects are in the product photo sizes cheat sheet.

What limits should you plan around?

Be honest with your own numbers here, because this is where PhotoFig stops fitting.

  • It is a different model. PhotoFig’s cutout model is trained on product photos. On your photos its edges will differ from remove.bg’s, sometimes better and sometimes worse. Compare them while you still can.
  • New requests per minute. Requests that start or change work count toward a per-minute allowance: 5 on Free, 10 on Starter, 20 on Pro, 30 on Studio, and 30, 60, or 120 with an API block. Reading job status does not count. remove.bg was rated for up to 500 one-megapixel images a minute.
  • Jobs in flight. The same numbers cap how many API jobs can be queued or running at once. Past that, new edits get 429 too_many_jobs with Retry-After, so keep a queue on your side.
  • The 60-second wait. A cutout normally takes a few seconds. If you send a burst, the later ones can outlast the wait and answer 202.
  • Input. Up to 10 MB per file.
  • Output. A PNG up to 4096 px on the long side, which is double the 2000 px square most marketplaces work well with. remove.bg could return up to 50 megapixels as JPG or WebP; its PNG was capped at 10 megapixels.
  • No per-call options. If you rely on size=preview, type=car, or roi, there is no equivalent.

If you really send thousands of images a minute, or need 50-megapixel output, PhotoFig is the wrong tool. Go to Leonardo.Ai, or talk to remove.bg about an enterprise contract.

How do the costs compare?

Every PhotoFig plan includes a monthly allowance of API cutouts: 25 on Free, 100 on Starter ($9.95), 500 on Pro ($29.95), and 2,000 on Studio ($79). An API block adds more to any plan, the Free plan included, and is billed monthly beside it:

API blockCutouts a monthPrice a monthPer cutout
API 2k2,000$15$0.0075
API 10k10,000$49$0.0049
API 50k50,000$149$0.0030

Against Leonardo’s listed price, using the Free plan plus a block:

Cutouts a monthLeonardo.AiPhotoFig
25about $3$0 (Free)
200about $21$15 (API 2k)
2,000about $209$15 (API 2k)
10,000about $1,047$49 (API 10k)
50,000about $5,235$149 (API 50k)

Leonardo’s figure is $0.1047 per image from its migration guide, before any volume pricing it may offer. For reference, 200 cutouts a month cost $39 on a remove.bg subscription in October.

Two things to know about the PhotoFig side. The allowance is monthly and does not roll over, so a block is a poor fit for 40 cutouts one month and 9,000 the next. And mask, ai-bg, and ai-shadows each use one API cutout, because each removes the background; the last two also use one AI credit. resize uses neither.

A migration checklist for November

  1. Find every caller. Search your code and your automation tools (Zapier, Make, scripts on old servers) for api.remove.bg.
  2. Export your remove.bg history while the account page still works: invoices and the credit usage report.
  3. Use up pay-as-you-go credits. They expire on December 1.
  4. Compare cutouts on your hardest products. Glass, mesh, chains, fur, white on white. Run ten of them through remove.bg and the replacement while both still answer, and compare the edges at full size. You cannot do that comparison after December 1.
  5. Handle the new status codes. 202 means still running, 422 means the job failed, 402 means the month’s cutouts are used up.
  6. Switch behind a flag. Keep the remove.bg path until the new one has handled a few days of real traffic.
  7. Retry correctly. On 429, wait for Retry-After. On 5xx, back off exponentially. Send the same idempotency key with every retry.
  8. Remove the old key once nothing calls it.

If you are also looking at Photoroom, the PhotoFig vs Photoroom comparison covers how the two differ for catalog work.

Which should you choose?

If your calls depend on remove.bg’s options, or you need its output sizes, move to Leonardo.Ai. The parameters carry over and it is the official path.

If you send a product photo and want the cutout back, PhotoFig is the smaller change and costs a fraction per image. And if the cutout is followed by sizing, backgrounds, shadows, and exports that your own code does today, a lot of that code can go away with it.

Either way, start this month. The API documentation and the OpenAPI file have every endpoint, field, and error code.

Sources

Frequently asked questions

When does the remove.bg API stop working?
The self-service API stops accepting requests on December 1, 2026, when the remove.bg website closes at 9:00 CET. Enterprise API contracts are not affected and continue as normal.
What is the official replacement for the remove.bg API?
Leonardo.Ai, which is also part of Canva. Its migration guide keeps most remove.bg parameters under the same names and has a synchronous endpoint. Requests and responses are JSON only, it needs a new Leonardo account and API key, and the guide lists $0.1047 per image.
Is the PhotoFig API a drop-in replacement for remove.bg?
For a basic cutout call it is close: change the URL and the key, add two headers, and the response body is the PNG, as before. The X-Api-Key header and the image_file and image_url fields are accepted as they are. Options such as size, crop, and bg_color are not read, so calls that depend on them need the resize tool or a template.
How much does the PhotoFig API cost?
Every plan includes API access with a monthly allowance of API cutouts: 25 on Free, 100 on Starter, 500 on Pro, and 2,000 on Studio. API blocks add 2,000, 10,000, or 50,000 cutouts a month to any plan for $15, $49, or $149. A cutout is charged only when its job completes.
What output does the PhotoFig mask tool return?
A transparent PNG cutout, up to 4096 pixels on the long side. Inputs can be JPEG, PNG, WebP, or HEIC up to 10 MB. With Prefer: wait and Accept: image/png the PNG is the response body; otherwise you get a job with a signed download link that works for 24 hours.