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

# 尾帧生视频

> 尾帧生视频 - 通过 last_frame 严格指定视频尾帧图像

这是 **Grok 视频 API** 的尾帧生视频接口。通过 `last_frame` 严格指定视频尾帧图像。仅 `grok-imagine-video-1.5-fast` 支持。

<Callout type="warning">
  **注意**：不允许 NSFW 内容。单次或偶尔的审核失败不会产生任何费用，但反复触发审核失败可能会产生扣费。
</Callout>


## OpenAPI

````yaml openapi/cn/grok-last-frame-to-video.json POST /grok/generations
openapi: 3.1.0
info:
  title: Grok Video - 尾帧生视频 DOCS
  version: 1.0.0
  description: Grok 尾帧生视频 API - 通过 last_frame 严格指定视频尾帧图像。
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /grok/generations:
    post:
      description: 尾帧生视频 - 通过 last_frame 严格指定视频尾帧图像
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LastFrameToVideoRequest'
      responses:
        '200':
          $ref: '#/components/responses/SuccessResponse'
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  schemas:
    LastFrameToVideoRequest:
      type: object
      description: 尾帧生视频请求参数
      properties:
        model:
          type: string
          description: >-
            模型名称。仅支持 `grok-imagine-video-1.5-fast`：时长 6-30 秒（6 秒、10 秒为标准时长；不支持 7
            秒和 11 秒）；支持多张垫图（最多 7 张）；支持首尾帧控制。
          enum:
            - grok-imagine-video-1.5-fast
          default: grok-imagine-video-1.5-fast
          example: grok-imagine-video-1.5-fast
        prompt:
          type: string
          description: 提示词，支持较长文本输入。
        aspect_ratio:
          type: string
          default: '16:9'
          enum:
            - '2:3'
            - '3:2'
            - '1:1'
            - '9:16'
            - '16:9'
          description: 视频宽高比
        video_length:
          type: string
          default: '10'
          description: 视频时长（秒）。取值范围 6 到 30，其中 6 秒和 10 秒为标准时长。
        resolution_name:
          type: string
          default: 720p
          enum:
            - 480p
            - 720p
            - 1080p
          description: 输出分辨率。可选 480p、720p。
        last_frame:
          type: string
          description: 尾帧图片地址。仅 `grok-imagine-video-1.5-fast` 支持。用于严格指定视频的最后一帧。
        hook_url:
          type: string
          description: >-
            回调地址，任务完成或失败将通过请地址进行通知，通知数据结构与<a href="fetch"
            target="_self">fetch结构</a>一致。如果未设置，则需要请求<a href="fetch"
            target="_self">fetch接口</a>进行查询
          example: https://example.com/callback
      required:
        - prompt
        - last_frame
  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 密钥。

````