---
title: "Remove the background from an image"
method: POST
path: "/api/v1/remove-background"
tags: ["Background removal"]
---

# Remove the background from an image

`POST /api/v1/remove-background`

## Request

- Base URL: `https://api.sudomock.com`
- URL: `https://api.sudomock.com/api/v1/remove-background`
- Auth: API key in header `x-api-key`

Isolates the subject of an image onto a transparent background and returns a clean PNG cutout URL, ready to use as render artwork. Costs 25 credits per image; credits are refunded automatically if processing fails.

## Request body

- BackgroundRemovalRequest: Body for POST /api/v1/remove-background. Image source priority mirrors AssetInput: base64 > url.
  - `url` string, nullable: URL of the image to process (HTTP/HTTPS). Either url or base64 must be provided.
  - `base64` string, nullable: Raw base64-encoded image bytes (no data: prefix). Either url or base64 must be provided.
  - `content_type` string, nullable: MIME type when using base64 field. Defaults to image/png if omitted.
  - `idempotency_key` string, nullable: Retry-stable request identifier. Required in both this field and the Idempotency-Key header for Studio calls.

## Response `200`

Successful Response

- BackgroundRemovalResponse: The cutout image and where to fetch it.
  - `data` BackgroundRemovalData, required: Result payload for POST /api/v1/remove-background.
    - `url` string, required: URL of the transparent-PNG cutout
    - `width` integer, required: Cutout width in pixels
    - `height` integer, required: Cutout height in pixels
    - `credits_charged` integer, required: Credits charged for this operation
  - `success` boolean: Success status

---

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