---
title: "Remove Background (Basic plan)"
method: POST
path: "/v1/segment"
---

# Remove Background (Basic plan)

`POST /v1/segment`

## Request

- Base URL: `https://sdk.photoroom.com`
- URL: `https://sdk.photoroom.com/v1/segment`
- Auth: API key in header `x-api-key`

Remove background from an image

## Request body `multipart/form-data`

- RemoveBackgroundPostParams
  - `image_file` string, binary, required: The image file to render
  - `format` 'png' | 'jpg' | 'webp': The format of the resulting image
  - `channels` 'rgba' | 'alpha': The channels of the resulting image
  - `bg_color` string: The background color of the resulting image. Can be a hex code (`#FF00FF`) or a HTML color (`red`, `green`, etc.)
  - `size` 'preview' | 'medium' | 'hd' | 'full': Will resize the output to the specified size. Can be `preview` (0.25 Megapixels), `medium` (1.5 MP), `hd` (4 MP) or `full` (36 MP, can be slower for large images). Useful for mobile apps that need smaller images.
  - `crop` 'true' | 'false': If `true`, the image returned is cropped to the cutout border. Transparent pixels are removed from the border
  - `despill` 'true' | 'false': If `true`, automatically removes colored reflections that have been left on the main subject by a green background.

## Response `200`

OK

- object
  - `base64img` string, base64, required

## Other responses

- `400`: Bad Request
- `402`: Payment Required
- `403`: Forbidden

## Changes

- **2026-11-03** `a9597c56073d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/photoroom/apis/photoroom-api/changes/v1/segment/post.md)

---

[API](https://skmtc.dev/photoroom/apis/photoroom-api.md) - [All operations](https://skmtc.dev/photoroom/apis/photoroom-api/llms.txt) - [OpenAPI document](https://skmtc.dev/photoroom/apis/photoroom-api/revisions/a9597c56073d?raw)
