> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ttapi.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Генерация видео

> Отправьте асинхронную задачу генерации видео Gemini и используйте возвращенный jobId для получения результата.

<Note>
  Генерация видео выполняется асинхронно. После успешной отправки используйте возвращенный `jobId` в [API получения видео](/api/ru/gemini/video-fetch).
</Note>


## OpenAPI

````yaml openapi/ru/gemini.json POST /gemini/video/generations
openapi: 3.1.0
info:
  title: Документация Gemini API
  version: 1.0.0
  description: >-
    Сервис TTAPI Gemini API: генерация изображений Nano Banana и генерация видео
    Gemini.
servers:
  - url: https://api.ttapi.org
security: []
paths:
  /gemini/video/generations:
    post:
      description: >-
        Отправляет задачу генерации видео Gemini и асинхронно возвращает jobId.
        Поддерживаются модели omni-flash, veo-3.1-fast, veo-3.1-quality и
        veo-3.1-lite.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoGenerateRequest'
      responses:
        '200':
          $ref: '#/components/responses/VideoGenerationResponse'
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  schemas:
    VideoGenerateRequest:
      type: object
      properties:
        prompt:
          type: string
          description: Промпт для видео
          example: A cinematic shot of a futuristic city at sunset
        model:
          type: string
          description: Модель видео.
          default: omni-flash
          enum:
            - veo-3.1-fast
            - veo-3.1-quality
            - veo-3.1-lite
            - omni-flash
        aspect_ratio:
          type: string
          description: Соотношение сторон видео. Обязательный параметр.
          enum:
            - '16:9'
            - '9:16'
          example: '16:9'
        resolution:
          type: string
          description: >-
            Уровень разрешения. Доступен только для модели `omni-flash`.
            Варианты: `720p`, `1080p`.
          enum:
            - 720p
            - 1080p
          example: 720p
        duration:
          type: string
          description: >-
            Длительность видео (секунды). Модели Veo 3.1 (`veo-3.1-fast`,
            `veo-3.1-quality`, `veo-3.1-lite`) поддерживают только `8`.
          enum:
            - '4'
            - '6'
            - '8'
            - '10'
          example: '8'
        generation_type:
          type: string
          description: >-
            Тип генерации видео. `frame`: кадр-в-видео; `reference`: видео по
            референс-изображениям. Если не указан, определяется автоматически по
            количеству изображений: 2 изображения = кадр-в-видео, 3 изображения
            = видео по референс-изображениям.
          enum:
            - frame
            - reference
          example: frame
        reference_images:
          type: array
          description: >-
            Референс-изображения, максимум 3. Каждый элемент — http(s):// URL.
            Поддерживаются JPEG и PNG. 
          maxItems: 3
          items:
            type: string
          example:
            - https://cdn.ttapi.io/example/reference-image.png
        reference_videos:
          type: array
          description: >-
            Референсное / редактируемое видео, максимум 1 (несколько
            видео-референсов не поддерживаются). Каждый элемент — http(s)://
            URL. Сейчас доступно только для модели `omni-flash`.
          maxItems: 1
          items:
            type: string
          example:
            - https://cdn.ttapi.io/example/reference-video.mp4
        hookUrl:
          type: string
          description: URL обратного вызова для уведомления о завершении или ошибке
          example: https://example.com/callback
      required:
        - prompt
        - model
        - aspect_ratio
  responses:
    VideoGenerationResponse:
      description: Задача успешно отправлена
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                description: Статус задачи
                example: SUCCESS
              message:
                type: string
                description: Сообщение задачи
                example: success
              data:
                type: object
                properties:
                  jobId:
                    type: string
                    description: ID задач
                    example: 0ccf0606-3f32-4090-85bd-1786e4593be5
                required:
                  - jobId
            required:
              - status
              - message
              - data
            example:
              status: SUCCESS
              message: success
              data:
                jobId: 0ccf0606-3f32-4090-85bd-1786e4593be5
    400Response:
      description: Ошибка параметров
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: '"prompt" cannot be empty.'
              data:
                type: object
            required:
              - status
              - message
    401Response:
      description: Ошибка авторизации
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: Wrong TT-API-KEY or email is not activated.
            required:
              - status
              - message
  securitySchemes:
    CustomApiKey:
      type: apiKey
      in: header
      name: TT-API-KEY
      description: >-
        Вы можете получить API-ключ в <a href='https://dashboard.ttapi.io'
        target='_blank'>панель управления TTAPI</a>.

````