通用开放接口视频 API
GET /v1/videos/{task_id}
GET
/v1/videos/{task_id}查询视频任务状态。
鉴权:Bearer Token
Path 参数:task_id — 创建任务返回的 id
请求:无请求体
请求示例(curl)
curl https://www.yunsell.com/v1/videos/task_abc123xyz \ -H "Authorization: Bearer sk-xxx"响应体(生成中)
HTTP 200
{ "id": "task_abc123xyz", "object": "video", "model": "agnes-video-v2.0", "status": "in_progress", "progress": 45, "created_at": 1712697600, "seconds": "5.0", "size": "1280x704"}响应体(已完成)
HTTP 200
{ "id": "task_abc123xyz", "object": "video", "model": "agnes-video-v2.0", "status": "completed", "progress": 100, "created_at": 1712697600, "completed_at": 1712698200, "seconds": "5.0", "size": "1280x704", "remixed_from_video_id": "https://cdn.example.com/videos/video_abc.mp4", "error": null, "metadata": { "url": "https://cdn.example.com/videos/video_abc.mp4" }}响应体(失败)
HTTP 200
{ "id": "task_abc123xyz", "object": "video", "model": "agnes-video-v2.0", "status": "failed", "progress": 100, "created_at": 1712697600, "error": { "message": "upstream generation failed", "code": "generation_failed" }}响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 任务 ID,与创建时返回的 id 相同 |
object | string | 固定为 video |
model | string | 使用的模型 |
status | string | 任务状态,见 任务状态说明 |
progress | integer | 进度 0–100 |
created_at | integer | 创建时间 Unix 时间戳(秒) |
completed_at | integer | 完成时间 Unix 时间戳(秒);未完成时不返回 |
expires_at | integer | 结果过期时间 Unix 时间戳(秒);部分渠道返回 |
seconds | string | 视频时长(秒),如 "5.0" |
size | string | 视频分辨率,如 "1280x704" |
remixed_from_video_id | string | 视频结果 URL;部分渠道(如 Agnes AI)在此字段返回 CDN 地址 |
error | object / null | 失败时的错误信息;成功时为 null 或不返回 |
error.message | string | 失败原因描述 |
error.code | string | 错误码,如 generation_failed |
metadata | object | 扩展元数据,常见键见下表 |
**metadata 常见键**:
| 键 | 类型 | 说明 |
|---|---|---|
url | string | 视频结果 URL |
thumbnail_url | string | 封面图 URL |
duration | number | 实际时长(秒) |
width | integer | 视频宽度(像素) |
height | integer | 视频高度(像素) |
fps | integer | 帧率 |
seed | integer | 随机种子 |