查询视频状态
Sora 视频状态查询接口,用于查看指定视频任务的当前状态和结果信息。
概览
- 请求方法:
GET - 请求路径:
/v1/videos/{task_id} - 内容类型:
application/json - 分类:视频模型(Video)/sora视频
认证方式
- Header:
Authorization: Bearer <token>
路径参数
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
| task_id | string | 是 | 视频任务 ID |
请求示例
curl 示例
bash
curl -X GET "https://api.gpt.ge/v1/videos/your_task_id" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $YOUR_TOKEN"JavaScript (fetch) 示例
javascript
fetch('https://api.gpt.ge/v1/videos/your_task_id', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
}
})
.then(res => res.json())
.then(console.log)Python 示例(requests)
python
import requests
resp = requests.get(
'https://api.gpt.ge/v1/videos/your_task_id',
headers={
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
}
)
print(resp.json())返回字段说明
| 字段 | 类型 | 描述 |
|---|---|---|
| id | string | 视频任务 ID |
| object | string | 返回对象类型,一般为 video |
| created_at | integer | 创建时间戳 |
| status | string | 任务状态 |
| completed_at | integer | 完成时间戳 |
| error | null | 错误信息,成功时为 null |
| expires_at | integer | 过期时间戳 |
| model | string | 使用的模型 |
| progress | integer | 任务进度 |
| remixed_from_video_id | null | remix 源视频 ID,当前未使用时为 null |
| seconds | string | 视频时长 |
| size | string | 视频尺寸 |
返回示例(200)
json
{
"id": "video_68f082321ed08193a4eaf01376fa10bc0284bd663de64dc5",
"object": "video",
"created_at": 1760592434,
"status": "completed",
"completed_at": 1760592506,
"error": null,
"expires_at": 1760596106,
"model": "sora-2",
"progress": 100,
"remixed_from_video_id": null,
"seconds": "4",
"size": "720x1280"
}