API Reference

Generate game art with a single API call

Pixel art, HD sprites, tilesets, and UI elements. Send a prompt, get production-ready assets back in seconds.

Authentication

API Keys

All requests use Bearer token authentication. Create a key in your SpriteCook dashboard and include it in the Authorization header.

Authorization: Bearer sc_live_xxxxxxxxxxxxxxxxxxxx...
Get Your API Key
Endpoints

Available Routes

Reference

Generate Parameters

All parameters for POST /v1/api/generate and POST /v1/api/generate-sync. Only prompt is required.

ParameterTypeDescription
promptrequiredstringWhat to generate, e.g. "a medieval iron sword, side view"
widthintImage width in pixels (16-512)
heightintImage height in pixels (16-512)
variationsintNumber of variations (1-4)
pixelboolPixel art (true) or detailed HD art (false)
pixel_perfectboolGrid-aligned pixel post-processing
bg_modestring"transparent", "white", or "include"
themestringArt theme context, e.g. "dark fantasy medieval"
stylestringStyle direction, e.g. "16-bit SNES style"
aspect_ratiostring"1:1", "16:9", or "9:16"
smart_cropboolAuto-crop to content bounds
modestring"assets", "texture", or "ui"
modelstringAI model to use
resolutionstring"1K", "2K", or "4K"
colorsstring[]Color palette, hex codes (max 8)
reference_asset_idstringAsset ID for style reference (consistent art)
edit_asset_idstringAsset ID to edit/modify
project_idstringAssign output to a project (UUID)
Examples

Quick Examples

curl -X POST https://api.spritecook.ai/v1/api/generate-sync \
  -H "Authorization: Bearer sc_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "a medieval iron sword, side view",
    "width": 64,
    "height": 64,
    "pixel": true,
    "bg_mode": "transparent"
  }'
Agent Setup

Using SpriteCook with AI agents?

If you're connecting SpriteCook to Cursor, VS Code, Claude, or another MCP-compatible editor, use the one-command installer. It configures everything automatically.

Terminal
$curl -fsSL https://spritecook.ai/install.sh | bash
Full agent setup guide
Billing

Credits & Errors

Credit Costs

  • Base cost: 8 credits per image
  • Multiple variations multiply the cost
  • Higher resolution may cost more

Every response includes credits_used and credits_remaining.

Common Errors

402insufficient_credits
429rate_limited
403scope_denied
400invalid_request

Start generating

Create an account, grab an API key, and generate your first sprite in under a minute.