Exact-size sprites at 16 to 64px, drawn on a true pixel grid. Icons, inventory items, tiny characters: the PNG you get back is exactly NxN native pixels with a closed 1px outline.
403 not_entitled. Credits still come from the top-up bucket.| Field | Type | Notes |
|---|---|---|
| prompt | string, required | Max 400 chars. Keep it to a subject plus 2-3 bold features; a 16-32px sprite can't hold fine detail |
| size | int | 16 to 64, default 32. The EXACT output size. 16 suits icons and items, characters want 32+, 64 has room for real detail |
| quality | string | epic (default) or mythic |
| detail | string | clean (default, bold flat shapes) or detailed (shading, richer materials). Detailed needs size 24+ and suits characters and objects with distinct materials; organic textures can come out muddy |
Python:
import base64, requests
r = requests.post(
"https://spritelab.dev/api/v1/micro",
headers={"Authorization": "Bearer sl_live_YOUR_KEY"},
json={"prompt": "treasure chest with gold trim", "size": 24},
)
r.raise_for_status()
out = r.json()
open("chest_24.png", "wb").write(base64.b64decode(out["image_b64"]))
Response envelope:
{
"id": "b41c…",
"mode": "micro",
"image_b64": "…", # exactly 24x24 native pixels
"size": 24, "width": 24, "height": 24,
"detail": "clean",
"outline_gaps": 0, # quality signal: 0 = fully closed outline
"cost": 3,
"credits_remaining": 374
}
/resize rejects micro sprites with 409 not_resizable.)outline_gaps is a quality invariant we compute per result; 0 means the sprite's outline is closed everywhere.