Model yolları
Kling Omni videosu oluşturun
URL’deki model kimliğiyle bir Kling Omni video görevi oluşturun, ardından sonucu görev kimliğini kullanarak alın.
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"
}
}
JSON
import 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"
}
}Asenkron bir Kling Omni video görevi oluşturmak için
Yanıt, asenkron görev için bir
POST /omni-video/{model} kullanın. Model kimliğini URL’ye yerleştirin ve girdiyi contents içinde belirtin.
Bir model seçin
kling-4.0:720pveya1080p; 3-30 saniye;audioalanı yoktur. Sabit en boy oranlarına ek olarakadaptiveen boy oranını destekler vemiddle_frameiçeriğini kabul eder.kling-3.0-omni:720p,1080p, veya4k; 3-15 saniye; ses içinnative,originalveyaoff.kling-o1:720pveya1080p; 3-10 saniye; ses içinoriginalveyaoff.
kling-3.0-omni kullanır. Sessiz bir video oluşturmak için settings.audio değerini off olarak ayarlayın.
İstek parametreleri
| Alan | Zorunlu | Açıklama |
|---|---|---|
Yol model | Evet | URL’deki model ID’si. Yukarıdaki listeden bir ID seçin; bunu istek gövdesine eklemeyin. |
contents | Evet | Boş olmayan video girdileri dizisi. Yalnızca metin içeren bir istek için bir prompt öğesi ekleyin. |
contents[].type | Evet | prompt, first_frame, middle_frame, last_frame, refer_image, feature_video, veya base_video. middle_frame, kling-4.0 ile kullanılabilir. Bir last_frame için bir first_frame. |
contents[].text | Bir prompt öğesi için | Videoyu açıklayan metin. |
contents[].url | Görüntü veya video öğeleri için | Görüntü URL’si veya Base64 görüntü verisi; video öğeleri herkese açık bir video URL’si kullanır. |
settings.resolution | Hayır | Çıktı çözünürlüğü. Belirtilmezse istekte 720p kullanılır. Kullanılabilir değerler şuna bağlıdır: model. |
settings.aspect_ratio | Hayır | Kare biçimi: adaptive (yalnızca kling-4.0), 16:9, 9:16 veya 1:1. Varsayılan değer: 16:9. |
settings.duration | Hayır | Videonun tam saniye cinsinden uzunluğu. Varsayılan değer kling-4.0 için 10, diğer modeller için 5 değeridir. Seçilen modelin aralığında bir süre kullanın. Dize değil, tam sayı gönderin. |
settings.multi_shot | Hayır | kling-3.0-omni için birden fazla çekim istiyorsanız true, tek bir kesintisiz çekim istiyorsanız false olarak ayarlayın. Şunun için bu alanı eklemeyin: kling-o1. |
settings.audio | Hayır | Seçilen modele ve girdilere göre native, original veya off olarak ayarlayın. Şu model tarafından desteklenmez: kling-4.0. |
options.callback_url | Hayır | Görev durumu geri çağrılarını alan HTTPS URL’si. |
options.external_task_id | Hayır | İlişkilendirme için kendi görev tanımlayıcınız; sorgular için döndürülen data.id değerini saklayın. |
options.watermark_info.enabled | Hayır | Filigran istemek için true olarak ayarlayın. |
kling-4.0 için en fazla bir base_video içerik öğesine izin verilir. kling-3.0-omni için feature_video girdisi, settings.multi_shot: true ve settings.audio: off gerektirir. base_video girdisi, settings.multi_shot: false gerektirir ve settings.audio: native kullanamaz. base_video ile ilk veya son kareyi birleştirmeyin.
kling-3.0-omni için resmî varsayılan değer multi_shot: true değeridir; belirli bir çekim moduna ihtiyacınız olduğunda alanı açıkça ayarlayın. kling-o1 için Prompt’lar en fazla 2500 karakter içerebilir. İstek yalnızca bir first_frame içeriyorsa ve başka bir referans görüntü veya video içermiyorsa 5 veya 10 saniyelik bir süre kullanın.
Yalnızca metin içeren beş saniyelik bir video oluşturmak için bu istek gövdesini POST /omni-video/kling-3.0-omni adresine gönderin:
{
"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 döndürür:
{
"code": 0,
"message": "SUCCEED",
"data": {
"id": "example-task-id",
"status": "submitted"
}
}
data.id değerini kullanarak Kling görevi alma işlemini görev tamamlanana kadar sürdürün. Tamamlanan videonun URL’sini görevin outputs dizisinden alın. Kalıcı erişime ihtiyacınız varsa videoyu kendi depolama alanınızda saklayın.
OpenAPI panelinde karşılık gelen Shell, Python ve JavaScript istekleri bulunur. Daha fazla girdi kombinasyonu için şu kaynaklara bakın: Kling 3.0 Omni video API referansı veya Kling O1 Omni video API referansı.Yol Parametreleri
Gövde
application/json
Omni video request fields exposed by the CometAPI route. The model ID is a path parameter, not a body field.
Yanıt
200 - application/json
Task created. Store data.id for a GET /tasks query.
Son değiştirilme tarihi 13 Kasım 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"
}
}
JSON
import 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"
}
}