接口会根据传参里是否有imagese字段判断为图片生成视频, videos字段判断为视频生成视频任务状态#
NOT_START : 未开始
SUBMITTED : 已提交任务
QUEUED : 队列中
IN_PROGRESS : 正在执行
SUCCESS : 执行完成
FAILURE : 失败接口定义#
1. 提交#
scope: images\videos\audio
Post: /v2/{scope}/generations
例如: Post: /v2/videos/generationsheader:
Authorization: Bearer <API-Key>{
"prompt": "",
"model": "",
"duration": 5,
"aspect_ratio": "16:9",
"size": "",
"resolution": "780P",
"images": [""],
"videos": [""],
"watermark": false
......
}
{
"task_id": "f186f65a-8657-4e83-b0e3-67facf1b2576",
}
2. 获取#
Get: /v2/{scope}/generations/:task_idheader:
Authorization: Bearer <API-Key>{
"task_id": "f4a94d75-087b-4bb1-bd45-53ba293faf96",
"status": "SUCCESS",
"fail_reason": "",
"submit_time": 1716192124,
"start_time": 1716192124,
"finish_time": 1716192124,
"progress": "100%",
"data": {
"output": "",
"outputs": ["",""],
other...
}
}
使用示例#
获取 API-Key,为所有请求加
Authorization: Bearer <API-Key>2.
提交任务(POST /v2/{scope}/generations)
存在 images → 视为“图片生成视频”;存在 videos → 视为“视频生成视频”;都无 → 纯文生视频
{ "task_id": "f186f65a-8657-4e83-b0e3-67facf1b2576" }客户端每 2s → 4s → 8s 指数退避调用
GET /v2/{scope}/generations/:task_id当 status为 SUCCESS / FAILURE 即停止;
超过自定义超时(如 30 分钟)提示超时{
"task_id": "veo3:1756693796-YQVHH4A3Lg",
"platform": "google",
"action": "google-videos",
"status": "SUCCESS",
"fail_reason": "",
"submit_time": 1756693797,
"start_time": 1756693808,
"finish_time": 1756693898,
"progress": "100%",
"data": {
"output": "https://filesystem.site/cdn/20250901/018eg2SgUpHMT6EEuQbfeRLWeUhE75.mp4"
},
"search_item": ""
}
读取 data.output 或 data.outputs Modified at 2025-11-08 09:57:42