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

# Grok 视频生成

> 根据文本提示词生成视频，支持指定时长、宽高比和分辨率。
可选传入参考图片进行图生视频。
返回 taskId，使用 /xai/tasks 查询结果



## OpenAPI

````yaml POST /xai/videos
openapi: 3.0.0
info:
  title: Xai AI
  description: API documentation for Xai AI
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.mountsea.ai
    description: API Gateway
security: []
tags:
  - name: xai
    description: ''
paths:
  /xai/videos:
    post:
      tags:
        - XAI - 视频
      summary: 生成视频
      description: |-
        根据文本提示词生成视频，支持指定时长、宽高比和分辨率。
        可选传入参考图片进行图生视频。
        返回 taskId，使用 /xai/tasks 查询结果
      operationId: XaiVideoController_generateVideo
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateVideoDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskIdDto'
      security:
        - bearerAuth: []
components:
  schemas:
    GenerateVideoDto:
      type: object
      properties:
        prompt:
          type: string
          maxLength: 1000
          description: 视频描述提示词（最大 1000 字符）
          example: 小猫在吃鱼
        model:
          type: string
          enum:
            - grok-imagine-video
          description: 视频模型
          example: grok-imagine-video
        duration:
          default: 6
          enum:
            - 6
            - 10
            - 12
            - 16
            - 20
          type: number
          description: 视频时长（秒）
        aspectRatio:
          enum:
            - '2:3'
            - '3:2'
            - '1:1'
            - '9:16'
            - '16:9'
          type: string
          description: 视频宽高比
        resolution:
          default: 720P
          enum:
            - 480P
            - 720P
          type: string
          description: 视频分辨率
        images:
          maxItems: 5
          description: 参考图片 URL（图生视频，最多 5 张；提供后视频尺寸跟随图片，aspectRatio 和 resolution 将被忽略）
          type: array
          items:
            type: string
      required:
        - prompt
        - model
    TaskIdDto:
      type: object
      properties:
        taskId:
          type: string
          description: 任务 ID，用于后续查询结果
      required:
        - taskId
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````