概述
Vidu Q2-Pro 高质量版,支持文生视频(t2v)、图生视频(i2v)、首尾帧生视频(se2v),视频时长 1-10 秒。
Base URL: https://api.apiverse.ai
认证方式
Authorization: Bearer {YOUR_AUTH_TOKEN}快速开始
创建文生视频任务
curl -X POST "https://api.apiverse.ai/api/v2/open/aigc/vidu-q2-pro" \
-H "Authorization: Bearer your_auth_token_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "无人机航拍,城市日落,金色光芒洒满高楼",
"genType": "t2v",
"resolution": "1080P",
"aspectRatio": "16:9",
"duration": 5
}'创建首尾帧生视频任务
curl -X POST "https://api.apiverse.ai/api/v2/open/aigc/vidu-q2-pro" \
-H "Authorization: Bearer your_auth_token_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "人物从站立到坐下的过渡动画",
"genType": "se2v",
"imageUrls": ["https://example.com/start_frame.jpg", "https://example.com/end_frame.jpg"],
"resolution": "1080P",
"duration": 5
}'查询任务状态
curl -X GET "https://api.apiverse.ai/api/v2/open/aigc/task_abc123" \
-H "Authorization: Bearer your_auth_token_here"创建任务
POST /api/v2/open/aigc/vidu-q2-pro
Content-Type: application/json
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| prompt | string | 是 | 提示词,最多1500字符 |
| genType | string | 否 | 生成类型,默认 t2v |
| imageUrls | string[] | 条件 | 参考图片URL(i2v: 1张, se2v: 2张) |
| base64File | string | 否 | Base64编码的图片(替代imageUrls) |
| base64FileList | string[] | 否 | Base64编码的多张图片 |
| resolution | string | 否 | 分辨率:720P / 1080P(默认) / 2K / 4K |
| aspectRatio | string | 否 | 宽高比:16:9(默认) / 9:16 / 1:1 / 4:3 / 3:4 |
| duration | int | 否 | 视频时长(秒),默认5,范围 1-10 |
| callbackUrl | string | 否 | 任务完成后的回调通知URL |
支持的 genType
| genType | 说明 | imageUrls 要求 |
|---|---|---|
| t2v | 文生视频 | 不需要 |
| i2v | 图生视频 | 1张图片 |
| se2v | 首尾帧生视频 | 2张图片(首帧+尾帧) |
请求示例
文生视频:
{
"prompt": "无人机航拍,城市日落,金色光芒洒满高楼",
"genType": "t2v",
"resolution": "1080P",
"aspectRatio": "16:9",
"duration": 8
}图生视频:
{
"prompt": "让图片中的花朵随风摇曳",
"genType": "i2v",
"imageUrls": ["https://example.com/flower.jpg"],
"resolution": "1080P",
"duration": 5
}首尾帧生视频:
{
"prompt": "人物从站立到坐下的自然过渡",
"genType": "se2v",
"imageUrls": [
"https://example.com/start_frame.jpg",
"https://example.com/end_frame.jpg"
],
"resolution": "1080P",
"duration": 5
}响应参数
| 参数 | 类型 | 说明 |
|---|---|---|
| code | int | 状态码,0 表示成功 |
| msg | string | 状态信息 |
| data.taskId | string | 任务 ID |
| data.status | string | 固定为 processing |
| data.createdAt | string | 创建时间 |
响应示例
{
"code": 0,
"msg": "success",
"data": {
"taskId": "task_20260507103000_abc12345",
"status": "processing",
"createdAt": "2026-05-07 10:30:00"
}
}查询任务状态
GET /api/v2/open/aigc/{taskId}
响应参数
| 参数 | 类型 | 说明 |
|---|---|---|
| code | int | 状态码,0 表示成功 |
| msg | string | 状态信息 |
| data.taskId | string | 任务 ID |
| data.status | string | processing / success / failed |
| data.result | string[] | 生成的视频 URL 列表(成功时返回) |
| data.errorMsg | string | 错误信息(失败时返回) |
| data.createdAt | string | 创建时间 |
| data.updatedAt | string | 更新时间 |
响应示例
{
"code": 0,
"msg": "success",
"data": {
"taskId": "task_20260507103000_abc12345",
"status": "success",
"result": [
"https://fc-gw-sh.oss-accelerate.aliyuncs.com/videos/2026/05/07/output_001.mp4"
],
"createdAt": "2026-05-07 10:30:00",
"updatedAt": "2026-05-07 10:32:30"
}
}批量查询任务状态
POST /api/v2/open/aigc/batch
{
"taskIds": ["task_20260507103000_abc12345", "task_20260507103200_def67890"]
}回调通知
当任务完成时,如果提供了 callbackUrl,系统会发送 POST 请求:
{
"event": "task.completed",
"taskId": "task_20260507103000_abc12345",
"status": "success",
"result": ["https://fc-gw-sh.oss-accelerate.aliyuncs.com/videos/output_001.mp4"],
"errorMsg": "",
"timestamp": "2026-05-07T10:32:30+08:00"
}错误码
| code | 说明 |
|---|---|
| 0 | 成功 |
| 10002 | 参数缺失或格式错误 |
| 10005 | API Key 无效或缺失 |
| 30003 | 任务不存在 |
| 90003 | 服务器内部错误 |