List Kling API 2.0 tasks by cursor
curl --request POST \
--url https://models.kapon.cloud/kling/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cursor": "<string>",
"end_time": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"limit": 100,
"start_time": "<string>"
}
'import requests
url = "https://models.kapon.cloud/kling/tasks"
payload = {
"cursor": "<string>",
"end_time": "<string>",
"filters": [{ "values": ["<string>"] }],
"limit": 100,
"start_time": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cursor: '<string>',
end_time: '<string>',
filters: [{values: ['<string>']}],
limit: 100,
start_time: '<string>'
})
};
fetch('https://models.kapon.cloud/kling/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://models.kapon.cloud/kling/tasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cursor' => '<string>',
'end_time' => '<string>',
'filters' => [
[
'values' => [
'<string>'
]
]
],
'limit' => 100,
'start_time' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://models.kapon.cloud/kling/tasks"
payload := strings.NewReader("{\n \"cursor\": \"<string>\",\n \"end_time\": \"<string>\",\n \"filters\": [\n {\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"limit\": 100,\n \"start_time\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://models.kapon.cloud/kling/tasks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cursor\": \"<string>\",\n \"end_time\": \"<string>\",\n \"filters\": [\n {\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"limit\": 100,\n \"start_time\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://models.kapon.cloud/kling/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cursor\": \"<string>\",\n \"end_time\": \"<string>\",\n \"filters\": [\n {\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"limit\": 100,\n \"start_time\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "success",
"request_id": "request-id",
"data": {
"result": [
{
"id": "upstream-task-id",
"status": "succeeded",
"create_time": 1781080778802,
"update_time": 1781080778802,
"outputs": [
{
"type": "video",
"id": "video-id",
"url": "https://example.com/result.mp4",
"duration": "5"
}
]
}
],
"count": 1,
"next_cursor": "",
"has_more": false
}
}API 2.0
API 2.0 · 游标列表
仅查询当前用户创建的 API 2.0 任务
POST
/
kling
/
tasks
List Kling API 2.0 tasks by cursor
curl --request POST \
--url https://models.kapon.cloud/kling/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cursor": "<string>",
"end_time": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"limit": 100,
"start_time": "<string>"
}
'import requests
url = "https://models.kapon.cloud/kling/tasks"
payload = {
"cursor": "<string>",
"end_time": "<string>",
"filters": [{ "values": ["<string>"] }],
"limit": 100,
"start_time": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cursor: '<string>',
end_time: '<string>',
filters: [{values: ['<string>']}],
limit: 100,
start_time: '<string>'
})
};
fetch('https://models.kapon.cloud/kling/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://models.kapon.cloud/kling/tasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cursor' => '<string>',
'end_time' => '<string>',
'filters' => [
[
'values' => [
'<string>'
]
]
],
'limit' => 100,
'start_time' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://models.kapon.cloud/kling/tasks"
payload := strings.NewReader("{\n \"cursor\": \"<string>\",\n \"end_time\": \"<string>\",\n \"filters\": [\n {\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"limit\": 100,\n \"start_time\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://models.kapon.cloud/kling/tasks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cursor\": \"<string>\",\n \"end_time\": \"<string>\",\n \"filters\": [\n {\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"limit\": 100,\n \"start_time\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://models.kapon.cloud/kling/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cursor\": \"<string>\",\n \"end_time\": \"<string>\",\n \"filters\": [\n {\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"limit\": 100,\n \"start_time\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "success",
"request_id": "request-id",
"data": {
"result": [
{
"id": "upstream-task-id",
"status": "succeeded",
"create_time": 1781080778802,
"update_time": 1781080778802,
"outputs": [
{
"type": "video",
"id": "video-id",
"url": "https://example.com/result.mp4",
"duration": "5"
}
]
}
],
"count": 1,
"next_cursor": "",
"has_more": false
}
}task_ids 与 external_task_ids 二选一,多个 ID 用英文逗号分隔。新版成功状态为 succeeded,任务字段为 id、status、outputs。
游标列表使用平台已保存的任务快照。续页只需上页 next_cursor,原时间窗口与筛选条件会保留;需要即时状态时使用按 ID 查询。旧格式游标需重新发起首查询。Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json