Skip to content

查询:任务结果

pika 视频任务结果查询接口,用于获取生成任务的详细状态和视频产出信息。


概览

  • 请求方法:GET
  • 请求路径:/pika/feed/{task_id}
  • 内容类型:application/json
  • 分类:视频模型(Video)/pika视频

认证方式

  • Header:Authorization: Bearer <token>

路径参数

参数类型必填描述
task_idstring已生成视频的任务 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())

返回字段说明

字段类型描述
idstring任务 ID
promptTextstring提示词
videosarray视频结果列表
videos[].idstring单个视频项目 ID
videos[].statusstring当前状态,queued, pending, finished, error
videos[].seedinteger随机种子
videos[].resultUrlstring视频结果 URL
videos[].sharingUrlstring分享地址
videos[].videoPosterstring视频封面地址
videos[].imageThumbstring缩略图地址
videos[].durationinteger视频时长(秒)
videos[].errorstring错误信息
videos[].progressinteger当前进度百分比

返回示例(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
    }
  ]
}