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ミリ秒)。
タスクのステータス説明。失敗した場合はエラーの原因。
