Skip to content

查询:单个任务

luma 视频任务查询接口,用于获取指定任务的状态和生成结果。


概览

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

认证方式

  • Header:Authorization: Bearer <token>

路径参数

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

返回字段说明

字段类型描述
idstring任务 ID
statestring任务状态
videoobject生成后的视频信息
video.urlstring视频地址
video.widthinteger视频宽度
video.heightinteger视频高度
video.download_urlstring视频下载地址
requestobject原始请求信息
request.promptstring提示词
request.aspect_ratiostring尺寸比
artifactobject生成任务的产物集合
artifact.videoobject产物视频信息
artifact.thumbnailobject生成的缩略图信息
artifact.video_rawobject原始视频信息
artifact.created_atstring产物创建时间
artifact.last_frameobject最后一帧信息
thumbnailobject缩略图信息
video_rawobject原始视频信息(重复字段)
created_atstring任务创建时间
last_frameobject最后一帧信息
failure_reasonstring/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
}