Sprite Generator API
Everything the app does is a JSON call. This page covers the endpoints for creating, animating and exporting assets.
- Base URL:
{{ORIGIN}}/api - Format: JSON in the body (
Content-Type: application/json) and in the response. Images come as PNG, exports as ZIP. - Ids: projects, characters and jobs have text ids (e.g.
3f9a1c2b7d10). Every asset (character, monster, item, UI, scene, tileset, effect) is a character with akindfield.
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
- The API is available on the Pro and Studio plans. On other plans the key returns
403. - The key is shown in full only when it is created; afterwards you only see the last 4 characters and when it was last used.
- Up to 10 keys per account. Delete one and it stops working immediately.
- Account management (password, keys) only works logged in through the browser, never with a key.
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
}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.
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.
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.
| Code | When |
|---|---|
400 | Invalid field (unknown animation, empty description, invalid quality…). |
401 | Missing, invalid or deleted key. |
402 | Not enough credits for this request. |
403 | Your plan doesn't include the API, or the endpoint only works through the browser. |
404 | It doesn't exist or doesn't belong to you (other accounts' items are invisible). |
409 | The character is not ready yet (wait for the creation job). |
Credits and limits
- Each request is charged when it enters the queue, with the same values as the app (see the pricing table). If you don't have the balance, the response is
402and nothing is queued. - Animations are charged per generated direction; mirrored directions are free.
- If Turbo is on in your account, it also applies to API requests (they skip the queue and cost 1.5×).
- You can queue as many requests as your balance allows; how many run at the same time depends on the plan.
Account
Who am I and my balance
{ "email": "[email protected]", "plan": "pro", "plan_label": "Pro", "credits": 3420,
"turbo": false, "slots": 1, "api": true, "costs": { … }, "plans": { … } }Credit statement
Balance and the latest 50 entries (delta, reason, job_id, at).
Plans and costs (no key)
Plans, credits per request and the Turbo multiplier. Useful to show the cost before requesting.
Presets (no key)
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
| name REQUIRED | string | Project name. |
| description | string | What the game is about (optional). |
| settings | object | Style kit (see below). |
Change the style kit
Send only what changes; the other keys are kept.
| settings.target_height | int | Character height in pixels (8–1024). |
| settings.pixel | bool | Pixel art: reduces to the height and snaps to the pixel grid. |
| settings.palette_source | string | character, project, pico8, sweetie16 |
| settings.palette_colors | int | Maximum number of colors. |
| settings.outline | bool | Dark outline around the character. |
| settings.camera | string | Camera angle (keys in /api/presets → cameras). |
| settings.direction_mode | string | side (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
Creates a character, monster, item, UI element, scene or tileset. Returns {character, job, candidates}.
| description REQUIRED | string | What you want, in any language. |
| project REQUIRED | string | Project id. |
| kind | string | character (default), monster, item, ui, scene, tileset |
| style | string | pixel, cartoon, anime, chibi, painted, vector, dark, none |
| name | string | Display name (default: the start of the description). |
| count | int | How 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. |
| references | string[] | Up to 3 character ids to follow the style of. |
| seed | int | Starting number, to repeat a result. |
| ui_type | string | For kind: ui: button, bar, panel, slot, icon, badge. |
| scene_format | string | For kind: scene: wide, panorama, square. With seamless (bool) to loop the edges. |
| terrain_b | string | For kind: tileset (required): the second terrain. tile_mode: topdown or side; tile_size: 8–128. |
| from_character | string | For 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
| file REQUIRED | image | PNG/JPG/WebP of the character (the background is removed). |
| project REQUIRED | string | Project id. |
| name, description | string | Name and what it is (helps the animations). |
| style | string | pixel 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
Main fields: status (pending → ready), kind, name, settings, animations, available (ready animation → directions), cell (frame size and pivot) and jobs (the ones still running).
All your characters and assets.
Character image
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
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 REQUIRED | string | What changes (e.g. "golden armor and a red cape"). |
| label | string | Name of the skin. |
| takes | int | How many takes to generate (1–6), each one charged. |
| rarity | string | common, rare, epic, legendary |
More takes for an existing skin ({takes}).
Choose the take in use: {"chosen": ". Animations are requested on the take (its id is a character id).
Views in other directions
| directions REQUIRED | string[] | E.g. ["S", "SE", "NE", "N"]. Mirrored sides come for free. |
| force | bool | Redo views that already exist. |
{"method": "video", "frames": 16} makes a smooth 360° turn (4–32 frames); "views" generates the static views.
Animations
Generate animations
Returns a list of jobs, one per animation. The character must be ready.
| keys | string[] | Ready animations (table), e.g. ["idle", "walk", "attack"]. |
| quality | string | standard (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). |
| directions | string[] | Default: the directions of the project's mode. |
| custom | object | Your own animation: {label, prompt, loop, frames, fps}, where prompt describes the movement (English works best). |
| seed | int | To 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
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
Horizontal strip with the final frames (cell size in cell of the character).
Effects (VFX)
Create an effect
| description REQUIRED | string | What the effect looks like ("blue fireball with sparks"). |
| motion REQUIRED | string | How it moves ("flies to the right and explodes"). |
| project | string | Project id. |
| loop | bool | Continuous effect (aura, fire) instead of a single shot. |
| quality | string | standard / premium |
A new variation of the same effect ({quality, seed}).
Frames side by side; the headers X-Frames and X-Frame-Width tell how to slice them.
Export
Zip for the engine
formats is a comma-separated list (default: all). The project zip brings every character and monster with the chosen take of each skin.
| Format | What comes |
|---|---|
atlas | Atlas PNG + JSON (TexturePacker / Phaser / PixiJS) |
godot | Godot 4 SpriteFrames (.tres) |
unity | Unity import script → Sprites + AnimationClips |
gamemaker | GameMaker strips (_stripN) |
rpgmaker | RPG Maker MV/MZ 3×4 walk sheet |
strips | One PNG strip per animation |
gif | Animated GIFs |
frames | Individual PNG frames |
curl -o project.zip "{{ORIGIN}}/api/projects/$PROJECT/export.zip?formats=godot,unity" \
-H "Authorization: Bearer $SG_KEY"Atlas only
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
| Mode | Directions |
|---|---|
side | E, W |
4dir | S, E, N, W |
8dir | S, 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.