> ## 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.

# 视频扩展-官转

> 通过生成续写内容来扩展视频。这是一项异步操作，会返回一个用于轮询的 request_id。<br/><br/>**注意：同步官方规则，内容审核失败的场景也会扣费。**



## OpenAPI

````yaml openapi/cn/grok_video.json POST /grok/v1/videos/extensions
openapi: 3.1.0
info:
  title: Grok Video Official API
  version: 1.0.0
  description: Grok 官方视频生成 API，支持文生视频、图生视频和视频扩展。目前支持 grok-imagine-video 模型。输入视频最大 15 秒。
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /grok/v1/videos/extensions:
    post:
      description: >-
        通过生成续写内容来扩展视频。这是一项异步操作，会返回一个用于轮询的
        request_id。<br/><br/>**注意：同步官方规则，内容审核失败的场景也会扣费。**
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoExtensionRequest'
      responses:
        '200':
          description: 请求成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  request_id:
                    type: string
                    description: 请求ID
                    example: a3d1008e-4544-40d4-d075-11527e794e4a
                required:
                  - request_id
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  schemas:
    VideoExtensionRequest:
      type: object
      properties:
        prompt:
          type: string
          description: 用于描述视频接下来应发生的内容的提示词。
        video:
          type: object
          description: 视频输入对象。接受公开 URL、Base64 编码的数据 URL 或 file_id。输入视频最大 15 秒。
          properties:
            url:
              type: string
              description: 视频的公开 URL 或 base64 编码的 data URL。
        duration:
          type: integer
          description: 要生成的扩展片段时长，单位为秒（1-10）。未指定时默认为 6 秒。
          default: 6
          minimum: 1
          maximum: 10
        model:
          type: string
          description: 要使用的模型。
          enum:
            - grok-imagine-video
          default: grok-imagine-video
          example: grok-imagine-video
      required:
        - prompt
        - video
  responses:
    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 密钥。

````