{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/spritecook-ai/json-schema/spritecook-ai-api-animate-request-schema.json",
  "title": "ApiAnimateRequest",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/spritecook-ai-openapi.json#/components/schemas/ApiAnimateRequest",
  "properties": {
    "image": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Image",
      "description": "Deprecated inline image field. Animate now requires a SpriteCook asset_id."
    },
    "asset_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Asset Id",
      "description": "Existing SpriteCook asset ID to animate. The asset must belong to the authenticated user."
    },
    "prompt": {
      "type": "string",
      "maxLength": 3000,
      "minLength": 1,
      "title": "Prompt",
      "description": "Describe the desired animation"
    },
    "auto_enhance_prompt": {
      "type": "boolean",
      "title": "Auto Enhance Prompt",
      "description": "When true, SpriteCook inspects the source asset and expands short prompts like 'Idle' into a fuller animation prompt.",
      "default": true
    },
    "edge_margin": {
      "type": "integer",
      "maximum": 25.0,
      "minimum": 0.0,
      "title": "Edge Margin",
      "description": "Spacing added before animation as a percentage of the trimmed source size. The subject stands on the bottom edge as a ground line, so the margin goes on the sides and top; set vertical_align='center' to also add room below.",
      "default": 6
    },
    "vertical_align": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "bottom",
            "center"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Vertical Align",
      "description": "Pixel art only. Omit to keep the ground line (bottom). 'center' centers the subject so edge_margin applies on all sides, for flying, floating or bouncing subjects."
    },
    "pixel": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pixel",
      "description": "Animation mode override. If asset_id is provided and pixel is omitted, mode is inferred from the asset."
    },
    "model": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "pixel-engine-v1.1",
            "frame-engine-v1.1",
            "pixel-engine-v1.5"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Model",
      "description": "Animation model: pixel-engine-v1.1, frame-engine-v1.1, pixel-engine-v1.5. Omit to use pixel-engine-v1.1 for pixel art or frame-engine-v1.1 for detailed art."
    },
    "output_frames": {
      "type": "integer",
      "maximum": 24.0,
      "minimum": 2.0,
      "title": "Output Frames",
      "description": "Output frame count. Frame count rules by model: pixel-engine-v1.1: pixel 2 to 16 (even counts); frame-engine-v1.1: detailed 2 to 24 (even counts); pixel-engine-v1.5: pixel 3 to 16 (any whole number), detailed 3 to 16 (any whole number). When model is omitted, pixel defaults to pixel-engine-v1.1, detailed defaults to frame-engine-v1.1.",
      "default": 8
    },
    "output_format": {
      "type": "string",
      "enum": [
        "webp",
        "gif",
        "spritesheet"
      ],
      "title": "Output Format",
      "description": "Provider output format",
      "default": "webp"
    },
    "negative_prompt": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 1000
        },
        {
          "type": "null"
        }
      ],
      "title": "Negative Prompt",
      "description": "Optional negative prompt",
      "default": ""
    },
    "outline_repair": {
      "type": "boolean",
      "title": "Outline Repair",
      "description": "Repair pixel art outlines after background removal: restores clipped outline pixels and removes background fringe (only applies to pixel art with a transparent background)",
      "default": true
    },
    "matte_color": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Matte Color",
      "description": "Hex matte color used to flatten alpha before processing",
      "default": "#808080"
    },
    "removebg": {
      "type": "string",
      "title": "Removebg",
      "description": "Background removal mode: None, Basic, or Pro",
      "default": "Basic"
    },
    "colors": {
      "type": "integer",
      "maximum": 256.0,
      "minimum": 2.0,
      "title": "Colors",
      "description": "Pixel palette size. Only valid when pixel=true",
      "default": 24
    },
    "use_random_seed": {
      "type": "boolean",
      "title": "Use Random Seed",
      "description": "When true, the server generates a fresh random seed for this animation.",
      "default": true
    },
    "seed": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Seed",
      "description": "Custom reproducibility seed. Required when use_random_seed is false."
    },
    "runpod_alpha_threshold_enabled": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Runpod Alpha Threshold Enabled",
      "description": "Alpha threshold toggle for Basic background removal during cleanup. Defaults to true for the public API. When false, runpod_alpha_cutoff is ignored."
    },
    "runpod_alpha_cutoff": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 255.0,
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Runpod Alpha Cutoff",
      "description": "Binary alpha cutoff for Basic background removal during cleanup. Defaults to 96 for the public API when runpod_alpha_threshold_enabled is true."
    }
  },
  "type": "object",
  "required": [
    "prompt"
  ]
}