Buat task text-to-video Kling
Hasilkan video dari prompt teks dengan Kling melalui CometAPI POST /kling/v1/videos/text2video, lalu lacak status task dan ambil hasilnya berdasarkan task ID.
Permintaan pertama yang berfungsi
- Kirim prompt singkat terlebih dahulu
- Mulai dengan contoh
kling-v3, lalu pilihmodel_namelain dari enum OpenAPI saat Anda memerlukan jalur model yang berbeda - Tambahkan
aspect_ratio,duration,mode, atausoundhanya setelah alur dasar berfungsi - Setel
callback_urljika Anda ingin pengiriman push alih-alih murni polling - Gunakan
sound: offsaat Anda menginginkan permintaan pertama tanpa audio yang deterministik pada model yang mendukung suara yang dihasilkan
Penamaan model
Gunakan model ID video Kling biasa pada endpoint ini. Simpan model ID Omni untuk Omni Video.Durasi dan rasio aspek
size yang presisi. Rasio aspek yang diminta mengontrol bentuk frame output.
Alur task
Submit the generation request
Poll the task state
Persist the result
Otorisasi
Bearer token authentication. Use your CometAPI key.
Header
Must be application/json.
Body
Text prompt describing the video to generate. Maximum 500 characters.
Elements to exclude from the video. Maximum 200 characters.
Aspect ratio request. Typical rendered sizes are 1280x720 for 16:9, 720x1280 for 9:16, and 960x960 for 1:1. This endpoint does not expose an exact size field.
16:9, 9:16, 1:1 Webhook URL to receive task status updates when the task completes.
Model ID for this text-to-video request. Use an ordinary Kling video model ID; use Omni model IDs only with the Omni Video endpoint.
kling-v1, kling-v1-6, kling-v2-master, kling-v2-1-master, kling-v2-5-turbo, kling-v2-6, kling-v3 Prompt adherence strength. Higher values follow the prompt more closely. Range: 0–1.
Generation mode. std for standard (faster), pro for professional (higher quality). The default is std.
std, pro Output video length in seconds. Use 5 or 10; omit to use 5.
Camera motion preset or manual configuration. Omit for automatic camera movement.
Custom task id for your own tracking. Does not replace the system-generated task id but can be used to query tasks. Must be unique per user.
Optional generated-audio switch for models that support video sound. Use on or off, or omit the field for the model default.
on, off