Every API here is available over the APIs.io API and to AI agents over MCP.
openapi: 3.2.0
info:
title: Sprixen Animations API
description: Sprixen AI Game Asset Generator, REST API & MCP Server
version: '1.0'
contact: {}
servers:
- url: https://api.sprixen.com
description: Production
- url: http://localhost:8080
description: Local Development
tags:
- name: Animations
paths:
/v1/sprites/{spriteId}/animations:
post:
operationId: AnimationController_createAnimation
summary: Generate animation for a sprite (async)
description: Queues an async animation generation job. Poll GET /sprites/:spriteId/animations for results.
parameters:
- name: spriteId
required: true
in: path
description: Sprite ID
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateAnimationDto'
responses:
'202':
description: Animation generation queued
'403':
description: Access denied
'404':
description: Sprite not found
tags:
- Animations
security:
- bearer: []
get:
operationId: AnimationController_findBySprite
summary: List animations for a sprite
parameters:
- name: spriteId
required: true
in: path
description: Sprite ID
schema:
type: string
responses:
'200':
description: Animations list returned
'403':
description: Access denied
tags:
- Animations
security:
- bearer: []
/v1/sprites/{spriteId}/animations/batch:
post:
operationId: AnimationController_createAnimationBatch
summary: Generate multiple animation takes for a sprite (async)
description: Queues 1-3 independent animation generation jobs for the same sprite. Poll GET /sprites/:spriteId/animations for results.
parameters:
- name: spriteId
required: true
in: path
description: Sprite ID
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateAnimationBatchDto'
responses:
'202':
description: Animation batch queued
'403':
description: Access denied
'404':
description: Sprite not found
tags:
- Animations
security:
- bearer: []
/v1/animations:
post:
operationId: AnimationController_createAnimationFromBody
summary: Generate animation for a sprite (spriteId in body)
description: Queues an async animation generation job. spriteId is passed in the request body.
parameters: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateAnimationWithSpriteDto'
responses:
'202':
description: Animation generation queued
'403':
description: Access denied
'404':
description: Sprite not found
tags:
- Animations
security:
- bearer: []
/v1/animations/{id}:
get:
operationId: AnimationController_findOne
summary: Get animation by ID
parameters:
- name: id
required: true
in: path
description: Animation ID
schema:
type: string
responses:
'200':
description: Animation returned
'403':
description: Access denied
tags:
- Animations
security:
- bearer: []
delete:
operationId: AnimationController_remove
summary: Delete animation
parameters:
- name: id
required: true
in: path
description: Animation ID
schema:
type: string
responses:
'204':
description: Animation deleted
tags:
- Animations
security:
- bearer: []
/v1/animations/{id}/gif:
get:
operationId: AnimationController_downloadGif
summary: Download animation as animated GIF
parameters:
- name: id
required: true
in: path
description: Animation ID
schema:
type: string
responses:
'200':
description: Animated GIF file
'403':
description: Access denied
'404':
description: Animation not found
tags:
- Animations
security:
- bearer: []
/v1/animations/{id}/frames/{frameIndex}/upload:
post:
operationId: AnimationController_replaceFrame
summary: Replace a single animation frame
parameters:
- name: id
required: true
in: path
description: Animation ID
schema:
type: string
- name: frameIndex
required: true
in: path
description: Frame index (0-based)
schema:
type: number
responses:
'200':
description: Frame replaced and spritesheet re-stitched
tags:
- Animations
security:
- bearer: []
/v1/animations/{id}/process:
post:
operationId: AnimationController_processAnimation
summary: Create a processed copy of a 2D animation
parameters:
- name: id
required: true
in: path
description: Animation ID
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ProcessAnimationDto'
responses:
'201':
description: Processed animation created
tags:
- Animations
security:
- bearer: []
/v1/sprites/{spriteId}/movesets:
post:
operationId: MovesetController_create
summary: Create a character moveset in one call (poses and moves of one sprite)
description: 'One-shot: from one base sprite, generates the poses (relaxed and victory, 2 credits each) and the moves a game character needs, charged once and built in parallel. Default set: idle (relaxed, from the relaxed pose), combat_idle, walk, run, combo_1..3 (they start and end in the base sprite pose, so they chain), hurt, death on standard; jump and flourish on premium (locked camera video). Standard moves cost 4 credits, +2 with 16 frames (default for idle, combat idle, combo hits and hurt) or +3 with 24; premium 8. The default set is 66 credits. Send dryRun=true for the plan and total without charging, and maxCredits to cap it. Poll GET /movesets/:id; download the ZIP once items are ready.'
parameters:
- name: spriteId
required: true
in: path
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateMovesetDto'
responses:
'402':
description: Insufficient credits for the whole moveset
tags:
- Animations
security:
- bearer: []
get:
operationId: MovesetController_list
summary: List a sprite's movesets with live item status
parameters:
- name: spriteId
required: true
in: path
schema:
type: string
responses:
'200':
description: ''
tags:
- Animations
security:
- bearer: []
/v1/movesets/{movesetId}:
get:
operationId: MovesetController_get
summary: 'One character moveset: every pose and move with status, sheet URL, frames and…'
description: 'Status per item: pending, processing, waiting_pose (a move animated from a pose that is still generating), completed or failed. Failed items are refunded.'
parameters:
- name: movesetId
required: true
in: path
schema:
type: string
responses:
'200':
description: ''
tags:
- Animations
security:
- bearer: []
/v1/movesets/{movesetId}/moves/{key}/redo:
post:
operationId: MovesetController_redo
summary: Redo one move of a moveset at its own price
description: Generates the move again with the same settings (quality, frames, description, pose); the new take replaces it in the moveset view and the ZIP. Refused while that move is still generating.
parameters:
- name: movesetId
required: true
in: path
schema:
type: string
- name: key
required: true
in: path
schema:
type: string
responses:
'201':
description: ''
tags:
- Animations
security:
- bearer: []
/v1/movesets/{movesetId}/download:
get:
operationId: MovesetController_download
summary: Download a character moveset as a ZIP
description: sheets/.png (one horizontal strip per move), poses/.png, sprite.png and moveset.json (frame size, count, fps, loop per move).
parameters:
- name: movesetId
required: true
in: path
schema:
type: string
responses:
'200':
description: ''
tags:
- Animations
security:
- bearer: []
components:
schemas:
ProcessAnimationDto:
type: object
properties:
mode:
type: string
default: aggressive
enum:
- stabilize
- tight
- aggressive
description: Non-destructive post-process mode. stabilize recenters/bottom-aligns frames without scaling. tight and aggressive crop alpha content and scale it back onto the same frame canvas.
CreateAnimationDto:
type: object
properties:
type:
type: string
example: idle
enum:
- idle
- walk
- run
- attack
- jump
- death
- hurt
- custom
description: Animation type
frameCount:
type: number
example: 4
description: 'Number of frames (defaults per type: idle=4, walk=6, run=6, attack=4)'
smoothFrames:
type: number
enum:
- 16
- 24
example: 16
description: 'Standard quality only. Draws in-between frames on top of the 8 generated key frames: 16 (+2 credits) or 24 (+3 credits) frames for the same motion, played at 2x or 3x the fps. Optical flow fills the pairs that change little; pairs where the pose changes a lot are drawn by the image model from both neighbours. Not available with premium, which already renders up to 96 frames.'
quality:
type: string
example: standard
enum:
- standard
- premium
description: Generation quality mode. standard creates a compact sprite sheet with Gemini image generation. premium uses image-to-video (Gemini Omni Flash) and converts all video frames into a transparent sprite animation.
fps:
type: number
example: 12
description: Frames per second (default 12)
customDescription:
type: string
example: A warrior swinging a sword in a wide arc
description: Optional motion guidance for the animation. Max 500 characters.
archetype:
type: string
example: humanoid_biped
enum:
- humanoid_biped
- quadruped
- winged
- amorphous
- serpentine
description: 'Character body archetype. If provided, the backend uses it directly (no inference). If omitted, the backend uses sprite metadata if cached, otherwise runs a vision-based classifier. Values: humanoid_biped (two-legged upright), quadruped (four-legged), winged (flying), amorphous (slime/blob), serpentine (snake-like).'
weaponHand:
type: string
example: right
enum:
- left
- right
- both
description: Which hand holds the weapon. If provided, the prompt enforces weapon-hand consistency across frames. Omit if the character has no weapon.
weaponType:
type: string
example: axe
description: Optional weapon type label (sword/axe/bow/staff/etc). Included in the prompt for better consistency.
hasShield:
type: boolean
description: True if the character carries a shield. The prompt enforces shield position consistency.
locomotionType:
type: string
example: auto
enum:
- auto
- biped
- quadruped
deprecated: true
description: 'DEPRECATED: use `archetype` instead. Legacy field — only maps to humanoid_biped or quadruped.'
direction:
type: string
example: right
enum:
- right
- left
- up
- down
- up-right
- up-left
- down-right
- down-left
description: 'Facing direction of the character. Cardinal: "right", "left", "up", "down". Diagonal: "up-right", "up-left", "down-right", "down-left" (isometric 45-degree angles).'
normalizeSize:
type: boolean
default: true
description: 'Scales the animation so the character matches the base sprite height (measured on the first frame, capped so every frame fits the canvas). On by default: without it the generated frames arrive about 30% larger than the sprite. Pass false to keep the raw framing.'
resolution:
type: string
example: 28x32
description: 'Override resolution for this animation (e.g. "28x32"). Each frame in the spritesheet will be sized to this. If omitted, falls back to the project resolution. Use this when the base sprite was generated with a resolution override (CreateGenerationDto.resolution) and the animation needs to match that style/scale instead of the broader project default. Format: "WIDTHxHEIGHT" with each side between 8 and 4096, e.g. "256x256" or "28x32".'
idlePreset:
type: string
example: lively
enum:
- breath
- lively
- looking
- item
description: Pre-baked idle style. Only honored when type="idle". The backend translates the chosen preset into a `customDescription` internally — pick a preset for one-click flavor, or pass `customDescription` for full control. If both are set, customDescription wins.
required:
- type
CreateAnimationWithSpriteDto:
type: object
properties:
type:
type: string
example: idle
enum:
- idle
- walk
- run
- attack
- jump
- death
- hurt
- custom
description: Animation type
frameCount:
type: number
example: 4
description: 'Number of frames (defaults per type: idle=4, walk=6, run=6, attack=4)'
smoothFrames:
type: number
enum:
- 16
- 24
example: 16
description: 'Standard quality only. Draws in-between frames on top of the 8 generated key frames: 16 (+2 credits) or 24 (+3 credits) frames for the same motion, played at 2x or 3x the fps. Optical flow fills the pairs that change little; pairs where the pose changes a lot are drawn by the image model from both neighbours. Not available with premium, which already renders up to 96 frames.'
quality:
type: string
example: standard
enum:
- standard
- premium
description: Generation quality mode. standard creates a compact sprite sheet with Gemini image generation. premium uses image-to-video (Gemini Omni Flash) and converts all video frames into a transparent sprite animation.
fps:
type: number
example: 12
description: Frames per second (default 12)
customDescription:
type: string
example: A warrior swinging a sword in a wide arc
description: Optional motion guidance for the animation. Max 500 characters.
archetype:
type: string
example: humanoid_biped
enum:
- humanoid_biped
- quadruped
- winged
- amorphous
- serpentine
description: 'Character body archetype. If provided, the backend uses it directly (no inference). If omitted, the backend uses sprite metadata if cached, otherwise runs a vision-based classifier. Values: humanoid_biped (two-legged upright), quadruped (four-legged), winged (flying), amorphous (slime/blob), serpentine (snake-like).'
weaponHand:
type: string
example: right
enum:
- left
- right
- both
description: Which hand holds the weapon. If provided, the prompt enforces weapon-hand consistency across frames. Omit if the character has no weapon.
weaponType:
type: string
example: axe
description: Optional weapon type label (sword/axe/bow/staff/etc). Included in the prompt for better consistency.
hasShield:
type: boolean
description: True if the character carries a shield. The prompt enforces shield position consistency.
locomotionType:
type: string
example: auto
enum:
- auto
- biped
- quadruped
deprecated: true
description: 'DEPRECATED: use `archetype` instead. Legacy field — only maps to humanoid_biped or quadruped.'
direction:
type: string
example: right
enum:
- right
- left
- up
- down
- up-right
- up-left
- down-right
- down-left
description: 'Facing direction of the character. Cardinal: "right", "left", "up", "down". Diagonal: "up-right", "up-left", "down-right", "down-left" (isometric 45-degree angles).'
normalizeSize:
type: boolean
default: true
description: 'Scales the animation so the character matches the base sprite height (measured on the first frame, capped so every frame fits the canvas). On by default: without it the generated frames arrive about 30% larger than the sprite. Pass false to keep the raw framing.'
resolution:
type: string
example: 28x32
description: 'Override resolution for this animation (e.g. "28x32"). Each frame in the spritesheet will be sized to this. If omitted, falls back to the project resolution. Use this when the base sprite was generated with a resolution override (CreateGenerationDto.resolution) and the animation needs to match that style/scale instead of the broader project default. Format: "WIDTHxHEIGHT" with each side between 8 and 4096, e.g. "256x256" or "28x32".'
idlePreset:
type: string
example: lively
enum:
- breath
- lively
- looking
- item
description: Pre-baked idle style. Only honored when type="idle". The backend translates the chosen preset into a `customDescription` internally — pick a preset for one-click flavor, or pass `customDescription` for full control. If both are set, customDescription wins.
spriteId:
type: string
example: sprite_abc123
description: ID of the sprite to animate
required:
- type
- spriteId
CreateMovesetDto:
type: object
properties:
moves:
type: array
description: 'Moves to animate. Omit for the default set: idle (relaxed), combat_idle, walk, run, combo_1, combo_2, combo_3, hurt, death, jump, flourish. Also available: dodge, special, victory. Send [] for a poses-only set. Every combat move starts and ends in the base sprite pose, so combo_1..3 chain.'
items:
type: string
enum:
- idle
- combat_idle
- walk
- run
- combo_1
- combo_2
- combo_3
- hurt
- death
- jump
- flourish
- dodge
- special
- victory
poses:
type: array
description: 'Static poses generated from the base sprite (2 credits each): pose_relaxed (default; the relaxed idle is animated from it) and pose_victory. Send [] for none; without pose_relaxed the idle is animated from the base sprite.'
items:
type: string
enum:
- pose_relaxed
- pose_victory
premium:
type: array
description: 'Moves to render on premium (8 credits, video with a locked camera, up to 96 frames, about 30 minutes). Default: jump, flourish, special, victory.'
items:
type: string
enum:
- idle
- combat_idle
- walk
- run
- combo_1
- combo_2
- combo_3
- hurt
- death
- jump
- flourish
- dodge
- special
- victory
standard:
type: array
description: Moves forced to standard (4 credits, 8 key frames plus in-betweens), e.g. to keep the whole set cheaper.
items:
type: string
enum:
- idle
- combat_idle
- walk
- run
- combo_1
- combo_2
- combo_3
- hurt
- death
- jump
- flourish
- dodge
- special
- victory
frames:
type: number
enum:
- 8
- 16
- 24
default: 16
description: 'Frames for the standard moves that use in-betweens (idle, combat idle, combo hits, hurt, dodge): 16 (+2 credits each, default), 24 (+3) or 8 (none). Walk, run and death stay at 8.'
descriptions:
type: object
additionalProperties:
type: string
example:
combo_1: A fast spear thrust forward
flourish: Spins the staff over the head
description: Motion text per move key, replacing the default description (max 500 characters each). Keep "starts and ends in the guard" for combo hits.
archetype:
type: string
enum:
- humanoid_biped
- quadruped
- winged
- amorphous
- serpentine
description: Body archetype for every move; inferred from the sprite when omitted.
weaponHand:
type: string
enum:
- left
- right
- both
description: Hand that holds the weapon, kept in every move.
weaponType:
type: string
example: longsword
description: Weapon label (sword, spear, staff, bow...), improves consistency across moves.
hasShield:
type: boolean
description: True if the character carries a shield.
direction:
type: string
enum:
- right
- left
- up
- down
- up-right
- up-left
- down-right
- down-left
description: Facing direction of every move; the sprite as drawn when omitted.
maxCredits:
type: number
example: 60
description: Refuse the moveset when its total passes this many credits. Always send it when an agent builds on its own.
dryRun:
type: boolean
default: false
description: Return the plan and total credits without charging or generating anything.
CreateAnimationBatchDto:
type: object
properties:
type:
type: string
example: idle
enum:
- idle
- walk
- run
- attack
- jump
- death
- hurt
- custom
description: Animation type
frameCount:
type: number
example: 4
description: 'Number of frames (defaults per type: idle=4, walk=6, run=6, attack=4)'
smoothFrames:
type: number
enum:
- 16
- 24
example: 16
description: 'Standard quality only. Draws in-between frames on top of the 8 generated key frames: 16 (+2 credits) or 24 (+3 credits) frames for the same motion, played at 2x or 3x the fps. Optical flow fills the pairs that change little; pairs where the pose changes a lot are drawn by the image model from both neighbours. Not available with premium, which already renders up to 96 frames.'
quality:
type: string
example: standard
enum:
- standard
- premium
description: Generation quality mode. standard creates a compact sprite sheet with Gemini image generation. premium uses image-to-video (Gemini Omni Flash) and converts all video frames into a transparent sprite animation.
fps:
type: number
example: 12
description: Frames per second (default 12)
customDescription:
type: string
example: A warrior swinging a sword in a wide arc
description: Optional motion guidance for the animation. Max 500 characters.
archetype:
type: string
example: humanoid_biped
enum:
- humanoid_biped
- quadruped
- winged
- amorphous
- serpentine
description: 'Character body archetype. If provided, the backend uses it directly (no inference). If omitted, the backend uses sprite metadata if cached, otherwise runs a vision-based classifier. Values: humanoid_biped (two-legged upright), quadruped (four-legged), winged (flying), amorphous (slime/blob), serpentine (snake-like).'
weaponHand:
type: string
example: right
enum:
- left
- right
- both
description: Which hand holds the weapon. If provided, the prompt enforces weapon-hand consistency across frames. Omit if the character has no weapon.
weaponType:
type: string
example: axe
description: Optional weapon type label (sword/axe/bow/staff/etc). Included in the prompt for better consistency.
hasShield:
type: boolean
description: True if the character carries a shield. The prompt enforces shield position consistency.
locomotionType:
type: string
example: auto
enum:
- auto
- biped
- quadruped
deprecated: true
description: 'DEPRECATED: use `archetype` instead. Legacy field — only maps to humanoid_biped or quadruped.'
direction:
type: string
example: right
enum:
- right
- left
- up
- down
- up-right
- up-left
- down-right
- down-left
description: 'Facing direction of the character. Cardinal: "right", "left", "up", "down". Diagonal: "up-right", "up-left", "down-right", "down-left" (isometric 45-degree angles).'
normalizeSize:
type: boolean
default: true
description: 'Scales the animation so the character matches the base sprite height (measured on the first frame, capped so every frame fits the canvas). On by default: without it the generated frames arrive about 30% larger than the sprite. Pass false to keep the raw framing.'
resolution:
type: string
example: 28x32
description: 'Override resolution for this animation (e.g. "28x32"). Each frame in the spritesheet will be sized to this. If omitted, falls back to the project resolution. Use this when the base sprite was generated with a resolution override (CreateGenerationDto.resolution) and the animation needs to match that style/scale instead of the broader project default. Format: "WIDTHxHEIGHT" with each side between 8 and 4096, e.g. "256x256" or "28x32".'
idlePreset:
type: string
example: lively
enum:
- breath
- lively
- looking
- item
description: Pre-baked idle style. Only honored when type="idle". The backend translates the chosen preset into a `customDescription` internally — pick a preset for one-click flavor, or pass `customDescription` for full control. If both are set, customDescription wins.
outputCount:
type: number
example: 3
description: Number of independent animation takes to generate for the same sprite (1-3). Each standard output costs 4 credits and is saved as a separate Animation record. Premium animation is limited to 1 output.
minimum: 1
maximum: 3
default: 1
required:
- type
securitySchemes:
api-key:
scheme: bearer
bearerFormat: JWT
type: http
description: Sprixen API key (spx_live_...)
name: Authorization
in: header
cookie:
type: apiKey
in: cookie
name: sprixen_session