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

# Vidu Q4 Preview

> Vidu Q4 Preview：首帧图生视频与参考生视频（1 ~ 15 张参考图、0 ~ 3 段参考音频），3 ~ 16 秒，540P 到 4K，音画同出。

`viduq4` 是生数科技新一代旗舰视频模型 Vidu Q4 的预览版（2026 年 10 月发布），主打逼真的表演：人物神态、动作和对白更自然，并支持 10-bit 色深的 2K / 4K 输出。正式版发布前，生数会根据预览版的反馈继续调整。它提供两种模式：用一张首帧图片生成视频（图生视频），或用 1 \~ 15 张参考图加 0 \~ 3 段参考音频生成视频（参考生视频）。时长 3 \~ 16 秒，分辨率 540P 到 4K。默认音画同出，视频自带对白和音效；并能智能切换镜头，在多个镜头之间保持人物和场景一致。本模型不支持文生视频，也不支持首尾帧模式。

* **图生视频**：一张首帧图片生成视频。
* **参考生视频**：1 \~ 15 张参考图，可再加 0 \~ 3 段参考音频。
* **音画同出**：同步生成对白和音效，可用 `generate_audio` 关闭。
* **智能切镜**：自动切换镜头，多镜头间保持一致性。
* **规格**：3 \~ 16 秒，540P / 720P / 1080P / 2K / 4K。

## 能力一览

| 模式 | 参数 | 说明 |
| - | - | - |
| 图生视频（首帧） | `image_url`，可选 `prompt` | 仅一张首帧；输出比例跟随图片 |
| 参考生视频 | `prompt` + `reference_image_urls` | 1 \~ 15 张参考图，用 `aspect_ratio` 指定宽高比 |
| 参考生视频 + 参考音频 | `prompt` + `reference_image_urls` + `reference_audio_urls` | 0 \~ 3 段 mp3，单段 3 \~ 12 秒 |
| 文生视频 / 首尾帧 | — | 不支持 |

## 接口

接口为异步任务：创建任务后轮询查询，完成后从 `video_url` 下载视频。`model` 填 `viduq4`，生成参数全部放在 `input` 中。

