API DOCS OPEN APP
← API OVERVIEW

Reskin

Take a pixel art sprite you already have and get themed variants back: same sprite, new surface finish. Ice, lava, gold, moss, neon. Output dimensions always equal input dimensions, so variants drop into your game as palette-swap-grade replacements.

Subscriber feature. This endpoint needs an active subscription (any plan) on the account that owns the key, same as in the app. Without one it returns 403 not_entitled. Credits still come from the top-up bucket.

POST /reskin

POST /api/v1/reskin 2 CR/VARIANT EPIC · 6 MYTHIC
FieldTypeNotes
image_b64string, requiredMust be pixel art, max 320px per axis of logical pixels. Pre-upscaled art (e.g. a 32px sprite exported at 640px) is detected and handled
themeslist of stringsOne theme per variant, e.g. ["molten lava", "arctic ice", "royal gold"]. Fewer themes than variants? The empty spots get curated random picks. Themes work best as SURFACE finishes, not objects: "molten lava" reskins, "a dragon" morphs
descriptionstringSingle theme applied to every variant. Used when themes is absent
variantsint1 to 11, default 4
qualitystringepic (default) or mythic
match_silhouetteboolDefault false. True snaps every variant's alpha exactly to the source silhouette: guaranteed identical footprint, at the cost of flatter growth-style themes (flames, vines)

Python:

import base64, requests

img = base64.b64encode(open("sword_32.png", "rb").read()).decode()
r = requests.post(
    "https://spritelab.dev/api/v1/reskin",
    headers={"Authorization": "Bearer sl_live_YOUR_KEY"},
    json={"image_b64": img, "themes": ["molten lava", "arctic ice"], "variants": 2},
)
r.raise_for_status()
out = r.json()
for v in out["variants"]:
    name = v["theme"].replace(" ", "_")
    open(f"sword_{name}.png", "wb").write(base64.b64decode(v["image_b64"]))

Response envelope:

{
  "mode": "reskin",
  "source_b64": "…",          # the normalised source the variants align to
  "width": 32, "height": 32,
  "variants": [
    {"image_b64": "…", "theme": "molten lava", "width": 32, "height": 32},
    {"image_b64": "…", "theme": "arctic ice",  "width": 32, "height": 32}
  ],
  "failed": 0,                 # failed variants are refunded automatically
  "cost": 4,                   # what was actually charged after refunds
  "credits_remaining": 370
}

Notes