{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sprixen-com/json-schema/sprixen-com-create-animation-dto-schema.json",
  "title": "CreateAnimationDto",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sprixen-com-openapi.json#/components/schemas/CreateAnimationDto",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "idle",
        "walk",
        "run",
        "attack",
        "jump",
        "death",
        "hurt",
        "custom"
      ],
      "description": "Animation type"
    },
    "frameCount": {
      "type": "number",
      "description": "Number of frames (defaults per type: idle=4, walk=6, run=6, attack=4)"
    },
    "smoothFrames": {
      "type": "number",
      "enum": [
        16,
        24
      ],
      "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",
      "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",
      "description": "Frames per second (default 12)"
    },
    "customDescription": {
      "type": "string",
      "description": "Optional motion guidance for the animation. Max 500 characters."
    },
    "archetype": {
      "type": "string",
      "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",
      "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",
      "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",
      "enum": [
        "auto",
        "biped",
        "quadruped"
      ],
      "deprecated": true,
      "description": "DEPRECATED: use `archetype` instead. Legacy field — only maps to humanoid_biped or quadruped."
    },
    "direction": {
      "type": "string",
      "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",
      "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",
      "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"
  ]
}