API DOCS OPEN APP
← API OVERVIEW

Sprite Packs

N distinct sprites in ONE generation call, split server-side into ready-to-use PNGs. The cheapest per-sprite path on the API: a 3x3 epic pack is 2 credits for 9 sprites, against 1 credit each individually.

POST /pack

POST /api/v1/pack 2 CR EPIC · 9 CR MYTHIC
FieldTypeNotes
promptstring, requiredThe subject or theme: "medieval weapons", "forest creatures", "cozy cafe food items". Max 500 chars
gridstring2x2 to 8x8, default 3x3. Above 3x3 needs an active subscription. Per-sprite detail drops past 5x5 (one generation is being split into more cells)
variancestringvariants = same subject, mild pose/detail variation. family (default) = related designs on the theme. wild = highly varied
qualitystringepic (default) or mythic
sheet_heightint128 to 1024. Height of the cleaned sheet; default 256 up to 5x5, size-scaled beyond

Python:

import base64, requests

r = requests.post(
    "https://spritelab.dev/api/v1/pack",
    headers={"Authorization": "Bearer sl_live_YOUR_KEY"},
    json={"prompt": "medieval fantasy weapons", "grid": "3x3", "variance": "family"},
    timeout=180,
)
r.raise_for_status()
out = r.json()
open("weapons_sheet.png", "wb").write(base64.b64decode(out["sheet_b64"]))
for cell in out["cells"]:
    open(f"weapon_{cell['index']:02d}.png", "wb").write(base64.b64decode(cell["image_b64"]))
print(len(out["cells"]), "sprites for", out["cost"], "credits")

Response envelope:

{
  "id": "d7e1…",              # history row: the app's Split tool works on it too
  "mode": "pack",
  "grid": "3x3",
  "sheet_b64": "…",           # the full cleaned spritesheet
  "width": 256, "height": 256,
  "cells": [                   # row-major, cropped tight to each sprite's pixels
    {"index": 0, "image_b64": "…", "width": 78, "height": 74},
    …
  ],
  "cost": 2,
  "credits_remaining": 372
}

Notes