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

# Grok 图生视频

> 使用 xAI Grok 模型从图片生成视频（异步）

使用 [xAI](https://x.ai) 的 Grok Imagine 模型将静态图片转换为动态视频。

**模型特点：**

* **图片动态化** - 将静态图片转化为专业级短视频
* **音视频同步** - 自动生成匹配的音效、对话甚至歌声
* **流畅运动** - 24fps 帧率，动作自然无抖动
* **快速输出** - 15 秒内完成生成


## OpenAPI

````yaml /cn/openapi.yaml POST /generate/k/grok-image-to-video
openapi: 3.0.0
info:
  contact:
    email: support@sinancode.com
    name: API Support
    url: https://sinancode.com/support
  description: AI 模型任务调度平台 API
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  termsOfService: https://sinancode.com/terms-of-service
  title: TikTomato API
  version: '1.0'
servers:
  - url: https://api.sinancode.com/v1
    description: Production server
security: []
paths:
  /generate/k/grok-image-to-video:
    post:
      tags:
        - public
      summary: Grok 图片转视频
      description: 使用 xAI Grok 模型从图片生成视频（异步）
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ka.CreateGrokImageToVideoTaskRequest'
        description: 任务参数
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dto.CreateTaskResponse'
        '400':
          description: 参数错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
        '401':
          description: 未授权
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
        '500':
          description: 服务器错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
      security:
        - AccessToken: []
components:
  schemas:
    ka.CreateGrokImageToVideoTaskRequest:
      properties:
        image_urls:
          description: 图片URL列表（最多1张）
          example:
            - ''
          items:
            type: string
          maxItems: 1
          type: array
        mode:
          default: normal
          description: 模式（可选，默认 normal）
          enum:
            - fun
            - normal
            - spicy
          example: normal
          type: string
        prompt:
          description: 提示词（可选）
          example: The person waves and smiles
          maxLength: 5000
          type: string
      type: object
    dto.CreateTaskResponse:
      properties:
        task_id:
          description: Task ID
          example: 01234567-89ab-cdef-0123-456789abcdef
          type: string
      required:
        - task_id
      type: object
    apierror.ErrorResponse:
      properties:
        error_code:
          description: Machine-readable error code (e.g. TASK.INVALID_PARAMS)
          type: string
        message:
          description: User-friendly error message
          type: string
      type: object
  securitySchemes:
    AccessToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 请使用您的 API Token 进行认证

````