{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/api-stock-com/json-schema/api-stock-com-generation-dto-schema.json",
  "title": "GenerationDto",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/api-stock-com-openapi.json#/components/schemas/GenerationDto",
  "type": "object",
  "properties": {
    "taskId": {
      "type": "string",
      "description": "Unique task identifier of generation"
    },
    "model": {
      "type": [
        "string",
        "null"
      ],
      "description": "Generation model",
      "enum": [
        "veo3.1-fast",
        "veo3.1-quality",
        "veo3.1-lite",
        "nano-banana",
        "nano-banana-pro",
        "nano-banana-2",
        "nano-banana-2.1",
        "nano-banana-2-lite",
        "grok-imagine-1.5-video",
        "grok-imagine-1.5-image",
        "grok-imagine-2.0-image",
        "seedance-2.0",
        "seedance-2.0-fast",
        "seedance-2.0-mini",
        "seedance-2.5",
        "seedance-2.5-spicy",
        "seedance-1-5-pro",
        "gpt-image-2",
        "gpt-image-2.5-sunburst",
        "gpt-image-2.5-flare",
        "kling-3.0-motion-control",
        "kling-3.0",
        "kling-4.0",
        "pixverse-v6",
        "seedream-5-0-lite",
        "seedream-5-0-flash",
        "seedream-5-0-pro",
        "seedream-4-5",
        "wan2.7-video",
        "wan3.0-video",
        "wan3.0-video-prime",
        "wan3.0-video-pro",
        "flux-3-video",
        "flux-3-image",
        "gemini-omni-1.1-flash",
        "minimax-h3",
        "agnes-video-2.5",
        "z-image",
        "wan2.7-image",
        "wan2.7-image-pro",
        "midjourney",
        "midjourney-video",
        "suno"
      ]
    },
    "input": {
      "type": [
        "string",
        "null"
      ],
      "description": "Generation input parameters"
    },
    "files": {
      "description": "Generated media files (populated when generation is completed)",
      "type": "array",
      "items": {
        "$ref": "#/$defs/MediaFileDto"
      }
    },
    "output": {
      "type": [
        "object",
        "null"
      ],
      "description": "Structured provider result stored next to the files (populated when generation is finished). For Suno music: `tracks` with per-track title, duration, lyrics, tags and cover image URLs, in the order of `files`."
    },
    "status": {
      "type": "string",
      "description": "Current generation status",
      "enum": [
        "not_started",
        "processing",
        "finished",
        "failed",
        "expired"
      ]
    },
    "error": {
      "type": [
        "string",
        "null"
      ],
      "description": "Error information during generation"
    },
    "errorCode": {
      "type": [
        "string",
        "null"
      ],
      "description": "API Stock failure code for localizing the error message"
    },
    "createdAt": {
      "format": "date-time",
      "type": "string",
      "description": "Generation creation time"
    },
    "completedAt": {
      "format": "date-time",
      "type": "string",
      "description": "Generation completion time"
    },
    "duration": {
      "type": "number",
      "description": "Generation duration time in ms"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "Generation cost in integer USD cents",
      "format": "int32"
    },
    "webhook": {
      "type": [
        "string",
        "null"
      ],
      "description": "Callback URL the result was delivered to, as passed on creation. Null when the generation was created without one."
    }
  },
  "required": [
    "taskId",
    "model",
    "input",
    "status",
    "createdAt",
    "completedAt",
    "duration",
    "cost"
  ],
  "$defs": {
    "MediaFileDto": {
      "type": "object",
      "properties": {
        "fileUrl": {
          "type": "string",
          "description": "Direct URL to the generated file (retained for 3 days)"
        },
        "fileType": {
          "type": "string",
          "description": "Type of media file: 'image', 'video' or 'music'",
          "enum": [
            "image",
            "video",
            "music"
          ]
        }
      },
      "required": [
        "fileUrl",
        "fileType"
      ]
    }
  }
}