视频生成
创建 AI 视频生成任务,支持文生视频和图生视频。
请求
POST /v1/videos/generations
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | ✅ | 模型名称,如 GV-3.1、Kling-2.1 |
prompt | string | 条件 | 视频描述(无参考图时必填) |
file_infos | array | ❌ | 参考图片列表(图生视频) |
duration | number | ❌ | 视频时长(秒),不同模型默认值不同 |
resolution | string | ❌ | 分辨率:720P / 1080P |
output_config | object | ❌ | 高级输出配置 |
output_config 参数
| 参数 | 类型 | 说明 |
|---|---|---|
Duration | number | 视频时长(秒) |
Resolution | string | 720P / 1080P |
AspectRatio | string | 16:9 / 9:16 / 1:1 |
AudioGeneration | string | 音频生成:Enabled / Disabled |
各模型时长规格
| 模型 | 可选时长(秒) | 默认 |
|---|---|---|
| GV-3.1 | 8 | 8 |
| Kling-2.1 | 5 / 10 | 5 |
| Hailuo-2.3 | 6 / 10 | 6 |
| Vidu-q2 | 1~10 | 4 |
请求示例
文生视频
curl -X POST https://pico.5884.cn/v1/videos/generations \
-H "Authorization: Bearer sk-你的密钥" \
-H "Content-Type: application/json" \
-d '{
"model": "GV-3.1",
"prompt": "一只金毛犬在海边奔跑,慢动作,电影质感",
"output_config": {
"Resolution": "1080P",
"AspectRatio": "16:9",
"AudioGeneration": "Enabled"
}
}'
图生视频
curl -X POST https://pico.5884.cn/v1/videos/generations \
-H "Authorization: Bearer sk-你的密钥" \
-H "Content-Type: application/json" \
-d '{
"model": "Kling-2.1",
"prompt": "让画面中的人物缓缓转头微笑",
"file_infos": [
{"Type": "Url", "Url": "https://example.com/portrait.jpg"}
]
}'
响应
{
"task_id": "1403290248-AigcVideoTask-xxxx",
"status": "pending",
"model": "GV-3.1",
"message": "任务已提交,使用 task_id 轮询结果"
}
info
视频生成耗时较长(通常 30s~3min),请使用 任务查询接口 轮询获取结果。