API reference

Sprite Generator API

Everything the app does is a JSON call. This page covers the endpoints for creating, animating and exporting assets.

Authentication

Create a key in the app (avatar → My account and statement → API keys) and send it in every request:

Authorization: Bearer sg_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Never put the key in the client of a game you distribute (JavaScript in the browser, a build on Steam, an APK). Use it only on your machine, in CI or on your server.

Jobs and polling

Generating takes from seconds to a few minutes, so the requests that generate something return right away with a job. The result appears in the character when the job finishes.

{
  "id": "a1b2c3d4e5",
  "kind": "animation",            // create, variation, views, animation, edit, vfx…
  "character": "3f9a1c2b7d10",
  "status": "running",            // queued → running → done | error
  "message": "Generating…",
  "error": null,
  "cost": 10,                     // credits charged
  "created": 1760572800.1, "started": 1760572803.4, "finished": null
}
GET /api/jobs/{id}?wait=20

State of one job. Check every 2–5 seconds until status is done or error, or pass wait (up to 25 seconds): the answer comes as soon as the job finishes or the time runs out.

POST /api/estimate

Exact cost of a request before making it, with Turbo included; charges nothing. Body: action (create, skin, ui_state, edit, views, scene_layer, animation, ability, vfx…), and optionally character (its directions decide the number of videos), quality, count, request (abilities: a continuous breath/beam has 4 effects). Returns cost, each, videos and your balance.

GET /api/jobs?character={id}

Your latest 50 jobs, newest first (optionally only those of one character).

If a job ends in error, its credits come back automatically. Requests run in the order of the queue; your plan defines how many run at the same time.

Errors

Errors come with an HTTP code, a readable message in detail and, when there is one, the stable message key in detail_i18n.key. Base your logic on the HTTP code or the key, never on the text:

{ "detail": "Not enough credits: this request costs 30 and your balance is 12.",
  "detail_i18n": { "key": "server-accounts.noCredits" } }

Language: messages, errors and labels (jobs, presets, notifications) come in English by default. Send X-Lang: pt (or Accept-Language: pt-BR, or ?lang=pt) to receive them in Portuguese.

CodeWhen
400Invalid field (unknown animation, empty description, invalid quality…).
401Missing, invalid or deleted key.
402Not enough credits for this request.
403Your plan doesn't include the API, or the endpoint only works through the browser.
404It doesn't exist or doesn't belong to you (other accounts' items are invisible).
409The character is not ready yet (wait for the creation job).

Credits and limits

Account

Who am I and my balance

GET /api/auth/me
{ "email": "[email protected]", "plan": "pro", "plan_label": "Pro", "credits": 3420,
  "turbo": false, "slots": 1, "api": true, "costs": { … }, "plans": { … } }

Credit statement

GET /api/account/credits

Balance and the latest 50 entries (delta, reason, job_id, at).

Plans and costs (no key)

GET /api/pricing

Plans, credits per request and the Turbo multiplier. Useful to show the cost before requesting.

Presets (no key)

GET /api/presets

The ready animations (animations), styles, directions, direction modes, cameras, palettes, qualities and export formats, with their labels.

Projects

Every asset belongs to a project. The project's style kit (size, pixel art, palette, outline, camera, directions) is applied to everything created in it.

List and create

GET /api/projects
POST /api/projects
name REQUIREDstringProject name.
descriptionstringWhat the game is about (optional).
settingsobjectStyle kit (see below).

Change the style kit

PATCH /api/projects/{id}

Send only what changes; the other keys are kept.

settings.target_heightintCharacter height in pixels (8–1024).
settings.pixelboolPixel art: reduces to the height and snaps to the pixel grid.
settings.palette_sourcestringcharacter, project, pico8, sweetie16
settings.palette_colorsintMaximum number of colors.
settings.outlineboolDark outline around the character.
settings.camerastringCamera angle (keys in /api/presets → cameras).
settings.direction_modestringside (2), 4dir, 8dir
curl -X PATCH {{ORIGIN}}/api/projects/$PROJECT \
  -H "Authorization: Bearer $SG_KEY" -H "Content-Type: application/json" \
  -d '{"settings": {"pixel": true, "target_height": 64, "palette_source": "sweetie16", "outline": true}}'

Characters and assets

Create from a description

POST /api/characters/text

Creates a character, monster, item, UI element, scene or tileset. Returns {character, job, candidates}.

description REQUIREDstringWhat you want, in any language.
project REQUIREDstringProject id.
kindstringcharacter (default), monster, item, ui, scene, tileset
stylestringpixel, cartoon, anime, chibi, painted, vector, dark, none
namestringDisplay name (default: the start of the description).
countintHow many versions (1–8). The first becomes the base and its job comes back in job; the others come back in candidates (follow each one by its status). Each one is charged.
referencesstring[]Up to 3 character ids to follow the style of.
seedintStarting number, to repeat a result.
ui_typestringFor kind: ui: button, bar, panel, slot, icon, badge.
scene_formatstringFor kind: scene: wide, panorama, square. With seamless (bool) to loop the edges.
terrain_bstringFor kind: tileset (required): the second terrain. tile_mode: topdown or side; tile_size: 8–128.
from_characterstringFor kind: item: extracts the object from this character (e.g. the shield of a skin).
curl {{ORIGIN}}/api/characters/text \
  -H "Authorization: Bearer $SG_KEY" -H "Content-Type: application/json" \
  -d '{"description": "a cute slime monster with a tiny crown", "kind": "monster",
       "style": "pixel", "project": "'$PROJECT'", "count": 3}'
