Kling 3.0 API Dokümantasyonu
Kling 3.0 ve Kling Video O3 API'lerini uygulamalarınıza entegre etmek için tam kılavuz.
Hızlı Başlangıç
| 1 | curl -X POST 'https://kling3api.com/api/generate' \ |
| 2 | -H 'Authorization: Bearer YOUR_API_KEY' \ |
| 3 | -H 'Content-Type: application/json' \ |
| 4 | -d '{ |
| 5 | "type": "pro-text-to-video", |
| 6 | "prompt": "A cinematic shot of mountains at sunrise", |
| 7 | "duration": 5, |
| 8 | "aspect_ratio": "16:9" |
| 9 | }' |
Kimlik Doğrulama
Tüm API istekleri Authorization başlığında Bearer token kullanılarak kimlik doğrulaması gerektirir.
API Anahtarınızı Alın: API anahtarınızı panelinizdeki API Keys sayfasından alabilirsiniz. → API Anahtarınızı Alın
| 1 | Authorization: Bearer YOUR_API_KEY |
Mevcut Modeller
Kling 3.0
Yüksek kaliteli 4K video üretimi
| Tür | Açıklama | Süre | Krediler |
|---|---|---|---|
pro-text-to-video | Pro kalite metinden-video üretimi | 3-15s | 54/s (no audio) · 80/s (with audio) |
pro-image-to-video | Pro kalite resimden-video animasyonu | 3-15s | 54/s (no audio) · 80/s (with audio) |
std-text-to-video | Standart kalite metinden-video | 3-15s | 40/s (no audio) · 60/s (with audio) |
std-image-to-video | Standart kalite resimden-video | 3-15s | 40/s (no audio) · 60/s (with audio) |
Kling Video O3
Referans ve video düzenleme ile yeni nesil
| Tür | Açıklama | Süre | Krediler |
|---|---|---|---|
o3-pro-text-to-video | O3 Pro metinden-video | 3-15s | 48/s |
o3-pro-image-to-video | O3 Pro resimden-video | 3-15s | 48/s |
o3-pro-reference-to-video | O3 Pro referans resim/video ile | 3-15s | 72/s |
o3-pro-video-edit | O3 Pro video düzenleme | auto | 435 fixed |
o3-std-text-to-video | O3 Standart metinden-video | 3-15s | 36/s |
o3-std-image-to-video | O3 Standart resimden-video | 3-15s | 36/s |
o3-std-reference-to-video | O3 Standart referans-video | 3-15s | 20/s |
o3-std-video-edit | O3 Standart video düzenleme | auto | 360 fixed |
API Uç Noktaları
/api/generateYeni video üretim görevi oluşturun. API, görev türüne göre otomatik olarak doğru backend'e yönlendirir.
İstek Gövdesi
Görev türü (örn: pro-text-to-video, o3-pro-reference-to-video)
Üretilecek videonun metin açıklaması (maks. 2000 karakter)
Video süresi saniye olarak. Kling 3.0: 3-15. O3: 3-15. Defaults to 5.
Çıkış en-boy oranı (16:9, 9:16, 1:1) Defaults to 16:9.
Resimden-video görevleri için resim URL'si
Son kare resim URL'si (sadece resimden-video)
Referans-video veya video-düzenleme görevleri için video URL'si
Referans resim URL'leri dizisi (O3 referans-video, maks. 7)
Yerel ses üretimini etkinleştir Defaults to true.
Belirli elementlerden kaçınmak için negatif prompt
Prompt uyumu (0-1, sadece Kling 3.0) Defaults to 0.5.
Kling 3.0 - Metinden Video
| 1 | { |
| 2 | "type": "pro-text-to-video", |
| 3 | "prompt": "A majestic eagle soaring through clouds at sunset", |
| 4 | "duration": 5, |
| 5 | "aspect_ratio": "16:9", |
| 6 | "sound": true |
| 7 | } |
Kling 3.0 - Resimden Video
| 1 | { |
| 2 | "type": "pro-image-to-video", |
| 3 | "prompt": "The character slowly turns and smiles", |
| 4 | "image": "https://example.com/my-image.jpg", |
| 5 | "duration": 5 |
| 6 | } |
Kling O3 - Referanstan Video
| 1 | { |
| 2 | "type": "o3-pro-reference-to-video", |
| 3 | "prompt": "The character walks through a futuristic city", |
| 4 | "images": [ |
| 5 | "https://example.com/character-reference.jpg", |
| 6 | "https://example.com/style-reference.jpg" |
| 7 | ], |
| 8 | "duration": 5, |
| 9 | "aspect_ratio": "16:9" |
| 10 | } |
Kling O3 - Video Düzenleme
| 1 | { |
| 2 | "type": "o3-pro-video-edit", |
| 3 | "prompt": "Change the background to a snowy mountain landscape", |
| 4 | "video": "https://example.com/original-video.mp4", |
| 5 | "keep_original_sound": true |
| 6 | } |
Yanıtlar
Task created successfully
| 1 | { |
| 2 | "code": 200, |
| 3 | "message": "success", |
| 4 | "data": { |
| 5 | "task_id": "n75abc123kling3", |
| 6 | "status": "IN_PROGRESS", |
| 7 | "consumed_credits": 400 |
| 8 | } |
| 9 | } |
/api/statusVideo üretim görevinin durumunu kontrol edin. task_id ön ekine göre yönlendirme (Kling 3.0 için n75, Kling O3 için n71).
Sorgu Parametreleri
Generate uç noktasından dönen benzersiz görev ID'si (örn: Kling 3.0 için n75xxx, O3 için n71xxx)
Örnek İstek
| 1 | curl -X GET 'https://kling3api.com/api/status?task_id=n75abc123kling3' \ |
| 2 | -H 'Authorization: Bearer YOUR_API_KEY' |
💡 Tip: Durum API'sindeki response alanı video URL'leri dizisidir. Video URL'sini almak için doğrudan data.response[0]'e erişebilirsiniz.
| 1 | // Extract video URL from response |
| 2 | const videoUrl = data.response[0]; |
Yanıtlar
| 1 | { |
| 2 | "code": 200, |
| 3 | "message": "success", |
| 4 | "data": { |
| 5 | "task_id": "n75abc123kling3", |
| 6 | "status": "SUCCESS", |
| 7 | "consumed_credits": 400, |
| 8 | "created_at": "2026-02-05T10:30:00Z", |
| 9 | "request": { |
| 10 | "type": "pro-text-to-video", |
| 11 | "prompt": "A majestic eagle soaring through clouds at sunset", |
| 12 | "duration": 5, |
| 13 | "aspect_ratio": "16:9" |
| 14 | }, |
| 15 | "response": [ |
| 16 | "https://cdn.example.com/videos/abc123.mp4" |
| 17 | ], |
| 18 | "error_message": null, |
| 19 | "type": "pro-text-to-video" |
| 20 | } |
| 21 | } |
API Oyun Alanı
API'yi doğrudan tarayıcınızdan test edin. YOUR_API_KEY'i gerçek API anahtarınızla değiştirin.
Hata Kodları
| Status | Code | Description |
|---|---|---|
| 400 Geçersiz İstek | INVALID_PROMPT | Prompt geçersiz veya boş |
| 400 Geçersiz İstek | INVALID_DURATION | Süre desteklenen aralığın dışında |
| 400 Geçersiz İstek | INVALID_TYPE | Desteklenmeyen görev türü |
| 400 Geçersiz İstek | MISSING_IMAGE | Resimden-video görevleri için resim gerekli |
| 400 Geçersiz İstek | MISSING_VIDEO | Video düzenleme görevleri için video gerekli |
| 401 Yetkisiz | INVALID_API_KEY | API anahtarı eksik veya geçersiz |
| 402 | INSUFFICIENT_CREDITS | Bu işlem için yeterli kredi yok |
| 429 Çok Fazla İstek | RATE_LIMITED | Çok fazla istek, lütfen yavaşlayın |
| 500 Sunucu Hatası | INTERNAL_ERROR | Sunucu hatası, lütfen daha sonra tekrar deneyin |