Bir Kling text-to-video görevi oluşturma
CometAPI üzerinden Kling ile metin istemlerinden videolar üretmek için POST /kling/v1/videos/text2video kullanın, ardından görev durumunu izleyin ve görev kimliğine göre sonuçları alın.
İlk çalışan istek
- Önce kısa bir prompt gönderin
kling-v3örneğiyle başlayın, ardından farklı bir model hattına ihtiyaç duyduğunuzda OpenAPI enum içinden başka birmodel_nameseçin- Temel akış çalıştıktan sonra
aspect_ratio,duration,modeveyasoundekleyin - Salt polling yerine push teslimat istiyorsanız
callback_urlayarlayın - Desteklenen modellerde, deterministik ve ses içermeyen ilk istek için
sound: offkullanın
Model adlandırma
Bu endpoint’te standart Kling video model ID’lerini kullanın. Omni model ID’lerini Omni Video için saklayın.Süre ve en-boy oranı
size alanı sunmaz. İstenen en-boy oranı, çıktı kare şeklini kontrol eder.
Görev akışı
Üretim isteğini gönderin
Görev durumunu sorgulayın
Sonucu kalıcı olarak saklayın
Yetkilendirmeler
Bearer token authentication. Use your CometAPI key.
Başlıklar
Must be application/json.
Gövde
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