按游标列出任务
POST /tasks:按时间窗口和状态游标分页列出文生视频、图生视频、动作控制、全能参考视频任务
POST/tasks
按创建时间倒序列出文生视频、图生视频、动作控制、全能参考视频任务。
| 项 | 值 |
|---|---|
| 模式 | 同步查询 |
| 计费 | 查询不收费 |
快速开始
curl https://api.vibelab.me/tasks \
-H "Authorization: Bearer $LOOPTOKEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"limit": 100,
"filters": [
{
"key": "status",
"values": [
"succeeded"
]
}
]
}'响应示例:
{
"code": 0,
"message": "SUCCEED",
"request_id": "6a0d571e-d36c-4811-bb2b-698c94b19a8c",
"data": {
"result": [
{
"id": "893605946402811985",
"status": "succeeded",
"message": "",
"create_time": 1781080778802,
"update_time": 1781080794151,
"external_id": "your-id",
"outputs": [
{
"type": "video",
"id": "893605946402811986",
"url": "https://example.com/result.mp4",
"watermark_url": "https://example.com/result-wm.mp4",
"duration": "5"
}
]
}
],
"count": 1,
"has_more": false
}
}请求参数
请求头
| 参数 | 类型 | 必填 | 默认 | 说明 |
|---|---|---|---|---|
Authorization | string | 是 | - | Bearer $LOOPTOKEN_API_KEY |
Content-Type | string | 是 | - | application/json |
请求体
| 参数 | 类型 | 必填 | 默认 | 说明 |
|---|---|---|---|---|
start_time | string | 否 | end_time 往前 30 天 | 起始时间(毫秒时间戳) |
end_time | string | 否 | 当前时间 | 结束时间(毫秒时间戳) |
cursor | string | 否 | - | 上一页返回的 next_cursor;传入后忽略时间窗口 |
limit | integer | 否 | 100 | 每页数量,最大 500 |
filters | array | 否 | - | [{ "key": "status", "values": ["succeeded"] }];key 支持 status(submitted、processing、succeeded、failed)与 product_type(video;传其他值返回空列表) |
响应
| 字段 | 类型 | 说明 |
|---|---|---|
code | integer | 0 表示成功,其余见错误 |
message | string | 错误信息 |
request_id | string | 请求 ID,排查问题时提供 |
data.result | array | 任务列表,字段同查询任务 |
data.count | integer | 本页数量 |
data.has_more | boolean | 是否还有下一页 |
data.next_cursor | string | 下一页游标,仅 has_more 为 true 时返回 |
计费
查询不收费。
错误
本页参数校验返回 400 / 1201,message 原文如下:
| HTTP | code | 触发场景 | 处理 |
|---|---|---|---|
| 400 | 1201 | invalid request body | 请求体传合法 JSON |
| 400 | 1201 | end_time must be a millisecond timestamp / start_time must be a millisecond timestamp | 传毫秒时间戳 |
| 400 | 1201 | start_time must be earlier than end_time | 起始时间早于结束时间 |
| 400 | 1201 | limit must not exceed 500 | limit 不超过 500 |
| 400 | 1201 | unknown status filter ... | status 取 submitted、processing、succeeded、failed |
| 400 | 1201 | unknown filter key ... | key 只支持 status、product_type |
| 400 | 1201 | invalid cursor | 原样传上一页返回的 next_cursor |
通用错误(鉴权、余额、并发、回调地址、上游错误)见 Kling 错误。
注意事项
limit不传或小于等于 0 → 按100处理。- 传
cursor→ 忽略start_time,按游标继续往前翻。