主题
查询视频生成任务
GET/v1/video/generations/{task_id}
查询通用视频生成任务的状态与结果。
任务状态由网关后台轮询自动刷新,查询接口只读缓存,不触发上游实时查询。
路径参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| task_id | string | 是 | 提交时返回的任务 ID(task_ 开头) |
响应
json
{
"code": "success",
"message": "",
"data": {
"task_id": "task_5a1e9f0c8b7d6e5f4a3b2c1d0e9f8a7b",
"action": "generate",
"status": "succeeded",
"fail_reason": "",
"fail_code": "",
"url": "/v1/videos/task_5a1e9f0c8b7d6e5f4a3b2c1d0e9f8a7b/content",
"result_url": "https://cdn.example.com/video.mp4",
"submit_time": 1762399000,
"start_time": 1762399010,
"finish_time": 1762399500,
"progress": "100%"
}
}| 字段 | 说明 |
|---|---|
| status | queued(排队)/ processing(生成中)/ succeeded(成功)/ failed(失败) |
| action | 任务动作,如 generate / textGenerate / animate_first_last_frame |
| url | 成片网关代理地址,拼接站点域名访问:https://www.aiapi.hk/v1/videos/... |
| result_url | 上游直链(若上游提供) |
| fail_reason / fail_code | 失败原因与错误码 |
| progress | 进度百分比,如 "45%" |
示例
bash
curl https://www.aiapi.hk/v1/video/generations/task_5a1e9f0c8b7d6e5f4a3b2c1d0e9f8a7b \
-H "Authorization: Bearer sk-xxxxxxxx"任务不存在时返回 400:{"code":"invalid_param","message":"no task found"}。