| 接口 | 用途 |
| - | - |
| [`POST /v1/videos`](https://docs.dreamto.ai/api-reference/vidu-q4-preview/create-task) | 创建视频生成任务 |
| [`GET /v1/videos/{task_id}`](https://docs.dreamto.ai/api-reference/vidu-q4-preview/query-task) | 查询视频生成任务 |

## 快速开始

创建任务拿到 `task_id`，每 10 \~ 15 秒查询一次，`status` 为 `completed` 时从 `video_url` 下载视频。示例中的 `$DREAMTO_API_KEY` 为你的 API Key。

```bash cURL theme={null}
# 1. 创建任务
curl -X POST "https://api.dreamto.ai/v1/videos" \
  -H "Authorization: Bearer $DREAMTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "viduq4",
    "input": {
      "prompt": "女孩微笑着抚摸狐狸，微风，电影感",
      "image_url": "https://your-cdn.example.com/first-frame.png",
      "resolution": "1080P",
      "duration": 5
    }
  }'

# 2. 查询任务
curl "https://api.dreamto.ai/v1/videos/job_02b88886c4fda5be35baff61" \
  -H "Authorization: Bearer $DREAMTO_API_KEY"
```

```python Python theme={null}
import os
import time

import requests

BASE_URL = "https://api.dreamto.ai"
HEADERS = {"Authorization": f"Bearer {os.environ['DREAMTO_API_KEY']}"}

payload = {
    "model": "viduq4",
    "input": {
        "prompt": "女孩微笑着抚摸狐狸，微风，电影感",
        "image_url": "https://your-cdn.example.com/first-frame.png",
        "resolution": "1080P",
        "duration": 5
    }
}

task = requests.post(f"{BASE_URL}/v1/videos", headers=HEADERS, json=payload, timeout=60).json()
task_id = task["task_id"]
while task["status"] not in ("completed", "failed"):
    time.sleep(10)
    task = requests.get(f"{BASE_URL}/v1/videos/{task_id}", headers=HEADERS, timeout=60).json()
print(task["status"], task.get("video_url"), task.get("error"))
```

## 生成模式

### 图生视频（首帧）

`image_url` 传一张首帧图片，输出比例跟随图片。

```bash cURL theme={null}
curl -X POST "https://api.dreamto.ai/v1/videos" \
  -H "Authorization: Bearer $DREAMTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "viduq4",
    "input": {
      "prompt": "女孩微笑着抚摸狐狸，微风，电影感",
      "image_url": "https://your-cdn.example.com/first-frame.png",
      "resolution": "1080P",
      "duration": 5
    }
  }'
```

### 参考生视频

传 1 \~ 15 张参考图并写提示词，用 `aspect_ratio` 指定宽高比。

```bash cURL theme={null}
curl -X POST "https://api.dreamto.ai/v1/videos" \
  -H "Authorization: Bearer $DREAMTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "viduq4",
    "input": {
      "prompt": "女孩和狐狸夜晚坐在篝火旁，镜头在两者之间切换",
      "reference_image_urls": [
        "https://your-cdn.example.com/girl.png",
        "https://your-cdn.example.com/fox.png"
      ],
      "resolution": "720P",
      "duration": 8,
      "aspect_ratio": "9:16"
    }
  }'
```

### 参考生视频 + 参考音频

在参考图之外再传 0 \~ 3 段参考音频（mp3，单段 3 \~ 12 秒）。

```bash cURL theme={null}
curl -X POST "https://api.dreamto.ai/v1/videos" \
  -H "Authorization: Bearer $DREAMTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "viduq4",
    "input": {
      "prompt": "女孩对着狐狸说话，声音参考音频，狐狸歪头回应",
      "reference_image_urls": [
        "https://your-cdn.example.com/girl.png",
        "https://your-cdn.example.com/fox.png"
      ],
      "reference_audio_urls": [
        "https://your-cdn.example.com/voice.mp3"
      ],
      "resolution": "720P",
      "duration": 5,
      "aspect_ratio": "16:9"
    }
  }'
```

### 无声视频与生成选项

`generate_audio: false` 生成无声视频；`enhance_prompt` 让模型优化提示词；`seed` 固定随机种子。

```bash cURL theme={null}
curl -X POST "https://api.dreamto.ai/v1/videos" \
  -H "Authorization: Bearer $DREAMTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "viduq4",
    "input": {
      "prompt": "狐狸在雪地里奔跑，镜头跟随",
      "image_url": "https://your-cdn.example.com/first-frame.png",
      "resolution": "540P",
      "duration": 3,
      "generate_audio": false,
      "enhance_prompt": true,
      "seed": 20261116
    }
  }'
```

## 参数

以下参数都放在请求体的 `input` 中。

| 参数 | 类型 | 必填 | 默认值 | 取值 | 说明 |
| - | - | - | - | - | - |
| `prompt` | string | 否 | — | — | 提示词，描述视频的内容、动作和镜头。参考生视频时必填。 |
| `image_url` | string（图片 URL） | 否 | — | — | 首帧图片的公网 URL（仅一张），传入后为图生视频，不能与 `reference_image_urls` 同时使用。支持 jpeg / jpg / png，不超过 10MB。 |
| `reference_image_urls` | string\[] | 否 | — | 1 \~ 15 个 | 参考图片的公网 URL 列表，1 \~ 15 张，传入后为参考生视频，不能与 `image_url` 同时使用。支持 png / jpeg / jpg / webp。 |
| `reference_audio_urls` | string\[] | 否 | — | 最多 3 个 | 参考音频的公网 URL 列表，0 \~ 3 段，只能与 `reference_image_urls` 一起使用。支持 mp3，单段 3 \~ 12 秒。 |
| `resolution` | string | 否 | `720P` | `540P` / `720P` / `1080P` / `2K` / `4K` | 输出分辨率，默认 `720P`。 |
| `duration` | integer | 否 | `5` | `3` \~ `16` | 输出视频时长，单位秒，`3` \~ `16` 的整数，默认 `5`。 |
| `aspect_ratio` | string | 否 | — | `16:9` / `9:16` / `1:1` / `4:3` / `3:4` | 输出宽高比，仅参考生视频有效。传入首帧图片时输出比例跟随图片。 |
| `generate_audio` | boolean | 否 | — | `true` / `false` | 是否音画同出：同步生成带对白和音效的声音，默认开启。传 `false` 生成无声视频。 |
| `enhance_prompt` | boolean | 否 | — | `true` / `false` | 是否由模型自动优化提示词。 |
| `seed` | integer | 否 | — | — | 随机种子，整数；不传则随机。 |

完整的请求与响应定义见 [创建视频生成任务](https://docs.dreamto.ai/api-reference/vidu-q4-preview/create-task.md)。

## 响应与任务状态

创建任务返回 `task_id`、`status`、`model`、`created_at` 和 `request_id`。查询任务在此基础上返回 `completed_at`（任务结束后）、`video_url`（成功时）和 `error`（失败时）。

| `status` | 含义 |
| - | - |
| `queued` | 排队中。 |
| `in_progress` | 生成中。 |
| `completed` | 生成成功，从 `video_url` 下载视频。 |
| `failed` | 生成失败，原因见 `error`，不扣费。 |

生成成功的查询响应：

```json theme={null}
{
  "task_id": "job_02b88886c4fda5be35baff61",
  "status": "completed",
  "model": "viduq4",
  "created_at": 1794846663,
  "completed_at": 1794847019,
  "request_id": "req_6a9a539502118ba1c33f1bfc",
  "video_url": "https://cdn.example.com/videos/02b88886c4fda5be35baff61.mp4"
}
```

生成失败的查询响应：

```json theme={null}
{
  "task_id": "job_02b88886c4fda5be35baff61",
  "status": "failed",
  "model": "viduq4",
  "created_at": 1794846663,
  "completed_at": 1794847019,
  "request_id": "req_6a9a539502118ba1c33f1bfc",
  "error": {
    "type": "api_error",
    "message": "InvalidParameterValue: Please input the ImageURL that can be retrieved from the external network."
  }
}
```

## 计费

按输出视频时长（秒）× 所选分辨率的单价计费。

| 分辨率 | 美元 / 秒 | 人民币 / 秒 |
| - | - | - |
| 540P | \$0.040179 | ¥0.28125 |
| 720P | \$0.084821 | ¥0.59375 |
| 1080P | \$0.107143 | ¥0.75 |
| 2K | \$0.169643 | ¥1.1875 |
| 4K | \$0.348214 | ¥2.4375 |

以上为刊例价，实际价格以控制台显示的模型价格为准。生成失败的任务和参数错误的请求不扣费。

## 限制与注意事项

* `video_url` 自任务完成起 7 天内有效，请及时下载并保存到自己的存储。
* 输入素材的 URL 必须能从中国大陆的公网直接访问。托管在 `raw.githubusercontent.com`、`upload.wikimedia.org` 等站点的图片会下载失败：任务以 `failed` 结束，不扣费。
* 默认音画同出；传 `generate_audio: false` 生成无声视频。
* `image_url` 与 `reference_image_urls` 只能二选一；`reference_audio_urls` 只能和 `reference_image_urls` 一起使用。
* 没有文生视频模式：请求必须带 `image_url` 或 `reference_image_urls`。也没有首尾帧模式。
* `aspect_ratio` 只对参考生视频有效；传入首帧图片时输出比例跟随图片。
* 失败的任务返回 `status: "failed"`，原因在 `error.message` 中（例如 `InvalidParameterValue: Please input the ImageURL that can be retrieved from the external network.`），不扣费。
* 创建任务时按请求的预估价格（分辨率单价 × 时长）预先冻结余额，任务完成后按实际用量结算。余额不足时创建请求直接返回 HTTP 402（`insufficient_balance`），不创建任务。
* 参数不合法的请求返回 HTTP 400，不创建任务、不扣费。时长和素材数量超出范围时，错误信息会指出字段和允许范围（形如 `input.duration must be a number between <最小值> and <最大值>`）；`resolution`、`aspect_ratio` 等枚举参数取值不在允许列表内时，错误信息是通用的，不会指出具体字段，请对照参数表检查。素材格式和内容由模型校验：不符合要求时任务以 `failed` 结束，同样不扣费。
* 视频生成需要数分钟，建议每 10 \~ 15 秒查询一次任务，不要更频繁。


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