批量查詢 Kling 任務
curl --request GET \
--url https://api.aiid.edu.kg/tasks \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aiid.edu.kg/tasks"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aiid.edu.kg/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://api.aiid.edu.kg/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://api.aiid.edu.kg/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://api.aiid.edu.kg/tasks")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiid.edu.kg/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": "SUCCEED",
"request_id": "request_example",
"data": [
{
"id": "task_example",
"status": "succeeded",
"create_time": 1792710000000,
"update_time": 1792710000000,
"external_id": "",
"message": "",
"outputs": [
{
"type": "video",
"id": "video_example",
"url": "https://example.com/result.mp4",
"duration": "10"
}
]
}
]
}影片生成Kling格式
批量查詢 Kling 任務
此系列支援OpenAI影片生成格式(詳見連結 影片生成Sora相容格式)。
使用建立介面回傳的本平台任務 ID。task_ids 為以逗號分隔的 1 至 100 個唯一 ID;僅查詢目前權杖所屬使用者的 Kling 4.0 任務。任一 ID 不存在、不屬於目前使用者,或不是 Kling 4.0 任務時,整體回傳 404。data 一律為陣列,完成後的 outputs 包含影片 URL。不支援 external_task_ids 或 POST /tasks 清單查詢。
GET
/
tasks
批量查詢 Kling 任務
curl --request GET \
--url https://api.aiid.edu.kg/tasks \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aiid.edu.kg/tasks"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aiid.edu.kg/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://api.aiid.edu.kg/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://api.aiid.edu.kg/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://api.aiid.edu.kg/tasks")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiid.edu.kg/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": "SUCCEED",
"request_id": "request_example",
"data": [
{
"id": "task_example",
"status": "succeeded",
"create_time": 1792710000000,
"update_time": 1792710000000,
"external_id": "",
"message": "",
"outputs": [
{
"type": "video",
"id": "video_example",
"url": "https://example.com/result.mp4",
"duration": "10"
}
]
}
]
}授權
使用 Bearer Token 認證。
格式: Authorization: Bearer sk-xxxxxx
查詢參數
範例:
"task_example_1,task_example_2"
回應
成功
範例:
0
Hide child attributes
Hide child attributes
本站任務 ID,查詢時原樣傳入。
可用選項:
submitted, processing, succeeded, failed 建立時間,Unix 毫秒。
更新時間,Unix 毫秒。
任務狀態說明,失敗時為錯誤原因。
