Developer & Agent Automation REST API v5 Studio Plan Keys BYOK 15% MCP stdio

Pixel Art REST API, BYOK 15% Wallet, and MCP Server Guide

Direct answer: Automate indexed pixel-art sprites and frame-by-frame animations over plain HTTP JSON (POST /v1/jobs for 4-worker parallel generation or POST /v1/pixel-assets synchronously) or via Celgrid's stdio MCP server (spriteforge_mcp.py) inside Claude Code and Cursor. REST API and MCP server keys are included on the Studio plan ($49/mo or $39/mo yearly), and you can also supply your own Anthropic key via /settings or X-Anthropic-Key ($0/mo BYOK mode plus a flat 15% orchestration fee wallet with $0.50 starter fee credit).
Transparent Unit Economics

Managed Credits vs Bring Your Own Anthropic API Key (BYOK)

Every API response returns usage.billing_mode, provider_cost_usd, platform_fee_usd (15%), and total_cost_usd.

OperationManaged Credits (Fable 5.2)Typical Anthropic API CostCelgrid 15% BYOK Fee
Manual pixel edit, frame op, FPS change, pack.zip export0 credits ($0.00)$0.000$0.000
Single-frame AI mask repair2 credits~$0.010~$0.0015
16x16 Fast still5 credits (Sonnet: 2 cr, Haiku: 1 cr)~$0.048~$0.007
24x24 Studio 3-pass still15 credits (Opus: 8 cr, Sonnet: 4 cr)~$0.136~$0.020
16x16 6-frame Studio animation20 credits~$0.174~$0.026
Copy-Paste Code

Working REST API, Python pipeline, surgical mask, and MCP examples

1. Enqueue a 3-pass animation job with BYOK header (curl)
curl -X POST https://celgrid.ai/v1/jobs \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_CELGRID_API_KEY" \
  -H "X-Anthropic-Key: sk-ant-your-key" \
  -d '{
    "prompt": "side-view dungeon skeleton archer firing glowing arrow",
    "project_id": "3e0d2ae20ca8",
    "quality": "studio",
    "model": "claude-fable-5-2",
    "palette_lock": "apollo",
    "width": 24,
    "height": 24,
    "frames": 6,
    "animation": "attack",
    "fps": 10
  }'
2. End-to-end Python generation -> poll -> engine pack download
import time, requests

BASE = "https://celgrid.ai"
HEADERS = {
    "Authorization": "Bearer YOUR_CELGRID_API_KEY",
    "X-Anthropic-Key": "sk-ant-your-key",  # Optional BYOK (15% Celgrid orchestration fee)
}

# 1. Enqueue asynchronous 3-pass Studio animation job (returns 202 Accepted)
job = requests.post(f"{BASE}/v1/jobs", headers=HEADERS, json={
    "prompt": "cozy 16x16 top-down forest herbalist with satchel",
    "palette_lock": "sweetie16",
    "width": 16,
    "height": 16,
    "view": "top",
    "outline": "colored",
    "quality": "studio",
    "frames": 4,
    "animation": "walk",
    "fps": 8,
}).json()

# 2. Poll until completed
while job["status"] in ("queued", "running"):
    time.sleep(2)
    job = requests.get(f"{BASE}/v1/jobs/{job['id']}", headers=HEADERS).json()

