{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/apihubs-ru/json-schema/apihubs-ru-generation-dto-schema.json",
  "title": "GenerationDto",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/apihubs-ru-openapi.json#/components/schemas/GenerationDto",
  "type": "object",
  "properties": {
    "taskId": {
      "type": "string",
      "description": "Уникальный идентификатор задачи генерации"
    },
    "model": {
      "type": [
        "string",
        "null"
      ],
      "description": "Модель генерации",
      "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": "Входные параметры генерации"
    },
    "files": {
      "description": "Сгенерированные медиафайлы (заполняются после завершения генерации)",
      "type": "array",
      "items": {
        "$ref": "#/$defs/MediaFileDto"
      }
    },
    "output": {
      "type": [
        "object",
        "null"
      ],
      "description": "Структурированный результат провайдера, сохранённый вместе с файлами (заполняется после завершения генерации). Для музыки Suno: `tracks` с названием, длительностью, текстом песни, тегами и URL обложки каждого трека в порядке `files`."
    },
    "status": {
      "type": "string",
      "description": "Текущий статус генерации",
      "enum": [
        "not_started",
        "processing",
        "finished",
        "failed",
        "expired"
      ]
    },
    "error": {
      "type": [
        "string",
        "null"
      ],
      "description": "Информация об ошибке генерации"
    },
    "errorCode": {
      "type": [
        "string",
        "null"
      ],
      "description": "Код ошибки API Hubs для перевода сообщения об ошибке на язык интерфейса"
    },
    "createdAt": {
      "format": "date-time",
      "type": "string",
      "description": "Время создания генерации"
    },
    "completedAt": {
      "format": "date-time",
      "type": "string",
      "description": "Время завершения генерации"
    },
    "duration": {
      "type": "number",
      "description": "Длительность генерации в миллисекундах"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "Стоимость генерации в целых центах USD",
      "format": "int32"
    },
    "webhook": {
      "type": [
        "string",
        "null"
      ],
      "description": "URL вебхука для доставки результата, указанный при создании. Null, если при создании генерации вебхук не задан."
    }
  },
  "required": [
    "taskId",
    "model",
    "input",
    "status",
    "createdAt",
    "completedAt",
    "duration",
    "cost"
  ],
  "$defs": {
    "MediaFileDto": {
      "type": "object",
      "properties": {
        "fileUrl": {
          "type": "string",
          "description": "Прямая ссылка на сгенерированный файл (хранится 3 дня)"
        },
        "fileType": {
          "type": "string",
          "description": "Тип медиафайла: 'image', 'video' или 'music'",
          "enum": [
            "image",
            "video",
            "music"
          ]
        }
      },
      "required": [
        "fileUrl",
        "fileType"
      ]
    }
  }
}