Przejdź do głównej treści
POST
cURL
Wyślij Prompt do POST /text-to-video/{model}, aby utworzyć zadanie generowania filmu. Odpowiedź zawiera id, którego użyjesz do pobrania wyniku.

Wybierz model

Umieść identyfikator modelu w adresie URL. Nie dodawaj pola modelu do treści JSON.

Parametry żądania

kling-4.0 nie udostępnia przełącznika settings.audio. Jego filmy zawierają ścieżkę dźwiękową; pomiń to pole zamiast przesyłać wartość, którą model zignoruje. Poniższe żądanie tworzy pięciosekundowy film za pomocą kling-3.0-turbo:
Wyślij tę treść do https://api.cometapi.com/text-to-video/kling-3.0-turbo, używając klucza API CometAPI. Panel kodu OpenAPI udostępnia żądania dla Shell, Python i JavaScript z tą samą treścią.

Pobierz film

Odpowiedź na żądanie utworzenia ma następującą postać:
Zapisz data.id. Użyj funkcji Pobierz zadanie Kling z tym identyfikatorrem, aż zadanie osiągnie stan końcowy. Odczytaj adres URL filmu z tablicy outputs zadania.

Autoryzacje

Authorization
string
header
wymagane

Authenticate with your CometAPI API key.

Parametry ścieżki

model
enum<string>
domyślnie:kling-3.0-turbo
wymagane

Kling model ID. kling-4.0 accepts 3-30 second durations and the 21:9 ratio. kling-3.0 supports 4k resolution. The 2.x models accept 5- or 10-second duration.

Dostępne opcje:
kling-4.0,
kling-3.0-turbo,
kling-3.0,
kling-2.6,
kling-2.5-turbo

Treść

application/json

Text-to-video request fields exposed by the CometAPI route. The model ID is a path parameter, not a body field.

prompt
string
wymagane

Text description of the video to generate.

Minimum string length: 1
settings
object

Video generation settings exposed by the CometAPI route. The model ID in the URL determines which values are accepted.

options
object

Optional task fields exposed by the CometAPI route.

Odpowiedź

200 - application/json

The task was created. Use data.id to retrieve its status and video output.

code
wymagane

Request result code. 0 or success indicates acceptance.

message
string
wymagane

Result message.

data
object
wymagane

Task identifier and submission status.

msg
string

Additional result message when included in the response.

Ostatnia modyfikacja 13 listopada 2026