Modelroutes
Een Kling Omni-video maken
Maak een Kling Omni-videotaak met de model-ID in de URL en haal vervolgens het resultaat op met de taak-ID.
POST
/
omni-video
/
{model}
cURL
curl https://api.cometapi.com/omni-video/kling-3.0-omni \
-H "Authorization: Bearer $COMETAPI_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"contents": [
{
"type": "prompt",
"text": "A paper boat drifts on a pond."
}
],
"settings": {
"resolution": "720p",
"aspect_ratio": "16:9",
"duration": 5,
"multi_shot": false,
"audio": "off"
}
}
JSONimport os
import requests
response = requests.post(
"https://api.cometapi.com/omni-video/kling-3.0-omni",
headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
json={
"contents": [
{
"type": "prompt",
"text": "A paper boat drifts on a pond.",
}
],
"settings": {
"resolution": "720p",
"aspect_ratio": "16:9",
"duration": 5,
"multi_shot": False,
"audio": "off",
},
},
)
response.raise_for_status()
result = response.json()
print(result["data"]["id"])
const response = await fetch(
"https://api.cometapi.com/omni-video/kling-3.0-omni",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"contents": [
{
"type": "prompt",
"text": "A paper boat drifts on a pond."
}
],
"settings": {
"resolution": "720p",
"aspect_ratio": "16:9",
"duration": 5,
"multi_shot": false,
"audio": "off"
}
}),
},
);
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const result = await response.json();
console.log(result.data.id);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.com/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",
CURLOPT_POSTFIELDS => json_encode([
'contents' => [
[
'type' => 'prompt',
'text' => 'A paper boat drifts on a pond.'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cometapi.com/omni-video/{model}"
payload := strings.NewReader("{\n \"contents\": [\n {\n \"type\": \"prompt\",\n \"text\": \"A paper boat drifts on a pond.\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.cometapi.com/omni-video/{model}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contents\": [\n {\n \"type\": \"prompt\",\n \"text\": \"A paper boat drifts on a pond.\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/omni-video/{model}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contents\": [\n {\n \"type\": \"prompt\",\n \"text\": \"A paper boat drifts on a pond.\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "SUCCEED",
"data": {
"id": "example-task-id",
"status": "submitted"
}
}Gebruik
Voor
De response retourneert een
Gebruik de waarde
POST /omni-video/{model} om een asynchrone Kling Omni-videotaak te maken. Plaats de model-ID in de URL en geef de invoer op in contents.
Kies een model
kling-4.0:720pof1080p; 3-30 seconden; geen veldaudio. Ondersteunt naast de vaste beeldverhoudingen ook de beeldverhoudingadaptiveen accepteert content van het typemiddle_frame.kling-3.0-omni:720p,1080p, of4k; 3-15 seconden; audio:native,originalofoff.kling-o1:720pof1080p; 3-10 seconden; audio:originalofoff.
kling-3.0-omni. Stel settings.audio in op off om een video zonder geluid te maken.
Requestparameters
| Veld | Verplicht | Beschrijving |
|---|---|---|
Pad model | Ja | Model-ID in de URL. Kies een ID uit de bovenstaande lijst; voeg deze niet toe aan de requestbody. |
contents | Ja | Niet-lege array met video-invoer. Voeg voor een request met alleen tekst een prompt-item toe. |
contents[].type | Ja | prompt, first_frame, middle_frame, last_frame, refer_image, feature_video, of base_video. middle_frame is beschikbaar met kling-4.0. Een last_frame vereist een first_frame. |
contents[].text | Voor een prompt-item | Tekst die de video beschrijft. |
contents[].url | Voor afbeeldings- of video-items | Afbeeldings-URL of Base64-afbeeldingsgegevens; video-items gebruiken een openbare video-URL. |
settings.resolution | Nee | Uitvoerresolutie. Als deze wordt weggelaten, gebruikt het request 720p. De beschikbare waarden zijn afhankelijk van model. |
settings.aspect_ratio | Nee | Framevorm: adaptive (alleen kling-4.0), 16:9, 9:16 of 1:1. Standaard ingesteld op 16:9. |
settings.duration | Nee | Videoduur in hele seconden. De standaardwaarde is 10 voor kling-4.0 en 5 voor de andere modellen. Gebruik een duur binnen het bereik van het geselecteerde model. Stuur een geheel getal, geen string. |
settings.multi_shot | Nee | Stel voor kling-3.0-omni de waarde in op true voor meerdere shots of op false voor één doorlopend shot. Voeg dit veld niet toe voor kling-o1. |
settings.audio | Nee | Stel native, original of off in op basis van het geselecteerde model en de invoer. Niet ondersteund door kling-4.0. |
options.callback_url | Nee | HTTPS-URL die callbacks voor de taakstatus ontvangt. |
options.external_task_id | Nee | Je eigen taak-ID voor correlatie; bewaar de geretourneerde data.id voor query’s. |
options.watermark_info.enabled | Nee | Stel in op true om een watermerk aan te vragen. |
kling-4.0 is maximaal één inhoudsitem van het type base_video toegestaan. Voor kling-3.0-omni vereist een feature_video-invoer zowel settings.multi_shot: true als settings.audio: off. Een base_video-invoer vereist settings.multi_shot: false en kan niet worden gebruikt met settings.audio: native. Combineer base_video niet met een eerste of laatste frame.
De officiële standaardwaarde voor kling-3.0-omni is multi_shot: true; stel het veld expliciet in wanneer je een specifieke shotmodus nodig hebt. Voor kling-o1 mogen Prompts maximaal 2500 tekens bevatten. Als het request alleen een first_frame bevat en geen andere referentieafbeelding of -video, gebruik dan een duur van 5 of 10 seconden.
Stuur deze requestbody naar POST /omni-video/kling-3.0-omni om een video van vijf seconden met alleen tekst te maken:
{
"contents": [
{
"type": "prompt",
"text": "A paper boat drifts on a pond."
}
],
"settings": {
"resolution": "720p",
"aspect_ratio": "16:9",
"duration": 5,
"multi_shot": false,
"audio": "off"
}
}
id voor de asynchrone taak:
{
"code": 0,
"message": "SUCCEED",
"data": {
"id": "example-task-id",
"status": "submitted"
}
}
data.id bij Een Kling-taak ophalen totdat de taak is voltooid. Haal de URL van de voltooide video op uit de array outputs van de taak. Sla de video op in je eigen opslag als je blijvende toegang nodig hebt.
Het OpenAPI-paneel bevat bijpassende Shell-, Python- en JavaScript-requests. Zie voor meer invoercombinaties de API-referentie voor Kling 3.0 Omni-video of API-referentie voor Kling O1 Omni-video.Padparameters
Body
application/json
Omni video request fields exposed by the CometAPI route. The model ID is a path parameter, not a body field.
Respons
200 - application/json
Task created. Store data.id for a GET /tasks query.
Laatst gewijzigd op 13 november 2026
⌘I
cURL
curl https://api.cometapi.com/omni-video/kling-3.0-omni \
-H "Authorization: Bearer $COMETAPI_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"contents": [
{
"type": "prompt",
"text": "A paper boat drifts on a pond."
}
],
"settings": {
"resolution": "720p",
"aspect_ratio": "16:9",
"duration": 5,
"multi_shot": false,
"audio": "off"
}
}
JSONimport os
import requests
response = requests.post(
"https://api.cometapi.com/omni-video/kling-3.0-omni",
headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
json={
"contents": [
{
"type": "prompt",
"text": "A paper boat drifts on a pond.",
}
],
"settings": {
"resolution": "720p",
"aspect_ratio": "16:9",
"duration": 5,
"multi_shot": False,
"audio": "off",
},
},
)
response.raise_for_status()
result = response.json()
print(result["data"]["id"])
const response = await fetch(
"https://api.cometapi.com/omni-video/kling-3.0-omni",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"contents": [
{
"type": "prompt",
"text": "A paper boat drifts on a pond."
}
],
"settings": {
"resolution": "720p",
"aspect_ratio": "16:9",
"duration": 5,
"multi_shot": false,
"audio": "off"
}
}),
},
);
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const result = await response.json();
console.log(result.data.id);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.com/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",
CURLOPT_POSTFIELDS => json_encode([
'contents' => [
[
'type' => 'prompt',
'text' => 'A paper boat drifts on a pond.'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cometapi.com/omni-video/{model}"
payload := strings.NewReader("{\n \"contents\": [\n {\n \"type\": \"prompt\",\n \"text\": \"A paper boat drifts on a pond.\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.cometapi.com/omni-video/{model}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contents\": [\n {\n \"type\": \"prompt\",\n \"text\": \"A paper boat drifts on a pond.\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/omni-video/{model}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contents\": [\n {\n \"type\": \"prompt\",\n \"text\": \"A paper boat drifts on a pond.\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "SUCCEED",
"data": {
"id": "example-task-id",
"status": "submitted"
}
}