Percorsi per modello
Crea un video Kling Omni
Crea un task video Kling Omni con l’ID del modello nell’URL, quindi recupera il risultato tramite l’ID del task.
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"
}
}Usa
Per
La risposta restituisce un
Usa il valore
POST /omni-video/{model} per creare un task video Kling Omni asincrono. Inserisci l’ID del modello nell’URL e specifica l’input in contents.
Scegli un modello
kling-4.0:720po1080p; 3-30 secondi; nessun campoaudio. Supporta il rapporto d’aspettoadaptiveoltre ai rapporti fissi e accetta contenutimiddle_frame.kling-3.0-omni:720p,1080p, o4k; 3-15 secondi; audionative,originalooff.kling-o1:720po1080p; 3-10 secondi; audiooriginalooff.
kling-3.0-omni. Per creare un video senza audio, imposta settings.audio su off.
Parametri della richiesta
| Campo | Obbligatorio | Descrizione |
|---|---|---|
Percorso model | Sì | ID del modello nell’URL. Scegli un ID dall’elenco precedente; non aggiungerlo al corpo della richiesta. |
contents | Sì | Array non vuoto di input video. Per una richiesta di solo testo, includi un elemento prompt. |
contents[].type | Sì | prompt, first_frame, middle_frame, last_frame, refer_image, feature_video, oppure base_video. middle_frame è disponibile con kling-4.0. Un elemento last_frame richiede un first_frame. |
contents[].text | Per un elemento prompt | Testo che descrive il video. |
contents[].url | Per gli elementi immagine o video | URL dell’immagine o dati dell’immagine in Base64; gli elementi video utilizzano un URL video pubblico. |
settings.resolution | No | Risoluzione di output. Se omessa, la richiesta utilizza 720p. I valori disponibili dipendono da model. |
settings.aspect_ratio | No | Formato del fotogramma: adaptive (solo kling-4.0), 16:9, 9:16 o 1:1. Il valore predefinito è 16:9. |
settings.duration | No | Durata del video in secondi interi. Il valore predefinito è 10 per kling-4.0 e 5 per gli altri modelli. Usa una durata compresa nell’intervallo del modello selezionato. Invia un numero intero, non una stringa. |
settings.multi_shot | No | Per kling-3.0-omni, imposta true per più riprese o false per una ripresa continua. Non includere questo campo per kling-o1. |
settings.audio | No | Imposta native, original o off in base al modello e agli input selezionati. Non supportato da kling-4.0. |
options.callback_url | No | URL HTTPS che riceve le callback sullo stato dell’attività. |
options.external_task_id | No | Il tuo identificatore dell’attività per la correlazione; conserva il valore data.id restituito per le query. |
options.watermark_info.enabled | No | Imposta su true per richiedere una filigrana. |
kling-4.0, è consentito al massimo un elemento di contenuto base_video. Per kling-3.0-omni, un input feature_video richiede settings.multi_shot: true e settings.audio: off. Un input base_video richiede settings.multi_shot: false e non può usare settings.audio: native. Non combinare base_video con un primo o un ultimo fotogramma.
Il valore predefinito ufficiale per kling-3.0-omni è multi_shot: true; imposta esplicitamente il campo quando hai bisogno di una modalità di ripresa definita. Per kling-o1, i Prompt possono contenere fino a 2500 caratteri. Se la richiesta contiene solo un first_frame e nessun’altra immagine o video di riferimento, usa una durata di 5 o 10 secondi.
Per creare un video di cinque secondi da solo testo, invia questo corpo della richiesta a POST /omni-video/kling-3.0-omni:
{
"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 per l’attività asincrona:
{
"code": 0,
"message": "SUCCEED",
"data": {
"id": "example-task-id",
"status": "submitted"
}
}
data.id con Ottenere un’attività Kling finché l’attività non viene completata. Leggi l’URL del video completato dall’array outputs dell’attività. Archivia il video nel tuo spazio di archiviazione se hai bisogno di un accesso duraturo.
Il pannello OpenAPI contiene le richieste corrispondenti in Shell, Python e JavaScript. Per altre combinazioni di input, consulta il riferimento API video Kling 3.0 Omni o il riferimento API video Kling O1 Omni.Parametri del percorso
Corpo
application/json
Omni video request fields exposed by the CometAPI route. The model ID is a path parameter, not a body field.
Risposta
200 - application/json
Task created. Store data.id for a GET /tasks query.
Ultima modifica il 13 novembre 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"
}
}