Query Kling API 2.0 tasks by ID
curl --request GET \
--url https://models.kapon.cloud/kling/tasks \
--header 'Authorization: Bearer <token>'import requests
url = "https://models.kapon.cloud/kling/tasks"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://models.kapon.cloud/kling/tasks"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://models.kapon.cloud/kling/tasks")
.header("Authorization", "Bearer <token>")
.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::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "success",
"request_id": "request-id",
"data": [
{
"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"
}
]
}
]
}API 2.0
API 2.0 · 按 ID 查询
仅查询当前用户创建的 API 2.0 任务
GET
/
kling
/
tasks
Query Kling API 2.0 tasks by ID
curl --request GET \
--url https://models.kapon.cloud/kling/tasks \
--header 'Authorization: Bearer <token>'import requests
url = "https://models.kapon.cloud/kling/tasks"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://models.kapon.cloud/kling/tasks"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://models.kapon.cloud/kling/tasks")
.header("Authorization", "Bearer <token>")
.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::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "success",
"request_id": "request-id",
"data": [
{
"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"
}
]
}
]
}task_ids 与 external_task_ids 二选一,多个 ID 用英文逗号分隔。task_ids 支持上游 id、平台 platform_id(video_<ULID>)及混合输入;external_task_ids 仍使用业务外部 ID。每个 data[] 项返回与创建时一致的 platform_id,保留上游 id。新版成功状态为 succeeded,任务字段为 id、status、outputs。
游标列表使用平台已保存的任务快照。续页只需上页 next_cursor,原时间窗口与筛选条件会保留;需要即时状态时使用按 ID 查询。旧格式游标需重新发起首查询。Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Comma-separated upstream IDs or platform_id (video_); mixed IDs supported
Comma-separated external task IDs