Kling-API-Dokumentation

Vollständige Anleitung, um Kling 4.0, Kling 4.0 Flash, Kling 3.0 und Kling Video O3 mit einem API-Schlüssel in deine Anwendung einzubinden.

API v1.0 Base URL: https://kling3api.com

Schnellstart

bash
1curl -X POST 'https://kling3api.com/api/generate' \
2 -H 'Authorization: Bearer YOUR_API_KEY' \
3 -H 'Content-Type: application/json' \
4 -d '{
5 "model": "kling-4.0",
6 "prompt": "A cinematic shot of mountains at sunrise",
7 "duration": 5,
8 "resolution": "1080p",
9 "aspect_ratio": "16:9"
10 }'

Authentifizierung

Alle API-Anforderungen erfordern eine Authentifizierung mit einem Bearer-Token im Authorization-Header.

API-Schlüssel erhalten: Sie können Ihren API-Schlüssel von der API-Seite in Ihrem Dashboard erhalten. → API-Schlüssel erhalten

http
1Authorization: Bearer YOUR_API_KEY

Verfügbare Modelle

4.0

Kling 4.0 Neu

Szenen von 3–30 s in 720p oder 1080p mit Referenzen, Subjekten, Stimmen und Keyframes

Modellanleitung →

Auswahl mit "model": "kling-4.0"

TypBeschreibungDauerCredits
reference-to-videoText, Referenzbilder, Subjekte und Stimmen (automatisch gewählt)3-30s28.5/s (720p) · 42.5/s (1080p)
keyframe-to-videoErstes, mittlere und letztes Bild (automatisch gewählt)3-30s28.5/s (720p) · 42.5/s (1080p)
Flash

Kling 4.0 Flash Neu

Günstigere 720p-Clips mit Bild-zu-Video, Referenzen und Videobearbeitung

Modellanleitung →

Auswahl mit "model": "kling-4.0-flash"

TypBeschreibungDauerCredits
text-to-videoText zu Video, 720p3-20s24/s
image-to-videoAnimiert ein Startbild, Prompt optional3-20s24/s
reference-to-videoBis zu 10 Bilder und 5 Referenzvideos3-20s24/s · 32/s (videos)
video-editBearbeitet ein Quellvideo per Prompt, Abrechnung pro Sekunde des Quellvideosauto (3-20s)32/s
3.0

Kling 3.0

Hochwertige 4K-Videoerstellung

TypBeschreibungDauerCredits
pro-text-to-videoPro-Qualität Text-zu-Video-Erstellung3-15s54/s (no audio) · 80/s (with audio)
pro-image-to-videoPro-Qualität Bild-zu-Video-Animation3-15s54/s (no audio) · 80/s (with audio)
std-text-to-videoStandard-Qualität Text-zu-Video3-15s40/s (no audio) · 60/s (with audio)
std-image-to-videoStandard-Qualität Bild-zu-Video3-15s40/s (no audio) · 60/s (with audio)
O3

Kling Video O3

Nächste Generation mit Referenz & Video-Bearbeitung

TypBeschreibungDauerCredits
o3-pro-text-to-videoO3 Pro Text-zu-Video3-15s48/s
o3-pro-image-to-videoO3 Pro Bild-zu-Video3-15s48/s
o3-pro-reference-to-videoO3 Pro mit Referenzbildern/Video3-15s72/s
o3-pro-video-editO3 Pro Video-Bearbeitungauto435 fixed
o3-std-text-to-videoO3 Standard Text-zu-Video3-15s36/s
o3-std-image-to-videoO3 Standard Bild-zu-Video3-15s36/s
o3-std-reference-to-videoO3 Standard Referenz-zu-Video3-15s20/s
o3-std-video-editO3 Standard Video-Bearbeitungauto360 fixed

API-Endpunkte

POST/api/generate

Erstellt einen neuen Videogenerierungs-Task. Setze model für die Kling-4-Familie auf kling-4.0 oder kling-4.0-flash; bei Kling 3.0 und O3 wählt das Feld type das Backend.

Anfragekörper

Body ParametersJSON
model:optional string

Modell der Kling-4-Familie: kling-4.0 oder kling-4.0-flash. Weglassen, um Kling 3.0 oder O3 über das Feld type zu nutzen. Jedes Kling-4-Modell hat eigene Felder; siehe die Modellanleitungen.

type:optional string

Task-Typ für Kling 3.0 / O3 (z. B. pro-text-to-video, o3-pro-reference-to-video). Nicht nötig, wenn model gesetzt ist.

prompt:string

