查询:单个任务
Runway 任务查询接口,用于获取指定任务的状态和输出结果。
概览
- 请求方法:
GET - 请求路径:
/runwayml/v1/tasks/{task_id} - 内容类型:
application/json - 分类:视频模型(Video)/runway 官方API
认证方式
- Header:
Authorization: Bearer <token> - 额外 Header:
X-Runway-Version: 2024-11-06
路径参数
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
| task_id | string | 是 | 查询的任务 ID |
请求示例
curl 示例
bash
curl -X GET "https://api.gpt.ge/runwayml/v1/tasks/your_task_id" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $YOUR_TOKEN" \
-H "X-Runway-Version: 2024-11-06"JavaScript (fetch) 示例
javascript
fetch('https://api.gpt.ge/runwayml/v1/tasks/your_task_id', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN',
'X-Runway-Version': '2024-11-06'
}
})
.then(res => res.json())
.then(console.log)Python 示例(requests)
python
import requests
resp = requests.get(
'https://api.gpt.ge/runwayml/v1/tasks/your_task_id',
headers={
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN',
'X-Runway-Version': '2024-11-06'
}
)
print(resp.json())返回字段说明
| 字段 | 类型 | 描述 |
|---|---|---|
| id | string | 任务 ID |
| status | string | 任务状态,可能值为 PENDING, THROTTLED, RUNNING, SUCCEEDED, FAILED, CANCELLED |
| createdAt | string | 任务创建时间 |
| output | array[string] | 任务输出结果数组,可能包含视频 URL |
| progress | number | 任务进度,浮点数,可为空 |
返回示例(200)
json
{
"id": "2272f1f2-dbb8-4083-a126-d9a8f0524bb2",
"status": "SUCCEEDED",
"createdAt": "2024-11-30T07:06:07.912Z",
"output": [
"https://dnznrvs05pmza.cloudfront.net/ad0e7fa4-9ab6-4dd6-9269-b401fc71c385.mp4?_jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXlIYXNoIjoiMzgzYTZlZjczYjg5OGUyNCIsImJ1Y2tldCI6InJ1bndheS10YXNrLWFydGlmYWN0cyIsInN0YWdlIjoicHJvZCIsImV4cCI6MTczMzA5NzYwMH0.Wu7X9F6wyR4TrTUIuShCdeo2o8YNe6MSGtzvP4qEDs0"
]
}