查询 Kling 文生视频任务
curl --request GET \
--url https://kaienapi.com/kling/v1/videos/text2video/{task_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://kaienapi.com/kling/v1/videos/text2video/{task_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://kaienapi.com/kling/v1/videos/text2video/{task_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://kaienapi.com/kling/v1/videos/text2video/{task_id}"
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))
}{}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}查询 Kling 文生视频任务
查询 Kling 文生视频任务的状态和结果。
查询顺序
通过文生视频接口创建任务,使用返回的 task_id 调用本接口。任务完成后,从响应中读取视频结果 URL、封面、状态或错误信息。
轮询策略
任务未完成时按固定间隔查询,不要短时间连续请求。页面刷新后,应使用已保存的任务 ID 继续查询。
GET
/
kling
/
v1
/
videos
/
text2video
/
{task_id}
查询 Kling 文生视频任务
curl --request GET \
--url https://kaienapi.com/kling/v1/videos/text2video/{task_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://kaienapi.com/kling/v1/videos/text2video/{task_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://kaienapi.com/kling/v1/videos/text2video/{task_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://kaienapi.com/kling/v1/videos/text2video/{task_id}"
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))
}{}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}