API 文档AI 模型接口视频Vidu

首尾帧

基于首帧与尾帧图像生成过渡视频。异步任务接口,提交后返回 task_id,需轮询生成物接口获取结果。

上传首帧与尾帧两张图片,模型生成从首帧过渡到尾帧的视频。支持 viduq3-providuq3-turboviduq2-providuq1 等模型。

异步任务型接口:提交后立即返回 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:

NameTypeRequiredDescription
modelstringYes模型名称。可选值:viduq3-turboviduq3-providuq2-pro-fastviduq2-providuq2-turboviduq1viduq1-classicvidu2.0
imagesstring[]Yes图像数组,必须 2 张:第一张为首帧,第二张为尾帧。两图分辨率需相近(首帧/尾帧比值在 0.8~1.25);比例小于 1:4 或 4:1;支持 URL 或 Base64;格式 png/jpeg/jpg/webp;大小 ≤ 50 MB;请求体 ≤ 20 MB
promptstringNo文本提示词,不超过 5000 字符。启用 is_rec 时忽略
is_recbooleanNo是否使用推荐提示词。true 时额外消耗 10 积分
durationintegerNo视频时长。q3 默认 5,可选 1–16;q2 系列默认 5,可选 1–8;viduq1 / viduq1-classic 仅 5;vidu2.0 默认 4,可选 4、8
seedintegerNo随机种子。不传或传 0 时使用随机数
resolutionstringNo分辨率,默认值依模型与时长而定
movement_amplitudestringNo运动幅度,默认 auto。q2、q3 系列不生效
audiobooleanNo是否音视频直出,默认 true。仅 q3 系列支持
bgmbooleanNo是否添加背景音乐,默认 false。q3 系列不生效
payloadstringNo透传参数,最多 1048576 个字符
off_peakbooleanNo错峰模式,默认 false
watermarkbooleanNo是否添加水印,默认不加
wm_positionintegerNo水印位置:1 左上、2 右上、3 右下(默认)、4 左下
wm_urlstringNo自定义水印图片 URL
meta_datastringNo元数据标识,JSON 格式字符串
callback_urlstringNo任务状态变化时的回调地址(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"
}

响应字段说明:

NameTypeDescription
task_idstring任务 ID
statestring处理状态:createdqueueingprocessingsuccessfailed
modelstring模型名称
imagesstring[]图像参数
promptstring提示词
durationinteger视频时长
seedinteger随机种子
resolutionstring分辨率
bgmboolean是否添加 BGM
movement_amplitudestring运动幅度
payloadstring透传参数
off_peakboolean是否错峰
creditsinteger消耗积分
watermarkboolean是否水印
created_atstring创建时间

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 会自动退款

目录