---
title: "Save a palette"
method: POST
path: "/api/palettes"
tags: ["Palettes"]
---

# Save a palette

`POST /api/palettes`

## Request

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

Save a palette from a recipe returned by /api/palettes/generate, or from explicit colors. The returned id is the palette_id for sprite generation and import. Free.

## Request body

- object
  - `name` string, required
  - `recipe` object
    - `count` integer, required
    - `seed` integer, required
    - `theme` string, nullable
    - `primary` string, nullable
    - `moods` string[]
    - `hueShift` number, nullable
    - `focus` 'tight', nullable
    - `anchors` object[]
      - `hue` number
      - `hex` string
      - `neutral` 'black' | 'grey' | 'white'
      - `role` 'main' | 'support' | 'accent'
      - `value` 'dark' | 'light' | 'vivid' | 'muted' | 'deep'
      - `weight` number
    - `anchorsOnly` boolean
  - `colors` string[]

## Response `201`

The saved palette.

- object

## Other responses

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

---

[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)
