Kling Image to Video
curl --request POST \
--url https://api.mixroute.ai/kling/image-to-video/{model}import requests
url = "https://api.mixroute.ai/kling/image-to-video/{model}"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.mixroute.ai/kling/image-to-video/{model}', 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.mixroute.ai/kling/image-to-video/{model}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.mixroute.ai/kling/image-to-video/{model}"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mixroute.ai/kling/image-to-video/{model}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixroute.ai/kling/image-to-video/{model}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyKling
Kling Image to Video
Kling first-frame, first/last-frame, Element and voice inputs.
Kling Image to Video
curl --request POST \
--url https://api.mixroute.ai/kling/image-to-video/{model}import requests
url = "https://api.mixroute.ai/kling/image-to-video/{model}"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.mixroute.ai/kling/image-to-video/{model}', 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.mixroute.ai/kling/image-to-video/{model}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.mixroute.ai/kling/image-to-video/{model}"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mixroute.ai/kling/image-to-video/{model}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixroute.ai/kling/image-to-video/{model}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyAuthenticate with your MixRoute API Key using
The standard image-to-video endpoint has no
See Kling Overview.
Keep
Authorization: Bearer $MIXROUTE_API_KEY and send JSON. The model ID belongs in the URL, not a body model field. Do not add /v1 or wrap the request in metadata.
Supported Models
| Model ID | Resolution | Standard Generation Duration (s) |
|---|---|---|
| kling-3.0 | 720p / 1080p / 4k | 3-15 |
| kling-3.0-turbo | 720p / 1080p | 3-15 |
| kling-2.6 | 720p / 1080p | 5 / 10 |
| kling-2.5-turbo | 720p / 1080p | 5 / 10 |
Contents
| Field | Type | Required | Description |
|---|---|---|---|
contents | object[] | Yes | Input collection. A first frame is required; last-frame-only input is unsupported. Keep each type and its fields in one object. |
contents[].type | string | Yes | Required per item. prompt, first_frame; last_frame for 3.0/2.6/2.5 Turbo; element for 3.0 only; voice for 2.6 only. |
contents[].text | string | By type | Required for prompt items. 3.0: maximum 3072 characters (2500 recommended); other models: maximum 2500. |
contents[].url | string | By type | Required for first_frame/last_frame: public image URL or Base64. |
contents[].element_id | string | By type | Required for element items; 3.0 supports up to 3 Elements. |
contents[].voice_id | string | By type | Required for voice items; 2.6 supports up to 2 voices with audio=native and 1080p. |
contents[].id | string | By type | Required for element/voice items, unique within the task; reference as @id in the prompt. |
Generation Settings
| Field | Type | Required | Description |
|---|---|---|---|
settings.resolution | string | No | Defaults to 720p. 3.0: 720p/1080p/4k; other models: 720p/1080p. First/last-frame mode requires 1080p for 2.6/2.5 Turbo. |
settings.duration | integer | No | Defaults to 5. 3-15 for 3.0/3.0 Turbo; only 5 or 10 for 2.6/2.5 Turbo. |
settings.audio | string | No | 3.0/2.6 support off (default) or native. 2.6 native audio requires 1080p. Omit for 3.0 Turbo and 2.5 Turbo. |
settings.multi_shot | boolean | No | 3.0 only, defaults to true. false prevents multi-shot output even with storyboard prompts. |
aspect_ratio; framing follows the image. 3.0 Turbo accepts only a first frame, not a last frame, Element or voice reference. Reference 3.0 Elements as @id, avoiding overlapping names; storyboard syntax matches text-to-video.
Image Limits
JPG/JPEG/PNG, at most 50 MB per image, both dimensions at least 300 px, aspect ratio between 1:2.5 and 2.5:1. Supply a first frame or first+last frames, never a last frame alone. Asset IDs must be accessible to the routed upstream account.Request Example
Set theMIXROUTE_API_KEY environment variable. Replace example.com media URLs with real, publicly accessible files.
curl --request POST "https://api.mixroute.ai/kling/image-to-video/kling-3.0" \
--header "Authorization: Bearer $MIXROUTE_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"contents": [
{
"type": "prompt",
"text": "A closed gift box slowly opens to reveal a ceramic mug."
},
{
"type": "first_frame",
"url": "https://example.com/first.png"
},
{
"type": "last_frame",
"url": "https://example.com/last.png"
}
],
"settings": {
"resolution": "1080p",
"duration": 5,
"audio": "native",
"multi_shot": false
}
}'
Submission Response
{
"code": 0,
"message": "",
"request_id": "REQUEST_ID",
"data": {
"id": "task_example",
"status": "submitted"
}
}
data.id and use Query Kling Task until succeeded or failed. Successful submission does not mean generation has finished.