> 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/remove-background-api-basic-plan/remove.bg-compatibility.md).

# Remove.bg compatibility

The Remove Background API offers a built-in compatibility with the API of Remove.bg.

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FOZDzxTnUBYNnNnk9rLis%2Fremove-bg-migration.gif?alt=media&amp;token=d8bae910-bad9-4064-ac9d-3f5c61f22495" alt=""><figcaption><p>Migrating from Remove BG to Photoroom is extremely easy to implement</p></figcaption></figure>

This means that any code that calls the API of Remove.bg, like this one:

```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
```

Can easily be updated to instead call the Remove Background API, just by changing:

1. The URL to `https://sdk.photoroom.com/v1/segment`
2. The API Key to [a Photoroom API Key](/getting-started/introduction.md#how-can-i-get-my-api-key)&#x20;

```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
```

As you can see, beside these two changes the rest of the code doesn't need to be modified, because the name of the arguments and the format of the result both stay the same.


---

# 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/remove-background-api-basic-plan/remove.bg-compatibility.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.
