---
title: "Remove a background"
method: POST
path: "/api/background-removals"
tags: ["Edits"]
---

# Remove a background

`POST /api/background-removals`

## Request

- Base URL: `https://www.sprite-ai.art`
- URL: `https://www.sprite-ai.art/api/background-removals`
- Auth: HTTP bearer

Remove a flat single-color background from a sprite or animation you own. standard is free, refined costs 1 token. Synchronous.

## Request body

- object
  - `source_generation_id` string, uuid, required
  - `method` 'standard' | 'refined'
  - `matte_color` string
  - `tolerance` integer
  - `palette_size` integer
  - `alpha_threshold` number

## Response `201`

The transparent sprite, saved as a new id.

- object

## Other responses

- `400`: The request failed validation.
- `401`: Missing or invalid API key.
- `402`: Not enough tokens.
- `403`: The API key is revoked or expired.
- `404`: Not found, or not yours.
- `429`: Rate limited. Retry after the Retry-After header.
- `500`: Generation failed. Tokens are refunded.

---

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