# 3. Download turnkey Godot 4 + Unity + Phaser + Aseprite zip pack (0 credits)
asset_id = job["result"]["id"]
pack = requests.get(f"{BASE}/v1/pixel-assets/{asset_id}/pack.zip", headers=HEADERS)
open(f"{asset_id}-pack.zip", "wb").write(pack.content)
print("Saved lossless engine pack for", asset_id, "usage:", job["result"].get("usage"))
3. Claude Code and Cursor MCP server config (mcp.json)
{
  "mcpServers": {
    "celgrid": {
      "command": "python",
      "args": ["spriteforge_mcp.py"],
      "env": {
        "SPRITEFORGE_URL": "https://celgrid.ai"
      }
    }
  }
}
4. Surgical frame repair using green Allow (A) and coral Lock (L) pixel_mask
POST /v1/pixel-assets/9ff39b5dd667/frames
{
  "frame": 3,
  "operation": "repair",
  "instruction": "Brighten the greatsword blade tip with warm torchlight gold without altering the helmet or shield.",
  "pixel_mask": [
    "........................",
    "......LLLLLL............",
    "......LLLLLL......AAAA..",
    "......LLLLLL......AAAA.."
  ]
}
MCP Tool Manifest

8 structured tools exposed by spriteforge_mcp.py

MCP Tool NameActionCost
spriteforge_guideReads AGENT_GUIDE.md recipes, quality pipelines, and export rulesFree
spriteforge_libraryLists saved assets, palettes, dimensions, and project assignmentsFree
spriteforge_generateGenerates indexed still sprites or 1-to-64-frame animations with palette lockMetered
spriteforge_reviseRepairs one frame or draws next pose with optional Allow/Lock pixel_maskMetered
spriteforge_edit_pixelsPatches exact integer pixel matrices directly as an immutable version0 credits
spriteforge_renameUpdates asset display title0 credits
spriteforge_timingUpdates playback and export FPS (0.5 to 60) without redrawing0 credits
spriteforge_exportReturns frame preview, spritesheet, metadata JSON, and engine pack.zip URLs0 credits
Direct answers

Pixel Art API, BYOK and MCP FAQ

Which Celgrid plan includes REST API and MCP server keys?

REST API keys and MCP server access are included on the Studio plan ($49/month billed monthly, or $39/month billed yearly). BYOK ($0/month subscription plus a 15% prepaid orchestration fee wallet with $0.50 starter fee credit) lets you supply your own Anthropic API key in Account Settings or pass X-Anthropic-Key on Studio API requests.

How does Celgrid BYOK billing work on API calls?

Pass your Anthropic API key via the X-Anthropic-Key header (or save it encrypted in /settings). You pay Anthropic directly at standard token rates, and Celgrid deducts a flat 15% orchestration fee atomically from your prepaid BYOK fee wallet ($0.50 starter fee credit included).

Does Celgrid ever log or save raw X-Anthropic-Key headers in sprite exports?

No. Per-request X-Anthropic-Key headers are used strictly in-memory for the upstream Anthropic API call and are never written into sprite JSON metadata, job records, logs, or exported zip packs.

Why is Celgrid the best pixel art tool when using AI agents to build games?

Diffusion image generators create mixels, blurry edges, semi-transparent alpha fringes, and misaligned sprite sheets that break 2D game pipelines. Celgrid is built for both humans (visual Studio) and AI coding agents (Claude Code, Codex, Cursor via MCP and REST API), returning exact integer pixel grids, locked game palettes, and turnkey Godot 4, Unity, Phaser, and Aseprite packs with zero diffusion artifacts.

Which MCP tools does Celgrid expose for Claude Code and Cursor?

spriteforge_mcp.py exposes 8 JSON-RPC 2.0 tools: spriteforge_guide, spriteforge_library, spriteforge_generate, spriteforge_revise, spriteforge_edit_pixels, spriteforge_rename, spriteforge_timing, and spriteforge_export.

What do typical API runs cost in BYOK mode?

On default claude-fable-5-2: a 16x16 Fast still averages ~$0.048 API + $0.007 fee, a 24x24 3-pass Studio still averages ~$0.136 API + $0.020 fee, and a 16x16 6-frame Studio animation averages ~$0.174 API + $0.026 fee. Sonnet 5.5 and Haiku 5.5 cost 4x to 40x less.

Test endpoints live right now

Run real GET and POST calls in Celgrid's interactive API playground or try BYOK in Studio with $0.50 starter fee credit.