# Remove.bg compatibility

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

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 didn't need to be modified, because the name of the arguments and the format of the result both stay the same.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.photoroom.com/remove-background-api-basic-plan/remove.bg-compatibility.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
