Kling Omni Generation and Editing
curl --request POST \
--url https://api.mixroute.ai/kling/omni-video/{model}import requests
url = "https://api.mixroute.ai/kling/omni-video/{model}"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.mixroute.ai/kling/omni-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/omni-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/omni-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/omni-video/{model}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixroute.ai/kling/omni-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 Omni Generation and Editing
Image/video references and video editing with Kling 3.0 Omni and O1.
Kling Omni Generation and Editing
curl --request POST \
--url https://api.mixroute.ai/kling/omni-video/{model}import requests
url = "https://api.mixroute.ai/kling/omni-video/{model}"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.mixroute.ai/kling/omni-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/omni-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/omni-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/omni-video/{model}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixroute.ai/kling/omni-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
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-omni | 720p / 1080p / 4k | 3-15 |
| kling-o1 | 720p / 1080p | 3-10 |
Contents
| Field | Type | Required | Description |
|---|---|---|---|
contents | object[] | Yes | Text and multimodal inputs. May contain only a prompt for text generation. |
contents[].type | string | Yes | Required per item: prompt, first_frame, last_frame, refer_image, feature_video, base_video or element. |
contents[].text | string | By type | Required for prompt items. 3.0 Omni: maximum 3072 characters (2500 recommended); O1: maximum 2500. Use @image_1 or @video_1 to reference IDs. |
contents[].url | string | By type | Required for image/video items. Images accept URLs or Base64; videos use public URLs. feature_video supplies feature reference; base_video supplies the video to edit. |
contents[].element_id | string | By type | Required for element items and must be accessible to the routed upstream account. |
contents[].id | string | By type | Required for element items; optional for image/video items, but set it to reference them in prompts. Unique within a task. |
Generation Settings
| Field | Type | Required | Description |
|---|---|---|---|
settings.resolution | string | No | Defaults to 720p. 3.0 Omni: 720p/1080p/4k; O1: 720p/1080p. |
settings.duration | integer | No | Defaults to 5. 3.0 Omni: 3-15; O1: 3-10. O1 with only a first frame and no refer_image/video references supports only 5 or 10 seconds. |
settings.aspect_ratio | string | By scenario | 16:9 (default), 9:16 or 1:1; explicitly provide when there is neither a first frame nor a reference video. |
settings.audio | string | No | Defaults to off. 3.0 Omni: native/original/off; O1: original/off. original preserves reference-video audio; 3.0 Omni cannot use native with video input. |
settings.multi_shot | boolean | No | 3.0 Omni only, defaults to true. Must be true with feature_video; set false for base_video editing, which does not support multi-shot. Omit for O1. |
Input Combinations
- Both models accept at most one video; base_video editing cannot include first/last frames.
- Use only a first frame or first+last frames, never a last frame alone. O1 first+last mode cannot include reference images or Elements. O1 feature_video may include a first frame, not a last frame.
- O1 supports multi-image Elements only: at most 7 reference images plus Elements without a video, or 4 with a video.
- 3.0 Omni without a video allows at most 7 reference images plus multi-image Elements. With video-character Elements, use at most 3 video-character Elements and at most 4 reference images plus multi-image Elements.
- 3.0 Omni with a video allows at most 4 reference images/multi-image Elements, or 1 video-character Element; do not combine a video-character Element with images/multi-image Elements in this case. First-frame/first+last-frame generation allows up to 3 Elements.
- 3.0 Omni feature_video requires audio=off. base_video uses off or original. Native audio is available only without video input.
Media Limits
| Input | Limits |
|---|---|
| Images | JPG/JPEG/PNG, at most 50 MB; both dimensions at least 300 px, aspect ratio 1:2.5 to 2.5:1. |
| 3.0 Omni video | MP4/MOV, at most 200 MB, 3-15.5 s; each dimension 700-4553 px, total area at most 8294400 pixels; aspect ratio 0.4-2, 24-60 fps. |
| O1 video | MP4/MOV, at most 200 MB, 3-10 s; each dimension 700-2160 px, 24-60 fps. |
Storyboard Prompts
Only 3.0 Omni supports multi-shot generation. Withsettings.multi_shot enabled, use shot n, m, words;, separated by semicolons: 1-6 shots, at least one second per shot, durations adding up to settings.duration, and at most 512 characters per shot prompt. This mode is unavailable for base_video editing; do not send multi-shot parameters to O1. Use unique reference names that do not overlap with each other or unrelated prompt text.
Image Reference 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/omni-video/kling-3.0-omni" \
--header "Authorization: Bearer $MIXROUTE_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"contents": [
{
"type": "prompt",
"text": "The mug in @image_1 slowly rotates on a white tabletop. Soft studio lighting."
},
{
"type": "refer_image",
"url": "https://example.com/reference.png",
"id": "image_1"
}
],
"settings": {
"resolution": "720p",
"duration": 5,
"aspect_ratio": "16:9",
"audio": "native",
"multi_shot": false
}
}'
O1 Video Editing Example
curl --request POST "https://api.mixroute.ai/kling/omni-video/kling-o1" \
--header "Authorization: Bearer $MIXROUTE_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"contents": [
{
"type": "prompt",
"text": "Change the red mug in @video_1 to blue. Preserve the original motion and background."
},
{
"type": "base_video",
"url": "https://example.com/source.mp4",
"id": "video_1"
}
],
"settings": {
"resolution": "720p",
"duration": 5,
"audio": "off"
}
}'
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.