查询:任务结果
pika 视频任务结果查询接口,用于获取生成任务的详细状态和视频产出信息。
概览
- 请求方法:
GET - 请求路径:
/pika/feed/{task_id} - 内容类型:
application/json - 分类:视频模型(Video)/pika视频
认证方式
- Header:
Authorization: Bearer <token>
路径参数
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
| task_id | string | 是 | 已生成视频的任务 ID |
请求示例
curl 示例
bash
curl -X GET "https://api.gpt.ge/pika/feed/your_task_id" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $YOUR_TOKEN"JavaScript (fetch) 示例
javascript
fetch('https://api.gpt.ge/pika/feed/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/pika/feed/your_task_id',
headers={
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
}
)
print(resp.json())返回字段说明
| 字段 | 类型 | 描述 |
|---|---|---|
| id | string | 任务 ID |
| promptText | string | 提示词 |
| videos | array | 视频结果列表 |
| videos[].id | string | 单个视频项目 ID |
| videos[].status | string | 当前状态,queued, pending, finished, error |
| videos[].seed | integer | 随机种子 |
| videos[].resultUrl | string | 视频结果 URL |
| videos[].sharingUrl | string | 分享地址 |
| videos[].videoPoster | string | 视频封面地址 |
| videos[].imageThumb | string | 缩略图地址 |
| videos[].duration | integer | 视频时长(秒) |
| videos[].error | string | 错误信息 |
| videos[].progress | integer | 当前进度百分比 |
返回示例(200)
json
{
"id": "c8091b7b-06df-48ed-8fe3-8ee8f1e367c2",
"promptText": "苹果蒸发",
"videos": [
{
"id": "c8091b7b-06df-48ed-8fe3-8ee8f1e367c2",
"status": "finished",
"progress": 100,
"seed": 393769667,
"resultUrl": "https://cdn.pika.art/v1/c8091b7b-06df-48ed-8fe3-8ee8f1e367c2/_____seed393769667.mp4",
"sharingUrl": "https://cdn.pika.art/v1/c8091b7b-06df-48ed-8fe3-8ee8f1e367c2/_____seed393769667_share.mp4",
"videoPoster": "https://cdn.pika.art/v1/c8091b7b-06df-48ed-8fe3-8ee8f1e367c2/poster.jpg",
"imageThumb": "https://cdn.pika.art/v1/c8091b7b-06df-48ed-8fe3-8ee8f1e367c2/thumbnail.jpg",
"duration": 5
}
]
}