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

# 视频扩展

> 通过生成续写内容来扩展视频。这是一项异步操作，会返回一个 jobId 用于查询结果。

这是 **Grok 视频 API** 的视频扩展接口，通过生成续写内容来扩展视频。

如果你想查看完整的接口目录、推荐接入流程和相关能力，请先阅读 [Grok 视频 API 总览](/api/cn/grok)。


## OpenAPI

````yaml openapi/cn/grok.json POST /grok/extensions
openapi: 3.1.0
info:
  title: Grok Video DOCS
  version: 1.0.0
  description: Grok Video API 提供高效的视频分析和生成能力，帮助开发者快速集成智能视频功能。
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /grok/extensions:
    post:
      description: 通过生成续写内容来扩展视频。这是一项异步操作，会返回一个 jobId 用于查询结果。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExtensionRequest'
      responses:
        '200':
          $ref: '#/components/responses/SuccessResponse'
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  schemas:
    ExtensionRequest:
      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:
    SuccessResponse:
      description: 请求成功
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: SUCCESS
              message:
                type: string
                example: success
              data:
                type: object
                example:
                  jobId: jobId
            required:
              - status
              - message
              - data
    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 密钥。

````