查询:单个任务
luma 视频任务查询接口,用于获取指定任务的状态和生成结果。
概览
- 请求方法:
GET - 请求路径:
/luma/generations/{task_id} - 内容类型:
application/json - 分类:视频模型(Video)/luma视频
认证方式
- Header:
Authorization: Bearer <token>
路径参数
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
| task_id | string | 是 | 生成视频的任务 ID |
请求示例
curl 示例
bash
curl -X GET "https://api.gpt.ge/luma/generations/your_task_id" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $YOUR_TOKEN"JavaScript (fetch) 示例
javascript
fetch('https://api.gpt.ge/luma/generations/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/luma/generations/your_task_id',
headers={
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
}
)
print(resp.json())返回字段说明
| 字段 | 类型 | 描述 |
|---|---|---|
| id | string | 任务 ID |
| state | string | 任务状态 |
| video | object | 生成后的视频信息 |
| video.url | string | 视频地址 |
| video.width | integer | 视频宽度 |
| video.height | integer | 视频高度 |
| video.download_url | string | 视频下载地址 |
| request | object | 原始请求信息 |
| request.prompt | string | 提示词 |
| request.aspect_ratio | string | 尺寸比 |
| artifact | object | 生成任务的产物集合 |
| artifact.video | object | 产物视频信息 |
| artifact.thumbnail | object | 生成的缩略图信息 |
| artifact.video_raw | object | 原始视频信息 |
| artifact.created_at | string | 产物创建时间 |
| artifact.last_frame | object | 最后一帧信息 |
| thumbnail | object | 缩略图信息 |
| video_raw | object | 原始视频信息(重复字段) |
| created_at | string | 任务创建时间 |
| last_frame | object | 最后一帧信息 |
| failure_reason | string/null | 失败原因,成功时为 null |
返回示例(200)
json
{
"id": "e70fdf3c-ce95-4dd1-a967-220ce957aff5",
"state": "completed",
"video": {
"url": "https://storage.cdn-luma.com/dream-machine/907ef9be-7057-45de-9867-099d6aba37b7/6ece4f7a-f60a-442c-9ad2-84132a528741/video0bb8885f3511c4b7bad55c117405a2875.mp4",
"width": 1360,
"height": 752,
"download_url": "https://storage.cdn-luma.com/dream-machine/907ef9be-7057-45de-9867-099d6aba37b7/6ece4f7a-f60a-442c-9ad2-84132a528741/video0bb8885f3511c4b7bad55c117405a2875.mp4"
},
"request": {
"prompt": "美人鱼",
"aspect_ratio": "16:9"
},
"artifact": {
"video": {
"url": "https://storage.cdn-luma.com/dream-machine/907ef9be-7057-45de-9867-099d6aba37b7/6ece4f7a-f60a-442c-9ad2-84132a528741/video0bb8885f3511c4b7bad55c117405a2875.mp4",
"width": 1360,
"height": 752,
"download_url": "https://storage.cdn-luma.com/dream-machine/907ef9be-7057-45de-9867-099d6aba37b7/6ece4f7a-f60a-442c-9ad2-84132a528741/video0bb8885f3511c4b7bad55c117405a2875.mp4"
},
"thumbnail": {
"url": "https://imagedelivery.net/1KomXrSWiTojGGip43n0SQ/3d9fbfa9-6146-4eb9-3798-ac923a2a0e00/public",
"width": 1360,
"height": 752,
"palette": {
"grid": "CpCVPb67UdHMHbW0F42QHWBmX2FcJLSxAKipHH6DTFVTcU9GWpqdHJykU2lyel9MWEU/UF9vRH+aSFlrcVVOcVVISVFFSG97S1dp"
},
"media_type": "image"
},
"video_raw": {
"url": "https://storage.cdn-luma.com/dream-machine/907ef9be-7057-45de-9867-099d6aba37b7/6ece4f7a-f60a-442c-9ad2-84132a528741/video0bb8885f3511c4b7bad55c117405a2875.mp4",
"width": 1360,
"height": 752,
"duration": 5.041667,
"media_type": "video"
},
"created_at": "0001-01-01T00:00:00Z",
"last_frame": {
"url": "https://storage.cdn-luma.com/dream-machine/907ef9be-7057-45de-9867-099d6aba37b7/543b6898-5179-4477-bc9f-f6507c7cde97/video_0_last_frame.jpg",
"width": 1360,
"height": 752,
"palette": null,
"media_type": "image"
}
},
"thumbnail": {
"url": "https://imagedelivery.net/1KomXrSWiTojGGip43n0SQ/3d9fbfa9-6146-4eb9-3798-ac923a2a0e00/public",
"width": 1360,
"height": 752,
"palette": {
"grid": "CpCVPb67UdHMHbW0F42QHWBmX2FcJLSxAKipHH6DTFVTcU9GWpqdHJykU2lyel9MWEU/UF9vRH+aSFlrcVVOcVVISVFFSG97S1dp"
},
"media_type": "image"
},
"video_raw": {
"url": "https://storage.cdn-luma.com/dream-machine/907ef9be-7057-45de-9867-099d6aba37b7/6ece4f7a-f60a-442c-9ad2-84132a528741/video0bb8885f3511c4b7bad55c117405a2875.mp4",
"width": 1360,
"height": 752,
"duration": 5.041667,
"media_type": "video"
},
"created_at": "2024-12-24T18:01:25.319Z",
"last_frame": {
"url": "https://storage.cdn-luma.com/dream-machine/907ef9be-7057-45de-9867-099d6aba37b7/543b6898-5179-4477-bc9f-f6507c7cde97/video_0_last_frame.jpg",
"width": 1360,
"height": 752,
"palette": null,
"media_type": "image"
},
"failure_reason": null
}