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

# 创建视频

> 创建 Vidu Q4 视频任务。

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

**场景：**
- 文生视频：只传 `prompt` + `seconds`（及可选 `size` / `resolution`）
- 图生 / 多图参考：传 `reference_image` 或 `reference_images` / `images`（合计最多 10 张）
- 参考音频：传 `reference_audios`（最多 3 段；建议同时带至少 1 张图）

**约束：**
- `seconds` / `duration`：整数 4–16（区间内同价）
- `size` / `ratio` / `aspect_ratio`：仅 `16:9` / `9:16`（默认 `16:9`）
- `count` 只能为 1
- 不支持参考视频
- 参数不合法返回 HTTP 400

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



## OpenAPI

````yaml zh-CN/openapi/vidu-video.yaml POST /v1/video/generations
openapi: 3.1.0
info:
  title: Omniall AI — Vidu 视频
  version: 1.0.0
  description: |-
    Vidu Q4 异步视频生成（`vidu-q4-720p` / `vidu-q4-1080p`）。

    **创建：** `POST https://api.omniall.ai/v1/video/generations`

    **查询：** `GET https://api.omniall.ai/v1/video/generations/{task_id}`

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

    | 模型 | 规格 |
    |------|------|
    | `vidu-q4-720p` | 720P；时长 4–16 秒任选同价；每次 1 条 |
    | `vidu-q4-1080p` | 1080P；时长 4–16 秒任选同价；每次 1 条 |

    按次计费。生成通常需数分钟，请轮询查询接口。
servers:
  - url: https://api.omniall.ai
security: []
tags:
  - name: Vidu
    description: Vidu Q4 文生视频 / 图生视频 / 参考音频
paths:
  /v1/video/generations:
    post:
      tags:
        - Vidu
      summary: 创建视频
      description: >-
        创建 Vidu Q4 视频任务。


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


        **场景：**

        - 文生视频：只传 `prompt` + `seconds`（及可选 `size` / `resolution`）

        - 图生 / 多图参考：传 `reference_image` 或 `reference_images` / `images`（合计最多 10
        张）

        - 参考音频：传 `reference_audios`（最多 3 段；建议同时带至少 1 张图）


        **约束：**

        - `seconds` / `duration`：整数 4–16（区间内同价）

        - `size` / `ratio` / `aspect_ratio`：仅 `16:9` / `9:16`（默认 `16:9`）

        - `count` 只能为 1

        - 不支持参考视频

        - 参数不合法返回 HTTP 400


        鉴权：`Authorization: Bearer sk-...`
      operationId: viduCreateVideo
      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:
              $ref: '#/components/schemas/ViduCreateVideoRequest'
            examples:
              vidu_text:
                summary: 文生视频（vidu-q4-720p · 5 秒）
                value:
                  model: vidu-q4-720p
                  prompt: 一只橘猫在阳光洒落的窗台伸懒腰，镜头缓慢推进
                  seconds: 5
                  size: '16:9'
                  count: 1
              vidu_refs:
                summary: 参考图 + 参考音频（vidu-q4-1080p · 8 秒竖屏）
                value:
                  model: vidu-q4-1080p
                  prompt: 参考图中的人物随音乐节奏轻轻点头微笑
                  seconds: 8
                  size: '9:16'
                  reference_images:
                    - https://example.com/person.jpg
                  reference_audios:
                    - https://example.com/bgm.mp3
      responses:
        '200':
          description: 任务已提交（processing）
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ViduVideoTask'
              example:
                id: task_xxxxxxxx
                task_id: task_xxxxxxxx
                object: video
                model: vidu-q4-720p
                status: processing
                progress: 0
                seconds: '5'
                size: '16:9'
        '400':
          description: 参数不合法
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
        '401':
          description: 未授权
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
        '429':
          description: 限流
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
        '500':
          description: 服务端错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
components:
  schemas:
    ViduCreateVideoRequest:
      type: object
      required:
        - model
        - prompt
      description: Vidu 创建视频请求体。
      properties:
        model:
          $ref: '#/components/schemas/ViduModel'
        prompt:
          type: string
          description: 视频描述文本。
          example: 一只橘猫在阳光洒落的窗台伸懒腰，镜头缓慢推进
        seconds:
          oneOf:
            - type: integer
            - type: string
          description: |
            时长（秒）。整数 4–16，区间内同价。
            若同时传 `duration`，须与 `seconds` 一致；建议只传 `seconds`。
          example: 5
        duration:
          oneOf:
            - type: integer
            - type: string
          description: 与 `seconds` 等价的兼容字段；建议只传 `seconds`。
        resolution:
          type: string
          description: 可选；通常由模型档位决定（`720P` / `1080P`）。
          enum:
            - 720P
            - 1080P
          example: 720P
        size:
          type: string
          description: 画面比例。仅 `16:9` / `9:16`；默认 `16:9`。别名 `ratio` / `aspect_ratio`。
          enum:
            - '16:9'
            - '9:16'
          default: '16:9'
          example: '16:9'
        ratio:
          type: string
          description: '`size` 别名。'
          enum:
            - '16:9'
            - '9:16'
        aspect_ratio:
          type: string
          description: '`size` 别名。'
          enum:
            - '16:9'
            - '9:16'
        count:
          type: integer
          description: 生成条数。只能为 1。
          enum:
            - 1
          default: 1
          example: 1
        reference_image:
          type: string
          description: 单张参考图 URL。与 `reference_images` / `images` 合计最多 10 张。
          example: https://example.com/1.jpg
        reference_images:
          type: array
          items:
            type: string
          description: 多张参考图 URL 数组。别名 `images`。与 `reference_image` 合计最多 10 张。不传参考素材即为文生视频。
          maxItems: 10
        images:
          type: array
          items:
            type: string
          description: '`reference_images` 别名。'
          maxItems: 10
        reference_audios:
          type: array
          items:
            type: string
          description: 参考音频 URL 数组。最多 3 段。建议同时带至少 1 张参考图。
          maxItems: 3
    ViduVideoTask:
      type: object
      description: Vidu 视频任务对象。
      properties:
        id:
          type: string
          description: 任务 ID（与 `task_id` 通常相同）。
        task_id:
          type: string
          description: 任务 ID。
        object:
          type: string
          description: 对象类型，通常为 `video`。
          example: video
        model:
          $ref: '#/components/schemas/ViduModel'
        status:
          type: string
          description: 任务状态，如 `processing` / `completed` / `failed`。
          example: processing
        progress:
          type: number
          description: 进度 0–100（若返回）。
        seconds:
          oneOf:
            - type: string
            - type: integer
          description: 请求时长。
        size:
          type: string
          description: 画面比例。
        resolution:
          type: string
          description: 分辨率。
        url:
          type: string
          description: 完成后的视频地址（也可能返回为 `video_url` / `result_url`）。
        video_url:
          type: string
          description: 完成后的视频地址（兼容字段）。
        result_url:
          type: string
          description: 完成后的视频地址（兼容字段）。
        error:
          type: object
          description: 失败时的错误信息。
          properties:
            message:
              type: string
    OpenAIErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: |
                常见参数错误提示示例：
                - 时长须在 4–16 秒
                - 不支持的画面比例…该模型支持: 16:9 / 9:16
                - 最多 10 张参考图
                - 最多 3 个参考音频
                - 不支持参考视频
            type:
              type: string
            code:
              type: string
    ViduModel:
      type: string
      description: Vidu Q4 模型 ID（与模型广场一致）。
      enum:
        - vidu-q4-720p
        - vidu-q4-1080p
      example: vidu-q4-720p

````

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