Kling Text to Video
curl --request POST \
--url https://api.mixroute.ai/kling/text-to-video/{model}import requests
url = "https://api.mixroute.ai/kling/text-to-video/{model}"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.mixroute.ai/kling/text-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/text-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/text-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/text-to-video/{model}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixroute.ai/kling/text-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 Text to Video
Prompt, audio, aspect ratio and duration parameters for Kling text-to-video.
Kling Text to Video
curl --request POST \
--url https://api.mixroute.ai/kling/text-to-video/{model}import requests
url = "https://api.mixroute.ai/kling/text-to-video/{model}"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.mixroute.ai/kling/text-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/text-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/text-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/text-to-video/{model}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixroute.ai/kling/text-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
For 3.0 and 3.0 Turbo, use
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 |
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Nonempty text containing positive and negative descriptions. 3.0/3.0 Turbo: maximum 3072 characters, recommended at most 2500. 2.6/2.5 Turbo: maximum 2500. |
settings.resolution | string | No | Defaults to 720p. Use lowercase 720p, 1080p or 4k as supported above. |
settings.duration | integer | No | Defaults to 5. Integers 3-15 for 3.0/3.0 Turbo; only 5 or 10 for 2.6/2.5 Turbo. |
settings.aspect_ratio | string | No | 16:9 (default), 9:16 or 1:1. |
settings.audio | string | No | 3.0/2.6 only: off (default) or native. 2.6 native requires 1080p. Omit for 3.0 Turbo (built-in audio) and 2.5 Turbo (unsupported). |
settings.multi_shot | boolean | No | 3.0 only: defaults to true; false disables multi-shot generation. Turbo has no such switch; use storyboard prompts. |
shot n, m, words;: 1-6 shots, at least one second each, durations summing to the total and at most 512 characters per shot prompt. Do not send images to this endpoint.
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/text-to-video/kling-3.0" \
--header "Authorization: Bearer $MIXROUTE_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"prompt": "A red ceramic mug slowly rotates on a white tabletop. Static camera, soft studio lighting.",
"settings": {
"resolution": "720p",
"duration": 5,
"aspect_ratio": "16:9",
"audio": "off",
"multi_shot": false
},
"options": {
"watermark_info": {
"enabled": 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.