r = S.post(f'{API}/characters/text', json={
    'description': 'a cute slime monster with a tiny crown', 'kind': 'monster',
    'style': 'pixel', 'project': project_id, 'count': 3}).json()
wait(r['job'])
monster = S.get(f"{API}/characters/{r['character']['id']}").json()
const r = await call('/characters/text', {
  description: 'a cute slime monster with a tiny crown', kind: 'monster',
  style: 'pixel', project: projectId, count: 3 });
await wait(r.job);

Create from an image

POST /api/characters/upload multipart/form-data
file REQUIREDimagePNG/JPG/WebP of the character (the background is removed).
project REQUIREDstringProject id.
name, descriptionstringName and what it is (helps the animations).
stylestringpixel to treat it as pixel art.
curl {{ORIGIN}}/api/characters/upload -H "Authorization: Bearer $SG_KEY" \
  -F [email protected] -F project=$PROJECT -F name="Hero" -F description="knight with a shield"

Read a character

GET /api/characters/{id}

Main fields: status (pending → ready), kind, name, settings, animations, available (ready animation → directions), cell (frame size and pivot) and jobs (the ones still running).

GET /api/characters

All your characters and assets.

Character image

GET /api/characters/{id}/base/{direction}.png

The sprite in a direction (E, W, S, N, SE, SW, NE, NW) with the project's kit applied. 404 if that view hasn't been generated.

Skins and takes

POST /api/characters/{id}/skins

A new skin of the character (outfit, level, upgrade). Returns {skin, jobs}; each take is a character whose id is in skin.takes, and skin.chosen is the one in use.

change REQUIREDstringWhat changes (e.g. "golden armor and a red cape").
labelstringName of the skin.
takesintHow many takes to generate (1–6), each one charged.
raritystringcommon, rare, epic, legendary
POST /api/characters/{id}/skins/{skin}/takes

More takes for an existing skin ({takes}).

PATCH /api/characters/{id}/skins/{skin}

Choose the take in use: {"chosen": ""}. Animations are requested on the take (its id is a character id).

Views in other directions

POST /api/characters/{id}/views
directions REQUIREDstring[]E.g. ["S", "SE", "NE", "N"]. Mirrored sides come for free.
forceboolRedo views that already exist.
POST /api/characters/{id}/rotation

