> For the complete documentation index, see [llms.txt](https://docs.photoroom.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.photoroom.com/tutorials/how-to-migrate-from-remove.bg-api-before-it-shuts-down.md).

# How to migrate from Remove.bg API before it shuts down

Remove.bg's self-serve API stops on 1 December 2026. What happens to your integration, and how to move it to Photoroom's Remove Background API with two changes.

### What happens to my Remove.bg API integration on December 1st 2026?

The Remove.bg self-serve API stops accepting requests from **December 1st 2026**.

From that date:

* any call made to `https://api.remove.bg/v1.0/removebg` with a Remove.bg API key will fail
* unused pay-as-you-go credits expire
* the standalone Remove.bg website and its accounts are no longer available, from 9:00 CET

These details come from the [Remove.bg FAQ](https://www.remove.bg/faq).

{% hint style="warning" %}
Your integration will not keep working on its own after that date. If your product, script or automation calls the Remove.bg API, it needs to point to another API before 1 December 2026.
{% endhint %}

### How do I keep my integration working?

The [Remove Background API](https://docs.photoroom.com/remove-background-api-basic-plan/quickstart-guide.md) from Photoroom offers a built-in compatibility with the API of Remove.bg: it accepts the same argument names and returns the result in the same format.

This means that migrating only takes two changes:

1. The URL, to `https://sdk.photoroom.com/v1/segment`
2. The API key, to a Photoroom API key

{% hint style="info" %}
If you don't have an API key, here are the [steps to create yours](https://docs.photoroom.com/getting-started/introduction.md#how-can-i-get-my-api-key).
{% endhint %}

So if your code currently calls the API of Remove.bg, like this:

{% tabs %}
{% tab title="cURL" %}

```bash
curl -H 'x-api-key: YOUR_REMOVE_BG_API_KEY' \
  -f https://api.remove.bg/v1.0/removebg \
  -F 'image_file=@/absolute/path/to/image.jpg' \
  -F 'crop=true' \
  -F 'bg_color=FFFFFF' \
  -F 'format=jpg' \
  -F 'size=hd' \
  -o result.jpg
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

response = requests.post(
    "https://api.remove.bg/v1.0/removebg",
    headers={"x-api-key": "YOUR_REMOVE_BG_API_KEY"},
    files={"image_file": open("/absolute/path/to/image.jpg", "rb")},
    data={"crop": "true", "bg_color": "FFFFFF", "format": "jpg", "size": "hd"},
)
response.raise_for_status()

with open("result.jpg", "wb") as f:
    f.write(response.content)
```

{% endtab %}
{% endtabs %}

Then this is the same call, made to the Remove Background API:

{% tabs %}
{% tab title="cURL" %}

```bash
curl -H 'x-api-key: YOUR_PHOTOROOM_API_KEY' \
  -f https://sdk.photoroom.com/v1/segment \
  -F 'image_file=@/absolute/path/to/image.jpg' \
  -F 'crop=true' \
  -F 'bg_color=FFFFFF' \
  -F 'format=jpg' \
  -F 'size=hd' \
  -o result.jpg
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

response = requests.post(
    "https://sdk.photoroom.com/v1/segment",
    headers={"x-api-key": "YOUR_PHOTOROOM_API_KEY"},
    files={"image_file": open("/absolute/path/to/image.jpg", "rb")},
    data={"crop": "true", "bg_color": "FFFFFF", "format": "jpg", "size": "hd"},
)
response.raise_for_status()

with open("result.jpg", "wb") as f:
    f.write(response.content)
```

{% endtab %}
{% endtabs %}

Beside these two changes, the rest of the code doesn't need to be modified.

### Which Remove.bg arguments don't carry over?

The Remove Background API accepts these arguments of Remove.bg: `image_file`, `format`, `channels`, `bg_color`, `size` and `crop`.

If your integration uses other arguments, here is what to change:

| Remove.bg argument                            | What to do                                                                                                                                                                              |
| --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `image_url`                                   | Download the image and send it as `image_file`, or use the [Image Editing API](https://docs.photoroom.com/image-editing-api-plus-plan/quickstart-guide.md), which accepts an `imageUrl` |
| `image_file_b64`                              | Supported, but only when the request is sent as JSON rather than as a form (see [Troubleshooting](https://docs.photoroom.com/getting-started/troubleshooting.md))                       |
| `bg_image_url`, `bg_image_file`               | Use the Image Editing API with a [static background](https://docs.photoroom.com/image-editing-api-plus-plan/static-background.md)                                                       |
| `roi`, `scale`, `position`, `crop_margin`     | Use the Image Editing API, which gives full control over [positioning](https://docs.photoroom.com/image-editing-api-plus-plan/positioning.md)                                           |
| `add_shadow`, `shadow_type`, `shadow_opacity` | Use the Image Editing API with [AI Shadows](https://docs.photoroom.com/image-editing-api-plus-plan/ai-shadows.md)                                                                       |
| `type`, `type_level`, `semitransparency`      | Not needed: remove them from the call                                                                                                                                                   |
| `format=zip`, `format=auto`                   | Use `png`, `jpg` or `webp`                                                                                                                                                              |
| `size=auto`, `size=50MP`                      | Use `preview`, `medium`, `hd` or `full`                                                                                                                                                 |

### How is this different from moving to Leonardo.ai?

Remove.bg points its API users to Leonardo.ai. According to [Leonardo.ai's migration guide](https://docs.leonardo.ai/docs/migrate-from-the-removebg-api-to-leonardoai), this is a different API rather than a drop-in replacement: requests are JSON only, so image files can't be attached to the call, and the response is always JSON rather than the image itself.

The Remove Background API keeps the format your code already uses: you upload the image file, and you receive the result image directly in the response.

### How should I plan the migration?

We recommend doing it in three steps, ahead of the deadline:

1. **Test for free.** Create a Photoroom API key and prepend `sandbox_` to it to use [Sandbox mode](https://docs.photoroom.com/remove-background-api-basic-plan/sandbox-mode.md): you get up to 1,000 free calls per month, with a watermark on the results. Swap the URL and the key in a test environment and run your existing calls.
2. **Compare the results on your own images**, especially the difficult ones: fine hair, fur, transparent products, complex edges. If you use arguments from the table above, this is also the moment to update them.
3. **Switch production over** by using your API key without the `sandbox_` prefix. Before 1 December 2026, also download anything you want to keep from your Remove.bg account.

{% hint style="info" %}
If an AI coding agent maintains your integration, you can give it the URL of this page: every page of this documentation is available as Markdown by appending `.md` to its URL.
{% endhint %}

### Where can I learn more?

* [Remove.bg compatibility](https://docs.photoroom.com/remove-background-api-basic-plan/remove.bg-compatibility.md): the reference page for the compatibility between the two APIs
* [Photoroom vs Remove.bg migration guide](https://www.photoroom.com/api/photoroom-vs-removebg): pricing, accuracy guarantee, and answers to common questions about the shutdown
* [Remove.bg shutdown: what it means for your image pipeline](https://www.photoroom.com/blog/remove-bg-shutting-down)
* [Photoroom API vs Leonardo.ai: what background removal costs](https://www.photoroom.com/blog/remove-bg-api-cost-leonardo-ai-vs-photoroom)
* [Remove Background API pricing](https://docs.photoroom.com/remove-background-api-basic-plan/pricing.md)
* [Remove Background API Quickstart Guide](https://docs.photoroom.com/remove-background-api-basic-plan/quickstart-guide.md): all the arguments supported by the API
* [Code Samples](https://docs.photoroom.com/remove-background-api-basic-plan/code-samples.md): ready-to-use integrations for Web, Node.js, Python and iOS


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.photoroom.com/tutorials/how-to-migrate-from-remove.bg-api-before-it-shuts-down.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
