Moving from remove.bg to Leonardo.Ai's API: what changes
remove.bg points its API users to Leonardo.Ai. Leonardo's background removal is a different API: your requests, responses and error handling change. Below is what changes, from Leonardo's own migration guide, and the alternative of keeping your code.
Updated 1 December 2026.
remove.bg, Leonardo.Ai and Cutmatte side by side
| remove.bg (closed) | Leonardo.Ai sync API | Cutmatte | |
|---|---|---|---|
| Endpoint | POST /v1.0/removebg | POST /api/rest/v2/generationssync on cloud.leonardo.ai | POST /v1.0/removebg on api.cutmatte.com |
| Key | X-Api-Key | Authorization: Bearer | X-Api-Key (Bearer also works) |
| Request | multipart, JSON or form | JSON only, with "model": "remove-bg"; options move under parameters | multipart, JSON or form |
| Image file | image_file upload | No uploads in the request: base64 (under about 7.5 MB), a URL, or an image uploaded first | image_file upload |
| Response | The image itself, or JSON | Always JSON: a link, or base64 if you ask | The image itself, or JSON |
| Formats | png, jpg, webp, zip, auto | png, jpg, webp; no zip, no auto | png, jpg, webp, zip, auto |
bg_image_file | Yes | No; host the image and pass it by reference | Yes |
| Result headers | X-Credits-Charged, X-Type, X-Foreground-* | Cost in the JSON body; no type or foreground box | Same headers as remove.bg |
| Errors | HTTP status with a JSON error | Often HTTP 200 with an errors array | HTTP status with a JSON error, as remove.bg |
| Results kept | No | Kept in your Leonardo library unless you send "ephemeral": true | No |
| Price per image | — | $0.1047 | $0.009 to $0.003 |
Leonardo.Ai facts from its migration guide, read on 1 December 2026. Cutmatte's own gaps are listed in differences.
What you would change for Leonardo
- Create a Leonardo account and API key, and send it as a Bearer token.
- Point requests at Leonardo's sync endpoint and send JSON with
"model": "remove-bg". - Move the image into
parameters.guidances.image_reference: base64 for small files, a URL or an uploaded image for larger ones. Move the other options underparameters; their values stay the same. - Replace
format=zipandformat=autowith png, jpg or webp. - Read the result from
results[0].url, or ask for base64 and decoderesults[0].dataB64. Read the cost from the body. - Send
"ephemeral": trueif images must not be kept. - Update error handling: check the
errorsarray, not only the HTTP status.
When Leonardo.Ai is the better choice
- You want the successor remove.bg itself names, and its support.
- You want an asynchronous API with webhooks for large batches.
- You will use Leonardo's other models (image, video, upscaling) through the same API.
When keeping your code is simpler
If your code uploads files, expects the image bytes back, uses ZIP output or bg_image_file, reads X-Credits-Charged or the foreground headers, or relies on HTTP status codes for errors, a compatible API saves the rewrite. With Cutmatte the change is the base URL and the key:
- https://api.remove.bg/v1.0/removebg
+ https://api.cutmatte.com/v1.0/removebg
X-Api-Key: your Cutmatte key
Examples for cURL, Node.js, Python, PHP, Ruby, C#, Java and the remove.bg wrappers are in the migration guide. A new account gets 50 full-size images free.
Questions
Is Leonardo.Ai's background removal the same model as remove.bg?
Canva says remove.bg's technology lives on through Canva's Background Remover and the Leonardo.Ai API. We have not compared their outputs.
Can I keep sending multipart uploads to Leonardo.Ai?
No. According to its guide, the sync API takes JSON only; files go in as base64, a URL, or an image uploaded first.
Does Leonardo.Ai keep my images?
By default, results are kept in your Leonardo library. Its guide says to send "ephemeral": true to keep nothing after the call.
Cutmatte is not affiliated with remove.bg, Canva or Leonardo.Ai.