> ## 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 视频延长 API 文档

> 使用已完成视频任务的 jobId 延长 Gemini 视频，并返回新的异步任务 jobId。

<Note>
  视频延长是异步任务。请传入已成功完成的 Gemini 视频任务 `jobId`；提交成功后会返回新的 `jobId`，再通过 [视频结果查询 API](/api/cn/gemini/video-fetch) 获取结果。`omni-flash` 模型不支持视频延长。
</Note>


## OpenAPI

````yaml openapi/cn/gemini.json POST /gemini/video/extend
openapi: 3.1.0
info:
  title: Gemini API DOCS
  version: 1.0.0
  description: TTAPI Gemini API 接口服务，包含 Nano Banana 图片生成和 Gemini 视频生成能力。
servers:
  - url: https://api.ttapi.org
security: []
paths:
  /gemini/video/extend:
    post:
      description: 延长一个已完成的 Gemini 视频任务，并异步返回新的 jobId。原任务必须已成功完成。omni-flash 模型不支持延长。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoExtendRequest'
      responses:
        '200':
          $ref: '#/components/responses/VideoGenerationResponse'
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  schemas:
    VideoExtendRequest:
      type: object
      properties:
        jobId:
          type: string
          description: 已完成的 Gemini 视频生成或延长任务返回的 jobId
          example: 0ccf0606-3f32-4090-85bd-1786e4593be5
        prompt:
          type: string
          description: 延长视频的提示词
          example: >-
            Continue the scene with the camera moving through the futuristic
            city
        aspect_ratio:
          type: string
          description: 视频宽高比
          enum:
            - '16:9'
            - '9:16'
          example: '16:9'
        resolution:
          type: string
          description: 分辨率
          enum:
            - 720p
            - 1080p
          example: 720p
        hookUrl:
          type: string
          description: 任务完成或失败后的回调通知地址
          example: https://example.com/callback
      required:
        - jobId
        - prompt
        - 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: >-
        请前往 <a href='https://dashboard.ttapi.io' target='_blank'>TTAPI 控制台</a>
        获取 API 密钥。

````