百炼 · 视频生成(异步)
已接入 13 个视频模型,覆盖文生视频 / 图生视频 / 参考生视频 / 首尾帧 / 动作迁移 / 人物替换 / 视频编辑 / 数字人 / 视频超清。
一、提交任务
POST /api/v1/services/aigc/video-generation/video-synthesis
Authorization: Bearer <YOUR_API_KEY>
Content-Type: application/json
请求体只需带 model 与对应业务字段,平台会按模型族自动组装官方参数。
文生视频(t2v)
{ "model": "wan3.0-video", "prompt": "雪山日出延时摄影,镜头缓慢推进", "seconds": 5, "resolution": "720P" }
图生视频(i2v)
{ "model": "wan2.7-i2v", "prompt": "让画面里的人物微笑并眨眼", "image_url": "https://example.com/a.jpg", "seconds": 5, "resolution": "720P" }
参考生视频(r2v,最多 5~9 张参考图)
{ "model": "happyhorse-1.1-r2v", "prompt": "同一个女孩在海边散步", "reference_urls": ["https://example.com/1.jpg"], "seconds": 5, "resolution": "720P" }
首尾帧生视频(kf2v,最省)
{ "model": "wan2.2-kf2v-flash", "first_frame_url": "https://example.com/a.jpg", "last_frame_url": "https://example.com/b.jpg", "seconds": 5, "resolution": "720P" }
动作迁移 / 人物替换(animate)
{ "model": "wan2.2-animate-move", "image_url": "https://example.com/person.jpg", "video_url": "https://example.com/motion.mp4", "level": "pro", "seconds": 5 }
- 动作迁移:
wan2.2-animate-move(std 40 / pro 60 点/秒) - 人物替换:
wan2.2-animate-mix(std 60 / pro 90 点/秒) - 标准版(应用类)与 Pro 版(百炼万相)两条路径均可选,按效果与预算自行选择。
视频编辑(videoedit)
{ "model": "wan2.7-videoedit", "prompt": "把画面中的白天改成黄昏", "video_url": "https://example.com/in.mp4", "seconds": 5, "resolution": "720P" }
数字人(s2v)/ 肖像动画
{ "model": "wan2.2-s2v", "image_url": "https://example.com/p.jpg", "audio_url": "https://example.com/a.mp3", "seconds": 5, "resolution": "720P" }
liveportrait(肖像动态视频)按秒计费 2 点/秒,适合批量低成本的"人物动起来"场景。
二、提交响应
{
"code": 1,
"msg": "success",
"data": { "task_id": "2f765d54-…", "status": "pending", "frozen_points": 150 }
}
frozen_points 为冻结点数(按 seconds × 分辨率档位计算),非最终扣费。
三、查询与结算
curl "https://api.a7w.cn/api/v1/tasks/2f765d54-…" -H "Authorization: Bearer $API_KEY"
{ "code": 1, "msg": "success", "data": { "task_id": "2f765d54-…", "status": "SUCCEEDED", "url": "https://…" } }
| 状态 | 处理 |
|---|---|
PENDING / RUNNING | 继续轮询(建议 5~10 秒一次) |
SUCCEEDED | 按实际视频时长结算,多退少补 |
FAILED / CANCELED | 自动全额退回冻结点数 |
四、视频超清
pixverse/pixverse-upscale:18 点/秒。
五、常见错误
| 返回 | 原因与处理 |
|---|---|
unpriced_model | 该模型尚未定价,请联系平台管理员 |
insufficient_points | 点数不足,返回所需点数与当前余额 |
upstream_error + 未开通提示 | 模型未在百炼控制台开通,去模型广场免费开通后重试 |
task_id_required | 查询任务时未带 task_id |
六、视频模型价格速查(点/秒)
| 模型 | 480P | 720P | 1080P |
|---|---|---|---|
wan2.2-kf2v-flash | 10 | 20 | 48 |
wan3.0-video | 30 | 60 | 120 |
wan2.7-t2v / wan2.7-i2v / wan2.7-r2v / wan2.7-videoedit | — | 60 | 100 |
happyhorse-1.1-t2v / i2v / r2v | 45 | 90 | 120 |
wan2.2-s2v | 50 | 90 | — |
happyhorse-1.0-video-edit | — | 90 | 160 |
wan3.0-video 单次最长 30 秒。