curl --request POST \
--url 'https://api.elkapi.com/kling/v1/videos/image2video' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "kling-v3",
"prompt": "A small kitten running through a sunny garden, cinematic, highly detailed",
"image": "https://example.com/image.png",
"duration": 5,
"response_format": "json",
"metadata": {}
}'
import requests
url = "https://api.elkapi.com/kling/v1/videos/image2video"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"model": "kling-v3",
"prompt": "A small kitten running through a sunny garden, cinematic, highly detailed",
"image": "https://example.com/image.png",
"duration": 5,
"response_format": "json",
"metadata": {}
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/kling/v1/videos/image2video";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"model": "kling-v3",
"prompt": "A small kitten running through a sunny garden, cinematic, highly detailed",
"image": "https://example.com/image.png",
"duration": 5,
"response_format": "json",
"metadata": {}
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
{
"task_id": "task_1234567890",
"status": "queued"
}
{
"error": {
"message": "message",
"type": "type",
"param": "param",
"code": "code"
}
}
Kling Format
Kling Image-to-Video
- Generate video from an image with a Kling model.
- Supports passing an image URL or Base64-encoded image data through the image parameter.
POST
/
kling
/
v1
/
videos
/
image2video
curl --request POST \
--url 'https://api.elkapi.com/kling/v1/videos/image2video' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "kling-v3",
"prompt": "A small kitten running through a sunny garden, cinematic, highly detailed",
"image": "https://example.com/image.png",
"duration": 5,
"response_format": "json",
"metadata": {}
}'
import requests
url = "https://api.elkapi.com/kling/v1/videos/image2video"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"model": "kling-v3",
"prompt": "A small kitten running through a sunny garden, cinematic, highly detailed",
"image": "https://example.com/image.png",
"duration": 5,
"response_format": "json",
"metadata": {}
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/kling/v1/videos/image2video";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"model": "kling-v3",
"prompt": "A small kitten running through a sunny garden, cinematic, highly detailed",
"image": "https://example.com/image.png",
"duration": 5,
"response_format": "json",
"metadata": {}
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
{
"task_id": "task_1234567890",
"status": "queued"
}
{
"error": {
"message": "message",
"type": "type",
"param": "param",
"code": "code"
}
}
curl --request POST \
--url 'https://api.elkapi.com/kling/v1/videos/image2video' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "kling-v3",
"prompt": "A small kitten running through a sunny garden, cinematic, highly detailed",
"image": "https://example.com/image.png",
"duration": 5,
"response_format": "json",
"metadata": {}
}'
import requests
url = "https://api.elkapi.com/kling/v1/videos/image2video"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"model": "kling-v3",
"prompt": "A small kitten running through a sunny garden, cinematic, highly detailed",
"image": "https://example.com/image.png",
"duration": 5,
"response_format": "json",
"metadata": {}
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/kling/v1/videos/image2video";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"model": "kling-v3",
"prompt": "A small kitten running through a sunny garden, cinematic, highly detailed",
"image": "https://example.com/image.png",
"duration": 5,
"response_format": "json",
"metadata": {}
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
{
"task_id": "task_1234567890",
"status": "queued"
}
{
"error": {
"message": "message",
"type": "type",
"param": "param",
"code": "code"
}
}
Authorizations
string
required
All endpoints require Bearer Token authentication.Add it to the request headers:
Authorization: Bearer YOUR_API_KEY
Body
string
default:"kling-v3"
Model/style IDExample:
kling-v3string
Text promptExample:
The astronaut stands up and walks awaystring
Image input (URL or Base64)Example:
https://example.com/image.jpgnumber
Video duration (seconds)Example:
5integer
Video widthExample:
1280integer
Video heightExample:
720integer
Video frame rateExample:
30integer
Random seedExample:
20231234integer
Number of videos to generateExample:
1string
Response formatExample:
urlstring
User identifierExample:
user-1234object
Additional parameters (such as negative_prompt, style, quality_level)
Response
string
Task IDExample:
abcd1234efghstring
Task statusExample:
queued