# Using the local Celgrid pixel-art service

Discover the service at `GET /v1` (service version 4). The Studio workbench lives at `/studio` (and `/?asset=<id>`), while the product and pricing site lives at `/`. The local MCP adapter (`spriteforge_mcp.py`, stdio) remains compatible and exposes generation, revision, pixel editing, rename, timing, and export tools.

## Projects and Art Direction Presets

- `GET /v1/project-presets`: list built-in indie game presets (`dungeon_24`, `cozy_topdown_16`, `arcade_side_32`, `handheld_4`, `sunset_tactics_24`, `pico_action_16`) plus custom saved presets.
- `POST /v1/project-presets`: save a reusable art direction and settings preset (`name`, `tagline`, `accent_color`, `art_direction`, `settings`).
- `GET /v1/projects` / `POST /v1/projects` / `PATCH /v1/projects/{id}` / `DELETE /v1/projects/{id}`: create and manage projects holding shared canvas dimensions, palette lock, outline, camera view, model, quality, FPS, art direction brief, and style references.

## Concurrent Background Generation Queue

- `POST /v1/jobs`: enqueue a sprite generation (`kind: "generate"`, same body as `POST /v1/pixel-assets`) or frame revision (`kind: "revise"`, `asset_id`, plus revision fields). Returns `202 Accepted` immediately while up to 4 workers generate simultaneously in parallel.
- `GET /v1/jobs` and `GET /v1/jobs/{id}`: monitor live status (`queued`, `running`, `completed`, `failed`), phase stage, elapsed time, and resulting asset ID.
- `DELETE /v1/jobs/{id}`: cancel a queued job or dismiss a finished job.

## Make an asset synchronously

`POST /v1/pixel-assets` with `application/json`. Pass optional `project_id` to inherit project defaults, art direction, and style references automatically.

```json
{
  "prompt": "Side-view medieval knight with plumed helmet, kite shield and glowing sword",
  "project_id": "optional-12-hex-project-id",
  "provider": "claude",
  "model": "claude-fable-5-2",
  "quality": "studio",
  "palette_lock": "sweetie16",
  "width": 24,
  "height": 24,
  "max_colors": 12,
  "view": "side",
  "outline": "dark",
  "animation": "attack",
  "motion_strength": "normal",
  "frames": 6,
  "fps": 10,
  "loop": true
}
```

### Quality pipelines and models

- `quality`:
  - `studio`: 3-pass generation (Silhouette and palette -> Cluster shading -> Vision self-critique polish), plus a contact-sheet Vision audit for multi-frame animations.
  - `balanced`: 2-pass generation (Silhouette and palette -> Cluster shading).
  - `fast`: single-pass aligned character grid.
- `model`: `claude-fable-5-2` (default pixel artist), `claude-opus-5-5`, `claude-sonnet-5-5` or `claude-haiku-5-5`.
- `palette_lock`: `"auto"`, a curated preset (`"sweetie16"`, `"endesga16"`, `"pico8"`, `"apollo"`, `"slso8"`, `"gameboy"`), `{"asset_id": "<12-hex-id>"}`, or `{"colors": ["#1A1C2C", ...]}`.

## Library, Revisions, Pixel Edits, and Exports

- `GET /v1/pixel-assets`: supports optional filters (`project_id`, `type`, `animation`, `size`, `starred`, `tag`, `q`, `sort`).
- `PATCH /v1/pixel-assets/{id}`: update `title`, `project_id`, `starred`, and `tags`.
- `POST /v1/pixel-assets/{id}/frames`: AI `repair` or `next` on one frame.
- `POST /v1/pixel-assets/{id}/pixels`: save direct indexed pixel edits at zero API cost.
- `POST /v1/pixel-assets/{id}/frame-ops`: instant `duplicate`, `delete`, `move`, `flip_h`.
- `POST /v1/pixel-assets/{id}/timing`: update `fps` (`0.5` to `60`) without regenerating pixels.
- `POST /v1/import`: import an exact 4 to 64 px indexed PNG (`name`, `colors`, `grid`, optional `project_id`).
- `GET /v1/pixel-assets/{id}/pack.zip`: lossless frames, Aseprite/Phaser atlas JSON, Godot 4 `.tres` and `.tscn`, Unity importer helper and `IMPORT.txt`.