{"method": "video", "frames": 16} makes a smooth 360° turn (4–32 frames); "views" generates the static views.

Animations

Generate animations

POST /api/characters/{id}/animations

Returns a list of jobs, one per animation. The character must be ready.

keysstring[]Ready animations (table), e.g. ["idle", "walk", "attack"].
qualitystringstandard (default) or premium (best of 2 scored versions). (padrão) ou premium (melhor de 2 versões avaliadas; uma 3ª grátis se nenhuma chegar a 5).
directionsstring[]Default: the directions of the project's mode.
customobjectYour own animation: {label, prompt, loop, frames, fps}, where prompt describes the movement (English works best).
seedintTo repeat a result.
curl {{ORIGIN}}/api/characters/$CID/animations \
  -H "Authorization: Bearer $SG_KEY" -H "Content-Type: application/json" \
  -d '{"keys": ["idle", "run"], "quality": "standard",
       "custom": {"label": "victory dance", "prompt": "does a short happy dance, then returns to stance", "frames": 10, "fps": 12}}'
jobs = S.post(f'{API}/characters/{cid}/animations',
              json={'keys': ['idle', 'run'], 'quality': 'premium'}).json()
for job in jobs:
    wait(job)

Request a tweak

POST /api/characters/{id}/animations/{key}/revise

Redoes the animation with your request ({"instruction": "don't take the sword out"}, any language). The current version stays saved; charged like a new animation.

Frames of an animation

GET /api/characters/{id}/strip/{key}/{direction}.png

Horizontal strip with the final frames (cell size in cell of the character).

Effects (VFX)

Create an effect

POST /api/vfx
description REQUIREDstringWhat the effect looks like ("blue fireball with sparks").
motion REQUIREDstringHow it moves ("flies to the right and explodes").
projectstringProject id.
loopboolContinuous effect (aura, fire) instead of a single shot.
qualitystringstandard / premium
POST /api/vfx/{id}/variants

A new variation of the same effect ({quality, seed}).

GET /api/vfx/{id}/{variant}/strip.png?height=160

Frames side by side; the headers X-Frames and X-Frame-Width tell how to slice them.

Export

Zip for the engine

GET /api/characters/{id}/export.zip?formats=godot,atlas
GET /api/characters/{id}/skins/{skin}/export.zip?formats=…
GET /api/projects/{id}/export.zip?formats=…
GET /api/vfx/{id}/export.zip?key=&size=128&fps=14&pixel=false

formats is a comma-separated list (default: all). The project zip brings every character and monster with the chosen take of each skin.

FormatWhat comes
atlasAtlas PNG + JSON (TexturePacker / Phaser / PixiJS)
godotGodot 4 SpriteFrames (.tres)
unityUnity import script → Sprites + AnimationClips
gamemakerGameMaker strips (_stripN)
rpgmakerRPG Maker MV/MZ 3×4 walk sheet
stripsOne PNG strip per animation
gifAnimated GIFs
framesIndividual PNG frames
curl -o project.zip "{{ORIGIN}}/api/projects/$PROJECT/export.zip?formats=godot,unity" \
  -H "Authorization: Bearer $SG_KEY"

Atlas only

GET /api/characters/{id}/atlas.png
GET /api/characters/{id}/atlas.json

One row per animation and direction; the JSON follows the TexturePacker format, with the animations listed in animations.

Values tables

Ready animations (keys)

idle · walk · run · jump · attack · attack2 · punch · kick · shoot · cast · throw · block · hurt · death · crouch · dash · roll · climb · fall · victory · wave · spin · push · talk

Directions

ModeDirections
sideE, W
4dirS, E, N, W
8dirS, SE, E, NE, N, NW, W, SW

W, SW and NW are mirrors of E, SE and NE (no cost). The full and always up-to-date list is in GET /api/presets.