Kling Video O3 API
Vollständige API-Referenz für die Kling Video O3-Modelle von Kuaishou.
Modellvarianten
Diese API unterstützt acht Modellvarianten:
Schnellvergleich
Unterstützte Seitenverhältnisse
16:9, 9:16, 1:1
Kling Video O3 Text to Video (Std & Pro)
Endpoint
POST /api/v1/video/task
Anfrageparameter
Erforderlich
Optional
@ (AT)-Referenzplatzhalter
Die @ (AT)-Referenzfunktion verknüpft Referenzmedien über nummerierte <<<...>>>-Platzhalter mit dem Prompt. Die Bildnummerierung beginnt bei 1 und folgt der Reihenfolge des images-Arrays. Da dieses Modell eine Referenzvideo-URL akzeptiert, verweist <<<video_1>>> auf video_url.
Beispielanfrage
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)
Anfrageparameter
Erforderlich
Optional
Beispielanfrage
{
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)
Anfrageparameter
Erforderlich
Optional
Beispielanfrage
{
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)
Anfrageparameter
Erforderlich
Optional
Beispielanfrage
{
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
}
Beispielanfrage für @ (AT) Reference-to-Video
{
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
}
Erste Antwort
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "submitted"
}
}
Polling-Antwort
Rufe GET /api/v1/video/{taskId} ab, um den Status zu prüfen:
{
"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"
}
]
}
}
}
Statuswerte
submitted: Aufgabe angenommen und wartet auf Verarbeitung
processing: Videoerzeugung läuft
succeed: Videoerzeugung abgeschlossen
failed: Videoerzeugung fehlgeschlagen
Verarbeitungszeit
- Standard: 2-5 Minuten
- Pro: 3-8 Minuten
Best Practices
- Tier Selection: Std für Iterationen, Pro für die finale Ausgabe verwenden
- Motion Description: Spezifische Details zu Kamera- und Motivbewegung angeben
- Referenzeingaben: Klare, hochwertige Referenzbilder oder Referenzvideos für Charakterkonsistenz verwenden
- Video Edit Prompts: Genau beschreiben, was geändert werden soll, während der Originalinhalt erhalten bleibt