On this page, you will find some common questions or issues you might encounter when integrating the Photoroom API, along with their answer.

Q: Why do I get the error "Unauthorized" when calling the API?

A: If your call is resulting in this error:


Then it's likely that you either forgot to put your apiKey in the headers of your call or that your credit balance has reached zero.

You can learn how to get your apiKey here and how to monitor your credit balance here.

Q: Can I send my image in Base64 format?

A: Yes, sending your image in Base64 format is possible for the Remove Background API.

Here's a sample code in JavaScript:

const removeBackground = async (base64Image) => {
  const options = {
    method: "POST",
    headers: {
      "x-api-key": YOUR_API_KEY,
      "Content-Type": "application/json",
      Accept: "application/json",
    body: JSON.stringify({
      image_file_b64: base64Image.split(",")[1],

  fetch("", options)
    .then((response) => response.json())
    .then((response) => {
    .catch((err) => console.error(err));

Q: When I call the Remove Background API, the result image gets rotated

A: An image can be rotated through a value set inside the EXIF metadata of the image.

Since the API doesn’t carry over EXIF metadata into the result image, the rotation will then get lost in the process.

The best solution to this problem is to physically perform the rotation by rotating the image itself before making the API call.

Here’s an example of how to do it when using the JavaScript library sharp:

async function removeImageBackground (imageBuffer) {
    // Normalize the image orientation based on its EXIF Orientation tag
    // Then reset the EXIF Orientation tag to 1
    const normalizedImageBuffer = await sharp (imageBuffer)
        .rotate() // Automatically adjust rotation based on EXIF data
        .withMetadata({ orientation: 1 }) // Reset EXIF Orientation tag to 1
        .toBuffer(); // Convert back to buffer for further processing

    console. log ('Image orientation normalized to EXIF rotation value 1.');

    // Make the API call

Q: I'm using Axios to make the API call, but I can't decode the result image

A: Calls to the Photoroom API will return a binary image in the body of the HTTP response.

In order to properly decode the image when using Axios to make the API call, you'll need to configure the call with the option { responseType: 'arraybuffer' } :

const url = /* create the URL for your API call */

const options = { responseType: 'arraybuffer' }

const result = await axios.get(url, options)

Q: Photoroom API has stopped working/answering

A: The Photoroom API is used by the Photoroom iOS, Android, and Web apps. Timeouts are unlikely to happen or would impact our own products in a critical way.

If Photoroom API has stopped working on your side, please check the following points:

  1. Do you still have credits? Visit your dashboard and check your remaining credits, you can buy more credits directly from your dashboard if needed.

  2. Is the API returning an error or an erroneous image? Report your technical bug or issue using the procedure explained in the following question.

Q: I have a technical issue/bug with Photoroom API

A: We currently don't provide technical support for implementing the API over email.

In case of an integration issue or of a bug on Photoroom's side:

  1. Share with us:

    • A standalone code to reproduce the bug

    • The original input image you used

    • The output image returned by Photoroom API

    • A detailed description or visual example of the expected image you would have liked to get

We will investigate the issue and come back to you shortly.

Last updated