Textbeschreibung des zu erzeugenden Videos. Maximale Länge: 2.000 Zeichen für Kling 3.0, 8.000 für Kling 4.0 und 2.500 für Kling 4.0 Flash.

duration:optional number

Videodauer in Sekunden. Kling 3.0: 3-15. O3: 3-15. Defaults to 5.

aspect_ratio:optional string

Ausgabeseitenverhältnis (16:9, 9:16, 1:1) Defaults to 16:9.

image:optional string

Bild-URL für Bild-zu-Video-Aufgaben

end_image:optional string

Endframe-Bild-URL (nur Bild-zu-Video)

video:optional string

Video-URL für Referenz-zu-Video oder Video-Bearbeitungsaufgaben

images:optional string[]

Array von Referenz-Bild-URLs (O3 Referenz-zu-Video, max. 7)

sound:optional boolean

Native Audio-Erstellung aktivieren Defaults to true.

negative_prompt:optional string

Negativer Prompt zur Vermeidung bestimmter Elemente

cfg_scale:optional number

Prompt-Adhärenz (0-1, nur Kling 3.0) Defaults to 0.5.

Kling 4.0 - Referenzbilder

json
1{
2 "model": "kling-4.0",
3 "prompt": "The woman from @image_1 walks into the cafe from @image_2 and orders a coffee",
4 "image_urls": [
5 "https://example.com/woman.jpg",
6 "https://example.com/cafe.png"
7 ],
8 "duration": 8,
9 "resolution": "1080p",
10 "aspect_ratio": "9:16"
11}

Kling 4.0 - Keyframes

json
1{
2 "model": "kling-4.0",
3 "prompt": "Start on @first_frame and settle on @last_frame in one continuous move",
4 "first_frame_url": "https://example.com/start.jpg",
5 "last_frame_url": "https://example.com/end.jpg",
6 "duration": 6,
7 "resolution": "720p"
8}

Kling 4.0 Flash - Bild zu Video

json
1{
2 "model": "kling-4.0-flash",
3 "prompt": "The product slowly rotates while soft light sweeps across it",
4 "image": "https://example.com/product.jpg",
5 "duration": 5
6}

Kling 4.0 Flash - Videobearbeitung

json
1{
2 "model": "kling-4.0-flash",
3 "mode": "video-edit",
4 "prompt": "Turn the daytime street into a snowy night",
5 "video": "https://example.com/street.mp4",
6 "keep_original_sound": true
7}

Kling 3.0 - Text zu Video

json
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 - Bild zu Video

json
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 - Referenz zu Video

json
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-Bearbeitung

json
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}

Antworten

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}
GET/api/status

Prüft den Status eines Videogenerierungs-Tasks. Übergib die task_id, die /api/generate für ein beliebiges Modell zurückgibt; die API leitet sie an das richtige Backend weiter.

Abfrageparameter

Body ParametersJSON
task_id:string

Die vom Generate-Endpunkt zurückgegebene Task-ID, für jedes Modell

Beispielanfrage

bash
1curl -X GET 'https://kling3api.com/api/status?task_id=n75abc123kling3' \
2 -H 'Authorization: Bearer YOUR_API_KEY'

💡 Tip: Das Antwortfeld im Status-API ist ein Array von Video-URLs. Sie können direkt auf data.response[0] zugreifen, um die Video-URL zu erhalten.

javascript
1// Extract video URL from response
2const videoUrl = data.response[0];

Antworten

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-Spielplatz

Testen Sie die API direkt in Ihrem Browser. Ersetzen Sie YOUR_API_KEY durch Ihren tatsächlichen API-Schlüssel.

Beispiel-Body
API-PlaygroundPOST

Fehlercodes

StatusCodeDescription
400 Ungültige AnfrageINVALID_PROMPTDer Prompt ist ungültig oder leer
400 Ungültige AnfrageINVALID_DURATIONDauer außerhalb des unterstützten Bereichs
400 Ungültige AnfrageINVALID_TYPENicht unterstützter Aufgabentyp
400 Ungültige AnfrageMISSING_IMAGEBild ist für Bild-zu-Video-Aufgaben erforderlich
400 Ungültige AnfrageMISSING_VIDEOVideo ist für Video-Bearbeitungsaufgaben erforderlich
401 Nicht autorisiertINVALID_API_KEYAPI-Schlüssel fehlt oder ist ungültig
402 INSUFFICIENT_CREDITSNicht genügend Credits für diesen Vorgang
429 Zu viele AnfragenRATE_LIMITEDZu viele Anfragen, bitte verlangsamen
500 Interner ServerfehlerINTERNAL_ERRORServerfehler, bitte versuchen Sie es später erneut