Pixel art, HD sprites, tilesets, and UI elements. Send a prompt, get production-ready assets back in seconds.
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...
All parameters for POST /v1/api/generate and POST /v1/api/generate-sync. Only prompt is required.
| Parameter | Type | Description |
|---|---|---|
promptrequired | string | What to generate, e.g. "a medieval iron sword, side view" |
width | int | Image width in pixels (16-512) |
height | int | Image height in pixels (16-512) |
variations | int | Number of variations (1-4) |
pixel | bool | Pixel art (true) or detailed HD art (false) |
pixel_perfect | bool | Grid-aligned pixel post-processing |
bg_mode | string | "transparent", "white", or "include" |
theme | string | Art theme context, e.g. "dark fantasy medieval" |
style | string | Style direction, e.g. "16-bit SNES style" |
aspect_ratio | string | "1:1", "16:9", or "9:16" |
smart_crop | bool | Auto-crop to content bounds |
mode | string | "assets", "texture", or "ui" |
model | string | AI model to use |
resolution | string | "1K", "2K", or "4K" |
colors | string[] | Color palette, hex codes (max 8) |
reference_asset_id | string | Asset ID for style reference (consistent art) |
edit_asset_id | string | Asset ID to edit/modify |
runpod_alpha_threshold_enabled | bool | Alpha threshold toggle for Basic background removal. When false, runpod_alpha_cutoff is ignored. |
runpod_alpha_cutoff | int | Binary alpha cutoff for Basic background removal when runpod_alpha_threshold_enabled is true. |
project_id | string | Assign output to a project (UUID) |
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" }'
Standalone background removal uses the same async polling pattern, but returns a temporary file result instead of owned assets.
curl -X POST https://api.spritecook.ai/v1/api/remove-background \ -H "Authorization: Bearer sc_live_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "asset_id": "b9fce2d4-..." }'
All parameters for POST /v1/api/animate and POST /v1/api/animate-sync. These endpoints expect an existing asset_id. If you only have local image bytes, import them first with POST /v1/api/assets/import. When pixel is omitted, SpriteCook infers the correct animation mode from the asset.
| Parameter | Type | Description |
|---|---|---|
asset_idrequired | string | Existing SpriteCook asset to animate. Must belong to the authenticated user. |
promptrequired | string | What the animation should do, e.g. "walk cycle, side view" |
pixel | bool | Optional mode override. When asset_id is used and pixel is omitted, SpriteCook infers pixel vs detailed mode from the source asset. |
removebg | string | Background removal mode: "None", "Basic", or "Pro". "Basic" is the default; "Pro" adds extra per-frame cost. |
output_frames | int | Even frame count. Pixel mode: 2-16. Detailed mode: 2-24. |
output_format | string | "webp", "gif", or "spritesheet" |
negative_prompt | string | Optional negative prompt |
matte_color | string | Hex matte color for flattening alpha |
colors | int | Pixel palette size. Only valid when pixel=true. |
runpod_alpha_threshold_enabled | bool | Alpha threshold toggle for Basic background removal during cleanup. When false, runpod_alpha_cutoff is ignored. |
runpod_alpha_cutoff | int | Binary alpha cutoff for Basic background removal during cleanup when runpod_alpha_threshold_enabled is true. |
Pixel mode constraints
PNG only, source dimensions up to 256x256, `output_frames` must be even and between 2 and 16. This mode is used automatically for pixel assets unless you explicitly override it.
Detailed mode constraints
PNG or JPEG, source dimensions between 256x256 and 2048x2048, `output_frames` must be even and between 2 and 24. If a source is smaller than 256x256, SpriteCook rejects the request before it reaches the provider.
If you're connecting SpriteCook to Cursor, VS Code, Claude, or another MCP-compatible editor, use the one-command installer. It configures everything automatically.
POST /v1/api/remove-background accepts exactly one input source: either an owned asset_id or raw uploaded media. Raw uploads can be a still image or animated WebP. The endpoint always runs the current basic cleanup backend and returns a temporary file result through job polling.
| Parameter | Type | Description |
|---|---|---|
asset_id | string | Owned SpriteCook asset to process. Asset metadata is used to infer whether the source is a still image or animated WebP. |
image | string | Base64 image data or data URL for an external upload. Supports still images and animated WebP. |
file | multipart file | Multipart upload alternative for an external still image or animated WebP. |
runpod_alpha_threshold_enabled | bool | Alpha threshold toggle for Basic background removal. When false, runpod_alpha_cutoff is ignored. |
runpod_alpha_cutoff | int | Binary alpha cutoff for Basic background removal when runpod_alpha_threshold_enabled is true. |
bash -c "$(curl -fsSL https://spritecook.ai/install.sh)"POST /v1/api/remove-background costs 1 credit for still images and 2 credits for animated WebP by defaultBasic; None skips it and Pro adds extra per-frame costgenerate scope and return output when they finishEvery response includes credits_used and credits_remaining.
insufficient_creditsrate_limitedscope_deniedinvalid_requestjob_not_foundCreate an account, grab an API key, and generate your first sprite in under a minute.