Connecting to Celgrid API... Checking mode

Celgrid API and MCP

Generate native indexed pixel art, manage art-direction projects, launch parallel background jobs, and export Godot, Unity, Phaser, or Aseprite packs over plain HTTP JSON.

Base URL https://celgrid.ai

Connect Celgrid MCP

Want step-by-step setup tabs for Claude Code, Codex, Cursor, Antigravity, OpenCode, and Cline? Open the AI Coding Agents Setup Hub (/agents). In Claude Code, add the hosted server to browse the public starter library and read the Celgrid guide without signing in.

Hosted HTTP
claude mcp add celgrid --transport http https://celgrid.ai/mcp

To create, edit, or export through MCP, create a personal API key in Settings. Verified Starter, Indie, Studio, credit pack, and BYOK wallet users can all create keys. Add it as an Authorization: Bearer header or use X-API-Key.

If your client uses stdio, use the following command and set CELGRID_API_KEY in the client's environment for account tools.

Stdio fallback
npx -y github:kallehiitola/celgrid-mcp

For AI generation, use managed credits or supply X-Anthropic-Key with your Celgrid key to use the 15% prepaid BYOK fee wallet. The same Celgrid key also works with the REST examples below.

Bring Your Own API Key (BYOK)

Run Celgrid using managed credits or pass your own Anthropic API key on every request. In BYOK mode you pay Anthropic directly at standard token rates, and Celgrid applies a transparent 15% platform fee on AI generation spend. Manual pixel edits, frame operations, FPS timing, and engine exports are always free ($0.00 fee).

Header
X-Anthropic-Key: sk-ant-api03-...
Settings API
GET /v1/settings/byok and POST /v1/settings/byok
Usage response
usage.billing_mode = "byok", provider_cost_usd, platform_fee_usd (15%), total_cost_usd

Raw API keys are never persisted inside sprite metadata JSON, job listings, or exported engine zips.

Live API Playground

Execute real requests directly against this running Celgrid instance and inspect the JSON response.

GET
Ready
Click "Send request" to inspect a live response.

Background Generation Queue

Queue up to four concurrent sprite generations or frame revisions without blocking your client.

POST/v1/jobsReturns 202 Accepted immediately with a job.id and live stage tracking.
GET/v1/jobsList active and recent background jobs newest first.
GET/v1/jobs/{id}Inspect one job status (queued, running, completed, failed) and resulting asset_id.
DELETE/v1/jobs/{id}Cancel a queued job or dismiss a finished job.
curl -X POST http://127.0.0.1:8765/v1/jobs \
  -H "Content-Type: application/json" \
  -H "X-Anthropic-Key: sk-ant-your-key" \
  -d '{
    "prompt": "side-view dungeon skeleton archer with glowing green bow",
    "project_id": "optional-project-id",
    "quality": "studio",
    "model": "claude-fable-5-2",
    "frames": 6,
    "animation": "attack",
    "fps": 10
  }'
import requests

resp = requests.post(
    "http://127.0.0.1:8765/v1/jobs",
    headers={"X-Anthropic-Key": "sk-ant-your-key"},
    json={
        "prompt": "side-view dungeon skeleton archer with glowing green bow",
        "quality": "studio",
        "model": "claude-fable-5-2",
        "frames": 6,
        "animation": "attack",
        "fps": 10,
    },
)
job = resp.json()
print(job["id"], job["status"])
const res = await fetch("http://127.0.0.1:8765/v1/jobs", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-Anthropic-Key": "sk-ant-your-key",
  },
  body: JSON.stringify({
    prompt: "side-view dungeon skeleton archer with glowing green bow",
    quality: "studio",
    model: "claude-fable-5-2",
    frames: 6,
    animation: "attack",
    fps: 10,
  }),
});
const job = await res.json();
console.log(job.id, job.status);

Synchronous Sprite Generation

POST /v1/pixel-assets blocks until validation finishes and returns the complete sprite metadata, indexed pixel grids, palette, PNG URL, and exact billing breakdown.

POST/v1/pixel-assetsCreate a new sprite or animate from source_asset + source_frame.
GET/v1/pixel-assetsQuery filters: project_id, type, animation, size, starred, tag, q, sort.
PATCH/v1/pixel-assets/{id}Update title, project_id, starred, and tags.
DELETE/v1/pixel-assets/{id}Delete a saved sprite and its rendered PNG files.

Projects and Art-Direction Presets

Pass project_id on any generation to automatically inherit canvas dimensions, locked palette, view, outline, quality, model, FPS, style references, and the project's shared art-direction brief.

GET/v1/projectsList all projects with live asset_count and total_cost_usd.
POST/v1/projectsCreate a project from a preset_id or custom settings and art direction.
POST/v1/projects/examplesIdempotently seed the 3 curated example game projects.
PATCH/v1/projects/{id}Update project name, color, settings, style references, or art direction.
GET/v1/project-presetsList built-in indie game presets plus custom user-saved presets.
POST/v1/project-presetsSave a new reusable art-direction preset.

Frame Revisions, Pixel Edits, and Imports

POST/v1/pixel-assets/{id}/framesRun AI repair or draw next frame with optional green Allow / coral Lock pixel_mask.
POST/v1/pixel-assets/{id}/pixelsSave direct indexed pixel edits at $0.00 cost as an immutable version.
POST/v1/pixel-assets/{id}/frame-opsInstant local timeline edits: duplicate, delete, move, flip_h.
POST/v1/pixel-assets/{id}/timingUpdate playback and export fps (0.5 to 60) without redrawing pixels.
POST/v1/importImport an exact lossless 4 to 64 px indexed PNG grid.

Lossless Engine Exports

GET/v1/pixel-assets/{id}/frame.png?index=0Single native-resolution RGBA frame PNG.
GET/v1/pixel-assets/{id}/spritesheet.pngPacked horizontal, vertical, or grid spritesheet PNG.
GET/v1/pixel-assets/{id}/jsonFull indexed sprite metadata, frame rects, anchors, and usage record.
GET/v1/pixel-assets/{id}/pack.zipComplete zip with PNG frames, Aseprite/Phaser JSON, Godot 4 .tres/.tscn, and Unity importer.