API 文档AI 模型接口视频Vidu
首尾帧
基于首帧与尾帧图像生成过渡视频。异步任务接口,提交后返回 task_id,需轮询生成物接口获取结果。
上传首帧与尾帧两张图片,模型生成从首帧过渡到尾帧的视频。支持 viduq3-pro、viduq3-turbo、viduq2-pro、viduq1 等模型。
异步任务型接口:提交后立即返回 task_id,需轮询查询生成物接口获取结果。
Base URL
https://api.autorouter.top— Production
Authentication
BearerAuth: http (bearer)
使用 Bearer Token 认证。
格式: Authorization: Bearer sk-xxxxxx
Endpoints
POST /vidu/ent/v2/start-end2video
创建首尾帧生视频任务
以首帧图与尾帧图创建视频生成任务。images 中第一张为首帧,第二张为尾帧。
Request Body
Content-Type: application/json
Example:
{
"model": "viduq3-pro",
"images": [
"https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/startend2video-1.jpeg",
"https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/startend2video-2.jpeg"
],
"prompt": "The camera zooms in on the bird, which then flies to the right. With its flight being smooth and natural, the bird soars in the sky. with a red light effect following and surrounding it from behind.",
"duration": 5,
"seed": 0,
"resolution": "1080p",
"audio": true,
"off_peak": false
}Properties:
| Name | Type | Required | Description |
|---|---|---|---|
model | string | Yes | 模型名称。可选值:viduq3-turbo、viduq3-pro、viduq2-pro-fast、viduq2-pro、viduq2-turbo、viduq1、viduq1-classic、vidu2.0 |
images | string[] | Yes | 图像数组,必须 2 张:第一张为首帧,第二张为尾帧。两图分辨率需相近(首帧/尾帧比值在 0.8~1.25);比例小于 1:4 或 4:1;支持 URL 或 Base64;格式 png/jpeg/jpg/webp;大小 ≤ 50 MB;请求体 ≤ 20 MB |
prompt | string | No | 文本提示词,不超过 5000 字符。启用 is_rec 时忽略 |
is_rec | boolean | No | 是否使用推荐提示词。true 时额外消耗 10 积分 |
duration | integer | No | 视频时长。q3 默认 5,可选 1–16;q2 系列默认 5,可选 1–8;viduq1 / viduq1-classic 仅 5;vidu2.0 默认 4,可选 4、8 |
seed | integer | No | 随机种子。不传或传 0 时使用随机数 |
resolution | string | No | 分辨率,默认值依模型与时长而定 |
movement_amplitude | string | No | 运动幅度,默认 auto。q2、q3 系列不生效 |
audio | boolean | No | 是否音视频直出,默认 true。仅 q3 系列支持 |
bgm | boolean | No | 是否添加背景音乐,默认 false。q3 系列不生效 |
payload | string | No | 透传参数,最多 1048576 个字符 |
off_peak | boolean | No | 错峰模式,默认 false |
watermark | boolean | No | 是否添加水印,默认不加 |
wm_position | integer | No | 水印位置:1 左上、2 右上、3 右下(默认)、4 左下 |
wm_url | string | No | 自定义水印图片 URL |
meta_data | string | No | 元数据标识,JSON 格式字符串 |
callback_url | string | No | 任务状态变化时的回调地址(POST) |
Responses
200: 成功创建任务
Content-Type: application/json
400: 请求参数错误
Content-Type: application/json
429: 请求频率限制
Content-Type: application/json
请求示例
curl -X POST "https://api.autorouter.top/vidu/ent/v2/start-end2video" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-xxxxxx" \
-d '{
"model": "viduq3-pro",
"images": [
"https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/startend2video-1.jpeg",
"https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/startend2video-2.jpeg"
],
"prompt": "The camera zooms in on the bird, which then flies to the right.",
"duration": 5,
"seed": 0,
"resolution": "1080p",
"audio": true,
"off_peak": false
}'响应示例
{
"task_id": "your_task_id_here",
"state": "created",
"model": "viduq3-pro",
"images": [
"https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/startend2video-1.jpeg",
"https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/startend2video-2.jpeg"
],
"prompt": "The camera zooms in on the bird, which then flies to the right.",
"duration": 5,
"seed": 123456,
"resolution": "1080p",
"audio": true,
"payload": "",
"off_peak": false,
"credits": 4,
"created_at": "2025-01-01T15:41:31.968916Z"
}响应字段说明:
| Name | Type | Description |
|---|---|---|
task_id | string | 任务 ID |
state | string | 处理状态:created、queueing、processing、success、failed |
model | string | 模型名称 |
images | string[] | 图像参数 |
prompt | string | 提示词 |
duration | integer | 视频时长 |
seed | integer | 随机种子 |
resolution | string | 分辨率 |
bgm | boolean | 是否添加 BGM |
movement_amplitude | string | 运动幅度 |
payload | string | 透传参数 |
off_peak | boolean | 是否错峰 |
credits | integer | 消耗积分 |
watermark | boolean | 是否水印 |
created_at | string | 创建时间 |
GET /vidu/ent/v2/tasks/{id}/creations
查询生成物
详见查询生成物接口。
请求示例
curl -X GET "https://api.autorouter.top/vidu/ent/v2/tasks/{task_id}/creations" \
-H "Authorization: Bearer sk-xxxxxx"错误处理
HTTP 400 参数错误(提交前拦截,不扣费)
| 场景 | 响应 |
|---|---|
未传 2 张 images | {"code":"InvalidParameter","message":"...","request_id":"..."} |
| 未知模型名 | {"code":"InvalidParameter","message":"unknown model: ...","request_id":"..."} |
HTTP 401 / 403 鉴权错误
401 Unauthorized:API Key 无效或已过期403 Forbidden:API Key 无权访问此模型
HTTP 402 余额不足
返回 insufficient user quota。请前往 AutoRouter 控制台充值。
任务 failed 状态
任务失败时见 err_code。失败时 AutoRouter 会自动退款。