curl --request GET \
--url 'https://api.elkapi.com/kling/v1/videos/text2video/task_1234567890' \
--header 'Authorization: Bearer <token>'
import requests
url = "https://api.elkapi.com/kling/v1/videos/text2video/task_1234567890"
headers = {
"Authorization": "Bearer <token>"
}
response = requests.request("GET", url, headers=headers)
print(response.json())
const url = "https://api.elkapi.com/kling/v1/videos/text2video/task_1234567890";
const headers = {
"Authorization": "Bearer <token>"
};
const response = await fetch(url, { method: "GET", headers });
console.log(await response.json());
{
"task_id": "task_1234567890",
"status": "completed",
"url": "https://example.com/image.png",
"format": "mp4",
"metadata": {
"duration": 5,
"fps": 30,
"width": 1280,
"height": 720,
"seed": 12345
},
"error": {
"code": 1,
"message": "message"
}
}
{
"error": {
"message": "message",
"type": "type",
"param": "param",
"code": "code"
}
}
可灵格式
获取 Kling 文生视频任务状态
- 查询 Kling 文生视频任务的状态和结果。
GET
/
kling
/
v1
/
videos
/
text2video
/
{task_id}
curl --request GET \
--url 'https://api.elkapi.com/kling/v1/videos/text2video/task_1234567890' \
--header 'Authorization: Bearer <token>'
import requests
url = "https://api.elkapi.com/kling/v1/videos/text2video/task_1234567890"
headers = {
"Authorization": "Bearer <token>"
}
response = requests.request("GET", url, headers=headers)
print(response.json())
const url = "https://api.elkapi.com/kling/v1/videos/text2video/task_1234567890";
const headers = {
"Authorization": "Bearer <token>"
};
const response = await fetch(url, { method: "GET", headers });
console.log(await response.json());
{
"task_id": "task_1234567890",
"status": "completed",
"url": "https://example.com/image.png",
"format": "mp4",
"metadata": {
"duration": 5,
"fps": 30,
"width": 1280,
"height": 720,
"seed": 12345
},
"error": {
"code": 1,
"message": "message"
}
}
{
"error": {
"message": "message",
"type": "type",
"param": "param",
"code": "code"
}
}
curl --request GET \
--url 'https://api.elkapi.com/kling/v1/videos/text2video/task_1234567890' \
--header 'Authorization: Bearer <token>'
import requests
url = "https://api.elkapi.com/kling/v1/videos/text2video/task_1234567890"
headers = {
"Authorization": "Bearer <token>"
}
response = requests.request("GET", url, headers=headers)
print(response.json())
const url = "https://api.elkapi.com/kling/v1/videos/text2video/task_1234567890";
const headers = {
"Authorization": "Bearer <token>"
};
const response = await fetch(url, { method: "GET", headers });
console.log(await response.json());
{
"task_id": "task_1234567890",
"status": "completed",
"url": "https://example.com/image.png",
"format": "mp4",
"metadata": {
"duration": 5,
"fps": 30,
"width": 1280,
"height": 720,
"seed": 12345
},
"error": {
"code": 1,
"message": "message"
}
}
{
"error": {
"message": "message",
"type": "type",
"param": "param",
"code": "code"
}
}
Authorizations
string
必填
所有接口均需要使用 Bearer Token 进行认证。在请求头中添加:
Authorization: Bearer YOUR_API_KEY
Path Parameters
string
必填
任务 ID
Response
string
任务 ID示例:
abcd1234efghstring
任务状态可选值:
queued、in_progress、completed、failed示例:completedstring
视频资源 URL(成功时)示例:
https://example.com/video.mp4string
视频格式示例:
mp4object
⌘I