Grok 任务查询
Grok 任务提交后,通过查询入口按任务 ID 轮询状态与结果,对外返回 OpenAI 风格 video 对象。
http
GET /v1/videos/{task_id}任务完成后从结果地址读取视频;若直接下载失败,可回退请求内容地址(见下方「轮询建议」)。
请求头
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
| string | 是 | 请求身份认证。使用 Bearer Token,示例: |
请求参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
| string | 是 | 路径参数,视频任务 ID,与生成接口返回的 id 一致 |
请求示例
bash
curl https://octopusx.ai/v1/videos/video_abc123 \
-H "Authorization: Bearer <token>"响应示例
json
{
"id": "video_abc123",
"object": "video",
"model": "grok-video-3",
"status": "processing",
"progress": 42,
"created_at": 1735689600,
"completed_at": 0,
"expires_at": 1735776000,
"seconds": "6",
"size": "720P",
"video_url": ""
}json
{
"id": "video_abc123",
"object": "video",
"model": "grok-video-3",
"status": "completed",
"progress": 100,
"created_at": 1735689600,
"completed_at": 1735689900,
"expires_at": 1735776000,
"seconds": "6",
"size": "720P",
"video_url": "https://example.com/video.mp4"
}json
{
"id": "video_abc123",
"object": "video",
"model": "grok-video-3",
"status": "failed",
"progress": 100,
"created_at": 1735689600,
"completed_at": 1735689700,
"expires_at": 1735776000,
"seconds": "6",
"size": "720P",
"error": {
"message": "Content policy violation",
"code": "content_policy"
},
"video_url": ""
}响应字段
| 名称 | 类型 | 说明 |
|---|---|---|
| string | 任务 ID | |
| string | 固定为 | |
| string | 任务状态:、、 等 | |
| integer | 进度百分比 | |
| integer | 完成时间戳 | |
| integer | 结果过期时间戳 | |
| string | 输出时长 | |
| string | 输出清晰度档位 | |
| string | 视频地址。完成时优先读取该字段,或兼容读取 | |
| object | 失败原因对象 |
轮询建议
结果地址按以下顺序读取:
如果直接下载返回的视频地址失败,再回退请求:
http
GET /v1/videos/{task_id}/content