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

# 创建视频

> Grok Imagine 异步创建视频。

**路径：** `POST https://api.omniall.ai/v1/videos`

创建成功后用返回的 `id` 轮询 `GET /v1/videos/{task_id}`。

模型 ID 以[模型广场](https://omniall.ai/pricing)为准。常用：`grok-imagine-video-1.5-preview`、`grok-imagine-video`；亦可有 `grok-video-1.5-pro`、`grok-video-1.5-max` 等变体（以你账号开通为准）。

鉴权：`Authorization: Bearer sk-...`



## OpenAPI

````yaml zh-CN/openapi/grok-video.yaml POST /v1/videos
openapi: 3.1.0
info:
  title: Omniall AI — Grok 生视频
  version: 1.0.0
  description: >-
    Grok Imagine 异步创建视频。


    **路径：** `POST https://api.omniall.ai/v1/videos`


    创建成功后用返回的 `id` 轮询 `GET /v1/videos/{task_id}`。


    模型 ID
    以[模型广场](https://omniall.ai/pricing)为准。常用：`grok-imagine-video-1.5-preview`、`grok-imagine-video`；亦可有
    `grok-video-1.5-pro`、`grok-video-1.5-max` 等变体（以你账号开通为准）。


    鉴权：`Authorization: Bearer sk-...`
servers:
  - url: https://api.omniall.ai
security: []
paths:
  /v1/videos:
    post:
      tags:
        - Grok video
      summary: 创建视频
      description: >-
        Grok Imagine 异步创建视频。


        **路径：** `POST https://api.omniall.ai/v1/videos`


        创建成功后用返回的 `id` 轮询 `GET /v1/videos/{task_id}`。


        模型 ID
        以[模型广场](https://omniall.ai/pricing)为准。常用：`grok-imagine-video-1.5-preview`、`grok-imagine-video`；亦可有
        `grok-video-1.5-pro`、`grok-video-1.5-max` 等变体（以你账号开通为准）。


        鉴权：`Authorization: Bearer sk-...`
      operationId: grokCreateVideo
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            example: Bearer sk-...
          description: Bearer API Key，例如 `Bearer sk-...`。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - prompt
              description: Grok Imagine 视频创建请求（`POST /v1/videos`）。
              properties:
                model:
                  type: string
                  description: >-
                    视频模型 ID。模型 ID
                    以[模型广场](https://omniall.ai/pricing)为准。常用：`grok-imagine-video-1.5-preview`、`grok-imagine-video`；亦可有
                    `grok-video-1.5-pro`、`grok-video-1.5-max` 等变体（以你账号开通为准）。
                  example: grok-imagine-video-1.5-preview
                prompt:
                  type: string
                  description: 视频提示词，最大约 4096 字符。写清主体、场景、运动与风格。
                  example: 雨夜霓虹街头，一辆复古跑车驶过湿润路面
                  maxLength: 4096
                seconds:
                  type: string
                  description: 目标时长（秒），建议传字符串，如 `"6"`、`"8"`。最小 1。也可用整数 `duration`。
                  example: '8'
                duration:
                  type: integer
                  description: '`seconds` 的整数写法。'
                  minimum: 1
                aspect_ratio:
                  type: string
                  description: 画幅宽高比。预设见枚举；亦支持自定义 `数字:数字`。
                  enum:
                    - '1:1'
                    - '16:9'
                    - '9:16'
                    - '4:3'
                    - '3:4'
                    - '3:2'
                    - '2:3'
                    - '2:1'
                    - '1:2'
                    - 19.5:9
                    - '9:19.5'
                    - '20:9'
                    - '9:20'
                  example: '16:9'
                resolution:
                  type: string
                  description: 输出清晰度。支持 `480P` / `720P`（大小写不敏感，亦可写 `480` / `720`）。
                  enum:
                    - 480P
                    - 720P
                    - '480'
                    - '720'
                    - 480p
                    - 720p
                  example: 720P
                image:
                  type: string
                  description: >-
                    单张参考图。推荐 `data:image/...;base64,...` Data URI，也可为 HTTPS
                    URL。**不要与 `reference_images` 同时使用。**
                reference_images:
                  type: array
                  items:
                    type: string
                  description: 多张参考图（Data URI 或 URL）。**不要与 `image` 同时使用。**
                images:
                  type: array
                  items:
                    type: string
                  description: '`reference_images` / 单图的兼容数组写法。'
            examples:
              文生视频:
                summary: 文生视频
                value:
                  model: grok-imagine-video-1.5-preview
                  prompt: 雨夜霓虹街头，一辆复古跑车驶过湿润路面
                  seconds: '8'
                  aspect_ratio: '16:9'
                  resolution: 720P
              单图生视频:
                summary: 单图生视频
                value:
                  model: grok-imagine-video-1.5-preview
                  prompt: 让画面中的人物轻轻转头微笑，镜头缓慢推近
                  seconds: '6'
                  aspect_ratio: '9:16'
                  resolution: 720P
                  image: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...
              多图参考生视频:
                summary: 多图参考生视频
                value:
                  model: grok-imagine-video-1.5-preview
                  prompt: 参考这些图片的角色外观与场景氛围，生成一段连贯走动镜头
                  seconds: '8'
                  aspect_ratio: '16:9'
                  resolution: 720P
                  reference_images:
                    - data:image/jpeg;base64,/9j/4AAQ...
                    - data:image/jpeg;base64,/9j/4AAQ...
      responses:
        '200':
          description: 任务已接受。
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: 任务 ID。
                  object:
                    type: string
                    example: video
                  model:
                    type: string
                  status:
                    type: string
                    description: 如 `queued` / `in_progress` / `completed`。
                  progress:
                    type: integer
                  created_at:
                    type: integer
                  seconds:
                    type: string
                  size:
                    type: string
              example:
                id: video_abc123
                object: video
                model: grok-imagine-video-1.5-preview
                status: queued
                progress: 0
                created_at: 1710000000
                seconds: '8'
        '400':
          description: 请求无效
        '401':
          description: 未授权

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.