{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/masko-ai/json-schema/masko-ai-create-animation-body-schema.json",
  "title": "CreateAnimationBody",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/masko-ai-openapi.json#/components/schemas/CreateAnimationBody",
  "type": "object",
  "properties": {
    "source_image_asset_id": {
      "type": "string",
      "format": "uuid",
      "description": "Completed image to animate. For a new mascot, use an unattached image from POST /v1/upload."
    },
    "source_image_crop": {
      "type": "object",
      "properties": {
        "x": {
          "type": "integer",
          "minimum": 0
        },
        "y": {
          "type": "integer",
          "minimum": 0
        },
        "width": {
          "type": "integer",
          "minimum": 0,
          "exclusiveMinimum": true
        },
        "height": {
          "type": "integer",
          "minimum": 0,
          "exclusiveMinimum": true
        }
      },
      "required": [
        "x",
        "y",
        "width",
        "height"
      ],
      "description": "Square crop in pixels after EXIF orientation. Omit for a centered square crop. The original is preserved."
    },
    "mascot_id": {
      "type": "string",
      "format": "uuid",
      "description": "Save under this existing mascot. Reuse the ID returned by your first request."
    },
    "create_mascot": {
      "type": "object",
      "properties": {
        "project_id": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80,
          "description": "Optional mascot name. When omitted, AI chooses a short name from the image that no other mascot in the project uses. No character description is generated."
        },
        "cdn_enabled": {
          "type": "boolean",
          "description": "Public hosting for the new mascot. Defaults to true: every finished file gets a permanent public link on assets.masko.ai. false keeps the new mascot's files private until POST /v1/mascots/{id}/publish. Send false unless the user wants public links."
        }
      },
      "required": [
        "project_id"
      ],
      "additionalProperties": false,
      "description": "Explicitly create a new mascot in this project. Send this or mascot_id, never both."
    },
    "variant_id": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100,
      "default": "Animation",
      "description": "Animation action name, separate from the mascot name."
    },
    "animation_prompt": {
      "type": "string",
      "minLength": 1,
      "maxLength": 5000,
      "description": "One action in plain words, with how big, how fast and the mood, e.g. \"bounces on the spot with excitement, quick and springy\". Never write a return or timings: a loop comes back to its pose by itself. Set loop false for an action that ends somewhere else, such as falling asleep."
    },
    "animation_model": {
      "type": "string",
      "enum": [
        "standard"
      ],
      "default": "standard",
      "description": "Animation model, as in Studio: standard (2 credits/sec, 2–15 s). Default standard."
    },
    "duration": {
      "type": "integer",
      "minimum": 2,
      "maximum": 15,
      "description": "Whole seconds within the model's range, default 5. An additional image costs 1 credit only when a source image must be generated.",
      "default": 5
    },
    "loop": {
      "type": "boolean",
      "default": true
    },
    "sound": {
      "type": "boolean",
      "description": "Make the animation with sound, at the same price: one of the mascot's own sounds when one fits the prompt (or the one it names), timed to the motion, else a sound the video model makes, unless the mascot only uses its own sounds. Needs the standard model and 5 to 15 seconds. The receipt's sound says which, and why."
    }
  },
  "required": [
    "source_image_asset_id",
    "animation_prompt"
  ],
  "additionalProperties": false
}