API Kling 3.0 Turbo
เอกสารอ้างอิง API ฉบับสมบูรณ์สำหรับโมเดลสร้างวิดีโอ Kling 3.0 Turbo โดย Kuaishou
รุ่นย่อยของโมเดล {#}
API นี้รองรับโมเดลสองรุ่นย่อย:
การเปรียบเทียบอย่างรวดเร็ว
อัตราส่วนภาพที่รองรับ (Text to Video)
Kling 3.0 Turbo Text to Video
จุดปลายทาง
POST /api/v1/video/task
พารามิเตอร์คำขอ
จำเป็น
ไม่บังคับ
ตัวอย่างคำขอ
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-3.0-turbo-text-to-video',
prompt: 'A girl sits on a train, looking out the window with a melancholic expression, cinematic lighting',
aspect_ratio: '16:9',
resolution: '720p',
duration: 5,
sound: true
})
});
const { data } = await response.json();
const taskId = data.task_id;
Kling 3.0 Turbo Image to Video
พารามิเตอร์คำขอ
จำเป็น
ไม่บังคับ
ตัวอย่างคำขอ
{
model_name: 'kling-3.0-turbo-image-to-video',
prompt: 'The character slowly turns her head and looks out the window, subtle camera movement',
image_url: 'https://example.com/test-first-frame.png',
resolution: '720p',
duration: 5,
sound: true
}
รูปแบบการตอบกลับ
การตอบกลับเมื่อส่ง:
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "submitted"
}
}
Polling ด้วย GET /api/v1/video/{task_id} สถานะงาน: submitted, processing, succeed, failed
แนวทางปฏิบัติที่ดีที่สุด
- ให้ prompt โฟกัสที่การเคลื่อนไหว พฤติกรรมกล้อง และบรรยากาศของฉาก
- สำหรับ image-to-video ให้ใช้รูปภาพเฟรมแรกที่สะอาดและมีตัวแบบชัดเจน
- ใช้ระยะเวลาที่สั้นลงเพื่อการทดลองซ้ำที่เร็วขึ้น แล้วค่อยเพิ่มระยะเวลาสำหรับการ render ขั้นสุดท้าย