Kling Video O3 API
Referensi API lengkap untuk model Kling Video O3 oleh Kuaishou.
Varian Model
API ini mendukung delapan varian model:
Perbandingan Singkat
Rasio Aspek yang Didukung
16:9, 9:16, 1:1
Kling Video O3 Text to Video (Std & Pro)
Endpoint
POST /api/v1/video/task
Parameter Permintaan
Wajib
Opsional
Placeholder Referensi @ (AT)
Fitur referensi @ (AT) menghubungkan media referensi ke prompt melalui placeholder <<<...>>> bernomor. Penomoran gambar dimulai dari 1 dan mengikuti urutan array images. Karena model ini menerima satu URL video referensi, <<<video_1>>> merujuk ke video_url.
Contoh Permintaan
const response = await fetch('https://api.flaq.ai/api/v1/video/task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: 'kling-video-o3-std-text-to-video',
prompt: 'A drone flying over a mountain range at sunrise',
duration: 5,
aspect_ratio: '16:9'
})
});
const { data } = await response.json();
const taskId = data.task_id;
Kling Video O3 Image to Video (Std & Pro)
Parameter Permintaan
Wajib
Opsional
Contoh Permintaan
{
model_name: 'kling-video-o3-pro-image-to-video',
image_url: 'https://example.com/image.jpg',
prompt: 'Camera slowly pulls back revealing the landscape',
duration: 5,
image_end_url: 'https://example.com/end-frame.jpg'
}
Kling Video O3 Reference to Video (Std & Pro)
Parameter Permintaan
Wajib
Opsional
Contoh Permintaan
{
model_name: 'kling-video-o3-std-reference-to-video',
video_url: 'https://example.com/source.mp4',
images: ['https://example.com/reference-a.jpg', 'https://example.com/reference-b.jpg'],
prompt: 'Character walking through a forest',
duration: 8,
aspect_ratio: '16:9',
keep_original_sound: true
}
Kling Video O3 Video Edit (Std & Pro)
Parameter Permintaan
Wajib
Opsional
Contoh Permintaan
{
model_name: 'kling-video-o3-pro-video-edit',
video_url: 'https://example.com/source.mp4',
duration: 5,
images: ['https://example.com/ref.jpg'],
prompt: 'Add falling snow throughout the scene',
keep_original_sound: true
}
Contoh Permintaan Reference-to-Video @ (AT)
{
model_name: 'kling-video-o3-std-reference-to-video',
video_url: 'https://example.com/motion-reference.mp4',
images: [
'https://example.com/athlete-reference.jpg',
'https://example.com/uniform-reference.jpg'
],
prompt: 'Make the athlete from <<<image_1>>> follow the motion in <<<video_1>>> while preserving the uniform details from <<<image_2>>>',
duration: 8,
aspect_ratio: '16:9',
keep_original_sound: true
}
Respons Awal
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "submitted"
}
}
Respons Polling
Lakukan polling pada GET /api/v1/video/{taskId} untuk memeriksa status:
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "succeed",
"task_status_msg": null,
"task_result": {
"videos": [
{
"url": "https://example.com/generated-video.mp4"
}
]
}
}
}
Nilai Status
submitted: Tugas telah dikirim dan sedang menunggu diproses
processing: Pembuatan video sedang berlangsung
succeed: Pembuatan video selesai
failed: Pembuatan video gagal
Waktu Pemrosesan
- Standard: 2-5 menit
- Pro: 3-8 menit
Praktik Terbaik
- Pemilihan Tier: Gunakan Std untuk iterasi, Pro untuk hasil akhir
- Deskripsi Gerakan: Sertakan detail gerakan kamera dan subjek secara spesifik
- Input Referensi: Gunakan gambar referensi atau video referensi yang jelas dan berkualitas tinggi untuk konsistensi karakter
- Prompt Pengeditan Video: Jelaskan secara spesifik apa yang ingin diubah sambil mempertahankan konten aslinya