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

# 世界视频生成

## 定价

11 月黑五优惠价现已上线，同时推出：

* **支持视频参考**
* **提升视觉质量**
* **Vivix W1 Auto**

以下 11 月费率已包含**黑五限时优惠**。

> [card] [购买 W 点数包](https://platform.vivix.ai/pricing#W)

### 11 月黑五优惠价

基础生成按生成视频的秒数计费，费率取决于模型和输出 `resolution`。

| 模型 | 720p（默认） | 1080p（1K） | 1440p（2K） |
| - | -: | -: | -: |
| Vivix W1 Auto | **\$0.0090 / 秒** 3.0 点 | **\$0.0200 / 秒** ≈ 6.7 点 | **\$0.0400 / 秒** ≈ 13.3 点 |
| Vivix W1 | **\$0.0050 / 秒** ≈ 1.7 点 | **\$0.0120 / 秒** 4.0 点 | **\$0.0240 / 秒** 8.0 点 |
| Vivix W1 Fast | **\$0.0160 / 秒** ≈ 5.3 点 | **\$0.0370 / 秒** ≈ 12.3 点 | **\$0.0740 / 秒** ≈ 24.7 点 |
| Vivix W1 Ultra Fast | **\$0.0280 / 秒** ≈ 9.3 点 | **\$0.0650 / 秒** ≈ 21.7 点 | **\$0.1300 / 秒** ≈ 43.3 点 |

**1 点 = \$0.0030。** 点数费率显示时四舍五入到一位小数；实际计费使用未四舍五入的费率。

### 参考素材费用

参考素材费用在基础生成费用之外另行收取，具体如下。

| 参考素材 | 美元 | 点数 |
| - | -: | -: |
| 图像：1–5 张 | **每个请求合计 \$0.0150** | **5.0** |
| 图像：第 5 张之后的每张图像 | **每张 +\$0.0150** | **+5.0** |
| 音频：参考音频总时长每 5 秒 | **\$0.0030** | **1.0** |
| 视频：参考视频总时长每秒 | **\$0.0600** | **20.0** |

所有音频片段的时长会合并计算，再向上取整到下一个 5 秒区间。视频参考费用按所有参考视频的合计时长计算。

***

## API 概览

使用 Vivix-W1 异步生成完整的世界视频。单个请求包含提示词、请求的时长和宽高比，还可以选择提供参考图像、音频和视频。

提交任务后获取 `job_id`，轮询任务直至进入终止状态，再通过 `video_url` 播放结果。参考素材需要先上传，因此使用参考素材的任务涉及四个接口：

1. `POST /v1/files/images` / `POST /v1/files/audios` / `POST /v1/files/videos`——上传参考素材并保存返回的 `url`（文生视频可跳过）；
2. `POST /v1/videos/jobs`——提交生成任务；
3. `GET /v1/videos/jobs/{job_id}`——查询单个任务；
4. `POST /v1/videos/jobs/batch-get`——批量查询多个任务。

## 选择模型

将请求中的 `model` 字段设置为以下 W1 模型之一。各模型的生成速度和价格不同。

> [!NOTE]
>
> 下方示例使用 `vivix-w1-fast`。如果希望基础价格最低，可选择 `vivix-w1`；如果追求最快生成速度，可选择 `vivix-w1-ultrafast`；如果希望自动选择速度，可选择 `vivix-w1-auto`。

当前 11 月黑五优惠价和参考素材费用请参阅上方的[定价](#w-pricing-update)。

| 模型 | 说明 |
| - | - |
| `vivix-w1-auto` | 自动选择当前可用的最快 W1 模式；无论选择哪种速度，都按 Auto 基础费率计费。 |
| `vivix-w1-ultrafast` | 生成速度最快；价格最高。 |
| `vivix-w1-fast` | 生成速度快于 `vivix-w1`。 |
| `vivix-w1` | 标准生成速度；价格最低。 |

### Vivix W1 Auto

`vivix-w1-auto` 会根据当前吞吐量自动选择可用的最快 W1 生成模式。

| 行为 | 详情 |
| - | - |
| 自动选择 | 请求执行时，选择可用的最快 W1 模式。 |
| 速度范围 | 从 **Normal**（`vivix-w1`）到 **Ultra Fast**（`vivix-w1-ultrafast`）。 |
| 基础生成价格 | **始终按 Auto 费率计费。** 路由到 Fast 或 Ultra Fast 不会额外收取加速费。 |

参考图像、音频和视频的费用会在基础生成费用之上另行收取。请参阅上方的[参考素材费用](#w-pricing-update)。

费用从 W 点数余额中扣除。W 点数与 A 点数相互独立，不能混用。

完整的 Vivix 模型列表请参阅[模型](https://docs.vivix.ai/cn/overview/models.md)。

## 参考素材

先将所有参考文件上传到工作区，再将上传响应中的 `url` 传给 `ref_images` / `ref_audios` / `ref_videos`。示例使用我们的 CDN URL 格式（`static.vivi-x.ai`）；请将示例 URL 替换为你自己上传后返回的 URL。参考 URL 必须可通过 HTTP(S) 公开访问；`file_id` 供其他接口使用，此处不接受。

每个生成任务最多支持 **8 张参考图像**、**4 个参考音频文件**和 **4 个参考视频**。

* **图像：** 宽高比必须在 **1:4 到 4:1** 之间。
* **音频：** 每个文件不得超过 **15 秒**；所有参考音频合计不得超过 **20 秒**。
* **视频：** 每个文件不得超过 **15 秒**；所有参考视频合计不得超过 **20 秒**。

音频和视频的总时长分别计算。

| 接口 | 支持的类型 | 每个任务的文件上限 | 文件大小上限 |
| - | - | - | - |
| `POST /v1/files/images` | jpg, png, webp, heic | 8 | 10MB |
| `POST /v1/files/audios` | wav、mp3、m4a、ogg、webm（推荐 mp3 和 wav） | 4 | 10MB |
| `POST /v1/files/videos` | mp4, mov, webm | 4 | 20MB |

文件类型根据文件内容而不是文件名检测。服务端会检查文件开头的字节，并将检测结果与声明的 `Content-Type` 比较；检测到的类型必须属于上方支持的类型并与声明值一致，否则上传会返回 `20008`。请在 multipart `Content-Type` 中声明真实的媒体类型。

```bash 上传图像 theme={null}
curl -X POST https://api.vivix.ai/v1/files/images \
  -H "Authorization: Bearer $VIVIX_API_KEY" \
  -F "file=@traveler.png"
```

```json 上传响应 theme={null}
{
  "code": 0,
  "message": "success",
  "data": {
    "file_id": "file_img_xxxxxxxx-xxx",
    "file_type": "image",
    "mime_type": "image/png",
    "size_bytes": 412876,
    "url": "https://static.vivi-x.ai/images/2026/09/15/xxxxxxxxxxxxxxxx.png",
    "created_at": "2026-09-15T08:00:00.000000000Z"
  }
}
```

```bash 上传音频 theme={null}
curl -X POST https://api.vivix.ai/v1/files/audios \
  -H "Authorization: Bearer $VIVIX_API_KEY" \
  -F "file=@market.mp3"

{
  "code": 0,
  "message": "success",
  "data": {
    "file_id": "file_aud_xxxxxxxx-xxx",
    "file_type": "audio",
    "mime_type": "audio/mpeg",
    "size_bytes": 335822,
    "url": "https://static.vivi-x.ai/audios/2026/09/15/xxxxxxxxxxxxxxxx.mp3",
    "created_at": "2026-09-15T08:00:12.000000000Z"
  }
}
```

```bash 上传视频 theme={null}
curl -X POST https://api.vivix.ai/v1/files/videos \
  -H "Authorization: Bearer $VIVIX_API_KEY" \
  -F "file=@movement.mp4;type=video/mp4"
```

将上传响应中的 `data.url` 用作各 `ref_videos` 项的 `url`。

## 首帧与尾帧

如需精确固定视频的开场或结尾画面，请传入 `first_frame_image` / `last_frame_image`。两者与参考素材一样，都使用上传后返回的 `url`。

| 字段 | 结果 |
| - | - |
| 仅 `first_frame_image` | 从该图像开始生成。 |
| 仅 `last_frame_image` | 生成内容最终收束到该图像。 |
| 两者都提供 | 从首帧开始并抵达尾帧；两次使用同一张图像可形成无缝循环。 |

关键帧和参考素材属于两种不同模式，因此 `first_frame_image` / `last_frame_image` 不能与 `ref_images` / `ref_audios` / `ref_videos` 同时使用；混用会返回 `20004`。

## 任务类型

任务类型由提交的素材推导，无需提供 `mode` 字段。所有类型都使用 `prompt`、`duration` 和 `aspect_ratio`。

| 任务类型 | 素材 | 作用 |
| - | - | - |
| 文生视频 | 仅 `prompt` | 根据描述构建整个场景。 |
| 图像参考生视频 | `prompt` + `ref_images` | 让角色、对象或风格与参考图像保持一致。 |
| 音频参考生视频 | `prompt` + `ref_audios` | 生成视频，并使用参考音频引导配套音轨。 |
| 视频参考生视频 | `prompt` + `ref_videos` | 使用参考视频引导动作、镜头运动或视觉风格。 |
| 图像和音频参考生视频 | `prompt` + `ref_images` + `ref_audios` | 在一个任务中组合两类参考素材。 |
| 混合参考生视频 | `prompt` + `ref_images` + `ref_audios` + `ref_videos` | 在一个任务中组合视觉、音频和动作参考。 |
| 首帧生视频 | `prompt` + `first_frame_image` | 从给定图像开始并继续发展。 |
| 尾帧生视频 | `prompt` + `last_frame_image` | 最终收束到给定图像。 |
| 首尾帧生视频 | `prompt` + `first_frame_image` + `last_frame_image` | 从首帧图像过渡到尾帧图像。 |

### 文生视频

```bash theme={null}
curl -X POST https://api.vivix.ai/v1/videos/jobs \
  -H "Authorization: Bearer $VIVIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "vivix-w1-fast",
  "jobs": [
    {
      "prompt": "A traveler crosses a windswept salt flat at sunset as the camera slowly pulls back.",
      "aspect_ratio": "16:9",
      "duration": 8
    }
  ]
}'
```

**如何编写提示词**

先描述场景中有哪些角色、发生什么以及如何结束，再补充需要的风格、镜头和声音细节。如果外观、走位、动作顺序和最终镜头很重要，请直接写明；使用可以观察到的描述，避免含糊的情绪词。

* 可以使用自然语言或带标签的字段，没有固定长度或顺序。
* 不希望剪辑时加入“one continuous shot”，并使用 first / then / finally 推进动作。
* 台词、歌词和画面文字请使用成片语言，放在引号中，并注明说话者。

### 图像参考生视频

```bash theme={null}
curl -X POST https://api.vivix.ai/v1/videos/jobs \
  -H "Authorization: Bearer $VIVIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "vivix-w1-fast",
  "jobs": [
    {
      "prompt": "The traveler from the reference image walks across a windswept salt flat at sunset.",
      "aspect_ratio": "16:9",
      "duration": 8,
      "ref_images": [
        { "url": "https://static.vivi-x.ai/images/2026/09/15/xxxxxxxxxxxxxxxx.png" }
      ]
    }
  ]
}'
```

**如何编写提示词**

说明每张参考图像提供什么信息，以及它适用于哪个主体。使用上传结果显示的编号或名称，并明确写出需要改变或排除的内容。

* 角色示例：“Image 1 defines the character’s look, move the scene to a rainy street.”
* 使用多张图像时，明确对应关系：“Image 1 for the character, image 2 only for the bold line work and palette.”
* 无需列出所有未参考的内容；只有容易混淆时才需要特别说明。

### 音频参考生视频

```bash theme={null}
curl -X POST https://api.vivix.ai/v1/videos/jobs \
  -H "Authorization: Bearer $VIVIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "vivix-w1-fast",
  "jobs": [
    {
      "prompt": "A night market comes alive, matching the mood of the reference audio.",
      "aspect_ratio": "9:16",
      "duration": 10,
      "ref_audios": [
        { "url": "https://static.vivi-x.ai/audios/2026/09/15/xxxxxxxxxxxxxxxx.mp3" }
      ]
    }
  ]
}'
```

**如何编写提示词**

说明音频的用途——音色、音乐风格或环境声——以及它对应的主体或片段。存在多个人物时，请显式关联每条音轨，不要依赖上传顺序。

* 借用音色：“Audio 1 is the girl’s timbre for image 2; deliver the lines below verbatim.”
* 使用原始音轨：注明用途和开始位置，例如“the first 8 seconds of audio 1 as the backing track”。
* 只参考风格：写明“reference the style, do not use the original track”。

### 视频参考生视频

```bash theme={null}
curl -X POST https://api.vivix.ai/v1/videos/jobs \
  -H "Authorization: Bearer $VIVIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "vivix-w1-fast",
  "jobs": [
    {
      "prompt": "A traveler crosses a salt flat, following the slow camera movement in video 1.",
      "aspect_ratio": "16:9",
      "duration": 8,
      "ref_videos": [
        { "url": "https://static.vivi-x.ai/videos/2026/09/15/xxxxxxxxxxxxxxxx.mp4" }
      ]
    }
  ]
}'
```

**如何编写提示词**

说明要从每个视频中借用什么，例如动作、镜头语言或视觉风格，并说明生成场景中需要改变什么。组合多类参考素材时，请明确指出每张图像、每段音频和每个视频的作用。

### 图像和音频参考生视频

```bash theme={null}
curl -X POST https://api.vivix.ai/v1/videos/jobs \
  -H "Authorization: Bearer $VIVIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "vivix-w1-fast",
  "jobs": [
    {
      "prompt": "The traveler and the vehicle from the reference images cross the salt flat while the reference music plays.",
      "aspect_ratio": "16:9",
      "duration": 12,
      "ref_images": [
        { "url": "https://static.vivi-x.ai/images/2026/09/15/xxxxxxxxxxxxxxxx.png" },
        { "url": "https://static.vivi-x.ai/images/2026/09/15/yyyyyyyyyyyyyyyy.png" }
      ],
      "ref_audios": [
        { "url": "https://static.vivi-x.ai/audios/2026/09/15/yyyyyyyyyyyyyyyy.mp3" }
      ]
    }
  ]
}'
```

**如何编写提示词**

说明每张参考图像提供什么信息、适用于哪个主体，再描述音频应引导的配套音轨。使用多条音轨时，请将每条音轨与对应主体显式关联。

* 明确对应关系：“Image 1 and image 2 are the traveler and the vehicle; audio 1 sets the pacing and mood.”
* 说明哪些内容改变、哪些保持不变：“keep the vehicle design from image 2 unchanged.”
* 补充需要的镜头和声音，并指出必须排除的内容。

### 首尾帧生视频

```bash theme={null}
curl -X POST https://api.vivix.ai/v1/videos/jobs \
  -H "Authorization: Bearer $VIVIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "vivix-w1-fast",
  "jobs": [
    {
      "prompt": "The traveler walks from the dawn dunes toward the salt flat as the light turns golden.",
      "aspect_ratio": "16:9",
      "duration": 8,
      "first_frame_image": "https://static.vivi-x.ai/images/2026/09/15/3a9c7f14b2e85d60.png",
      "last_frame_image": "https://static.vivi-x.ai/images/2026/09/15/c05d8e37a9f16b42.png"
    }
  ]
}'
```

**如何编写提示词**

描述动作如何离开首帧，以及如何抵达尾帧。无需重复描述两张图像，只需补充关键变化和容易被误解的细节。

* 同时提供首尾帧：描述两者之间的过渡，例如“the character opens the umbrella and settles into the final pose and framing”。
* 仅提供首帧：描述后续动作。仅提供尾帧：描述抵达该画面的过程。
* 说明镜头是减速、停留还是保持一个连续镜头，并保持人物和服装一致。

## 生成输入

| 字段 | 接受的值 | 用途 |
| - | - | - |
| `prompt` | 非空字符串 | 必填。视频的自然语言描述。 |
| `duration` | 整数，5–15 | 必填。请求的视频时长，单位为秒。 |
| `aspect_ratio` | `"16:9"` / `"9:16"` / `"1:1"` / `"4:3"` / `"3:4"` | 可选。默认为 `"16:9"`。 |
| `resolution` | `"720p"` / `"1080p"` / `"1440p"` | 可选。默认为 `"720p"`。`"1080p"` 为 1K，`"1440p"` 为 2K。 |
| `ref_images` | `{ url }[]`，最多 8 项 | 可选。用于主体、对象或视觉风格的参考图像。每项只包含上传图像的 `url`。图像宽高比必须在 1:4 到 4:1 之间。 |
| `ref_audios` | `{ url }[]`，最多 4 项 | 可选。用于音色、音乐或环境声的参考音频。每项只包含上传音频的 `url`。每个文件最长 15 秒，所有音频合计最长 20 秒。 |
| `ref_videos` | `{ url }[]`，最多 4 项 | 可选。用于动作、镜头语言或视觉风格的参考视频。每项只包含上传视频的 `url`。每个文件最长 15 秒，所有视频合计最长 20 秒。 |
| `first_frame_image` | 字符串（URL） | 可选。固定开场画面。不能与参考素材同时使用。 |
| `last_frame_image` | 字符串（URL） | 可选。固定结尾画面。不能与参考素材同时使用。 |

> [!NOTE]
>
> **每个请求只能包含一个任务。** `jobs` 数组必须且只能包含一项；未知字段会返回 `20004`。

## 调用约定

以下约定适用于本页所有接口。

### 基础 URL

`https://api.vivix.ai`

### 鉴权

每个请求都必须携带 API 密钥：`Authorization: Bearer $VIVIX_API_KEY`。

### 响应封装

REST 响应使用统一的 `{code, message, data}` 封装。业务字段位于 `data` 中。

```json 响应封装 theme={null}
{
  "code": 0,
  "message": "success",
  "data": {}
}
```

* `code = 0` 表示请求成功。
* 非零 `code` 表示 API 级错误；HTTP 状态由该值映射得出。
* 已接受的任务之后仍可能失败。请轮询任务并检查 `status` 和 `error`。

## 任务生命周期

1. 调用 `POST /v1/videos/jobs` 提交任务，并保存返回的 `job_id`。
2. 任务处于 `queued` 或 `processing` 时，每隔几秒轮询 `GET /v1/videos/jobs/{job_id}`。
3. 任务进入 `succeeded` 后，通过 `video_url` 播放或下载视频。进入 `failed` 后停止轮询并读取 `error`。

| 状态 | 含义 | 客户端操作 |
| - | - | - |
| `queued` | 任务正在等待开始。 | 继续轮询。 |
| `processing` | 正在生成视频。 | 继续轮询。 |
| `succeeded` | 生成的视频已经就绪。 | 读取 `video_url`。 |
| `failed` | 任务未能成功完成。 | 停止轮询并读取 `error.code`。 |

## 提交生成任务

根据提示词和可选参考素材创建异步 W1 视频生成任务。

**POST** `/v1/videos/jobs`

### 请求体参数

**model** `"vivix-w1-auto" | "vivix-w1-ultrafast" | "vivix-w1-fast" | "vivix-w1"` *required*

必填。本任务使用的 W1 模型。`vivix-w1-auto` 会在 Normal 到 Ultra Fast 之间自动选择可用的最快模式，并按 Auto 基础费率计费，不收取加速附加费。详情请参阅[选择模型](#world-model-selection)。

**pe\_mode** `"standard" | "enhanced"`

可选。默认为 `standard`，通过一次多模态调用增强提示词。选择 `enhanced` 可分别执行媒体分析和提示词规划。此设置不会改变视频时长、分辨率或推理模式。

**seed** `integer | null`

可选。取值为 0 到 2147483647 的整数。省略或传入 null 时，由后端生成随机种子。设置后，所有任务都使用同一个种子，0 也有效。该字段控制视频推理，不控制提示词增强的随机性。

**jobs** `array` *required*

必填。必须且只能包含一个任务。

**jobs\[].prompt** `string` *required*

必填。视频的自然语言描述。

**jobs\[].duration** `integer` *required*

必填。视频时长，单位为秒，取值范围为 5 到 15。

**jobs\[].aspect\_ratio** `string`

可选。可设为 `"16:9"`、`"9:16"`、`"1:1"`、`"4:3"`、`"3:4"` 之一。默认为 `"16:9"`。

**jobs\[].resolution** `"720p" | "1080p" | "1440p"`

可选。可设为 `"720p"`、`"1080p"`（1K）或 `"1440p"`（2K）。默认为 `"720p"`。

**jobs\[].ref\_images** `\{ url: string \}[]`

可选。最多 **8 张参考图像**，用于引导主体、对象或视觉风格。

* 每项只包含 `POST /v1/files/images` 返回的 `url`。
* 文件大小上限：**10 MB**。
* 图像宽高比：**1:4 到 4:1**。
* 不能与 `first_frame_image` 或 `last_frame_image` 同时使用。

**jobs\[].ref\_audios** `\{ url: string \}[]`

可选。最多 **4 个参考音频文件**，用于引导音色、音乐或环境声。

* 每项只包含 `POST /v1/files/audios` 返回的 `url`。
* 文件大小上限：**10 MB**。
* 每个文件的时长上限：**15 秒**。
* 参考音频的合计时长上限：**20 秒**。音频和视频的总时长分别计算。
* 不能与 `first_frame_image` 或 `last_frame_image` 同时使用。

**jobs\[].ref\_videos** `\{ url: string \}[]`

可选。最多 **4 个参考视频**，用于引导动作、镜头语言或视觉风格。

* 每项只包含 `POST /v1/files/videos` 返回的 `url`。
* 文件大小上限：**20 MB**。
* 每个文件的时长上限：**15 秒**。
* 参考视频的合计时长上限：**20 秒**。音频和视频的总时长分别计算。
* 不能与 `first_frame_image` 或 `last_frame_image` 同时使用。

**jobs\[].output\_format** `"mp4"`

可选。默认为 `"mp4"`。返回的 `video_url` 指向可直接下载或播放的 MP4 文件。

### 响应字段

响应 `data` 对象中的字段：

**results\[].job\_id** `string`

查询接口使用的任务 ID。

**results\[].status** `string`

任务初始状态，通常为 `queued`。

```bash 请求 theme={null}
curl -X POST https://api.vivix.ai/v1/videos/jobs \
  -H "Authorization: Bearer $VIVIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "vivix-w1-fast",
  "pe_mode": "standard",
  "seed": 12345,
  "jobs": [
    {
      "prompt": "A traveler crosses a windswept salt flat at sunset as the camera slowly pulls back.",
      "aspect_ratio": "16:9",
      "duration": 8,
      "output_format": "mp4"
    }
  ]
}'
```

```json 响应 theme={null}
{
  "code": 0,
  "message": "success",
  "data": {
    "results": [
      {
        "job_id": "job_xxxxxxxx",
        "status": "queued"
      }
    ]
  }
}
```

## 查询单个任务

返回单个任务的当前状态。终止状态的处理方式请参阅[任务生命周期](#world-task-lifecycle)。

**GET** `/v1/videos/jobs/{job_id}`

### 路径参数

**job\_id** `string` *required*

提交任务时返回的任务 ID。

### 响应字段

**job\_id** `string`

任务 ID。

**status** `string`

`queued` / `processing` / `succeeded` / `failed`.

**video\_url** `string`

已完成 MP4 视频的 URL。仅在任务成功时返回。

**aspect\_ratio** `string`

生成视频的宽高比。

**duration** `number`

请求的时长，单位为秒，原样返回。编码后的媒体可能略长。

**error** `object | null`

仅在任务失败时为非 null。`error.code` 为 `generation_failed`、`generation_timeout` 或 `generation_cancelled`。

**created\_at** `timestamp`

任务创建时间。

**updated\_at** `timestamp`

任务最近更新时间。

未知任务 ID 返回 `20005`（HTTP 404）。

```bash 请求 theme={null}
curl https://api.vivix.ai/v1/videos/jobs/job_xxxxxxxx \
  -H "Authorization: Bearer $VIVIX_API_KEY"
```

```json 响应 theme={null}
{
  "code": 0,
  "message": "success",
  "data": {
    "job_id": "job_xxxxxxxx",
    "status": "succeeded",
    "video_url": "https://static.vivi-x.ai/videos/2026/09/15/yyyyyyyyyyyyyyyy.mp4",
    "aspect_ratio": "16:9",
    "duration": 8,
    "error": null,
    "created_at": "2026-09-15T07:27:40.938208Z",
    "updated_at": "2026-09-15T07:28:45.207793Z"
  }
}
```

```json 失败的任务 theme={null}
{
  "code": 0,
  "message": "success",
  "data": {
    "job_id": "job_xxxxxxxx",
    "status": "failed",
    "aspect_ratio": "16:9",
    "duration": 8,
    "error": {
      "code": "generation_failed",
      "message": "Video generation failed"
    },
    "created_at": "2026-09-15T07:27:40.938208Z",
    "updated_at": "2026-09-15T07:31:02.771204Z"
  }
}
```

## 批量查询任务

在一次调用中返回多个 ID 对应的相同任务视图。结果遵循 `job_ids` 的顺序；未知 ID 不会出现在 `items` 中。

**POST** `/v1/videos/jobs/batch-get`

### 请求体参数

**job\_ids** `string[]` *required*

要查询的任务 ID。

### 响应字段

**items** `array`

任务对象，字段与 `GET /v1/videos/jobs/{job_id}` 相同。

```bash 请求 theme={null}
curl -X POST https://api.vivix.ai/v1/videos/jobs/batch-get \
  -H "Authorization: Bearer $VIVIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "job_ids": [
    "job_xxxxxxxx",
    "job_yyyyyyyy"
  ]
}'
```

```json 响应 theme={null}
{
  "code": 0,
  "message": "success",
  "data": {
    "items": [
      {
        "job_id": "job_xxxxxxxx",
        "status": "succeeded",
        "video_url": "https://static.vivi-x.ai/videos/2026/09/15/yyyyyyyyyyyyyyyy.mp4",
        "aspect_ratio": "16:9",
        "duration": 8,
        "error": null,
        "created_at": "2026-09-15T07:27:40.938208Z",
        "updated_at": "2026-09-15T07:28:45.207793Z"
      },
      {
        "job_id": "job_yyyyyyyy",
        "status": "processing",
        "aspect_ratio": "9:16",
        "duration": 10,
        "error": null,
        "created_at": "2026-09-15T07:30:11.102338Z",
        "updated_at": "2026-09-15T07:30:44.918227Z"
      }
    ]
  }
}
```

## 错误码

API 错误使用通用响应封装，并返回 `data: null`：

```json 错误响应 theme={null}
{
  "code": 20004,
  "message": "invalid parameter: jobs[0].duration must be an integer between 5 and 15",
  "data": null
}
```

| code | HTTP | 含义 |
| - | - | - |
| `10001` | 401 | 缺少 API 密钥。 |
| `10003` | 403 | API 密钥无效。 |
| `10004` / `10005` | 402 | 工作区计费未启用或余额不足。 |
| `10008` | 429 | 超过 API 频率限制。 |
| `20004` | 400 | 参数无效：模型不受支持、任务超过一个、缺少提示词或时长、时长超出 5–15、宽高比不受支持、输出格式不受支持、参考素材过多、参考 URL 无法访问，或包含未知字段。 |
| `20005` | 404 | 找不到任务。 |
| `20008` | 415 | 上传的媒体类型不受支持：检测到的文件内容不是支持的类型，或与声明的 Content-Type 不一致。不会检查文件扩展名。 |
| `30001` | 403 | 内容未通过审核。 |
| `30008` | 429 | 模型容量已满，请稍后重试。 |
| `50001` | 500 | 内部错误。 |
| `50003` | 503 | 服务不可用。 |

> [!NOTE]
>
> **两层错误。** 响应封装中的 `code` 表示提交和查询错误。即使任务以 `code = 0` 被接受，最终仍可能进入 `status = failed`，并携带 `error.code`。

联系支持团队时，请附上响应头中的 `X-Request-Id` 和 `X-Trace-Id`。


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