Documentation Kling 3.0 API

Guide complet pour intégrer les APIs Kling 3.0 et Kling Video O3 dans vos applications.

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

Démarrage rapide

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 "type": "pro-text-to-video",
6 "prompt": "A cinematic shot of mountains at sunrise",
7 "duration": 5,
8 "aspect_ratio": "16:9"
9 }'

Authentification

Toutes les requêtes API nécessitent une authentification avec un jeton Bearer dans l'en-tête Authorization.

Obtenir votre clé API: Vous pouvez obtenir votre clé API depuis la page API Keys dans votre tableau de bord. → Obtenir votre clé API

http
1Authorization: Bearer YOUR_API_KEY

Modèles disponibles

3.0

Kling 3.0

Génération vidéo 4K haute qualité

TypeDescriptionDuréeCrédits
pro-text-to-videoGénération texte-vidéo qualité Pro3-15s54/s (no audio) · 80/s (with audio)
pro-image-to-videoAnimation image-vidéo qualité Pro3-15s54/s (no audio) · 80/s (with audio)
std-text-to-videoGénération texte-vidéo qualité Standard3-15s40/s (no audio) · 60/s (with audio)
std-image-to-videoGénération image-vidéo qualité Standard3-15s40/s (no audio) · 60/s (with audio)
O3

Kling Video O3

Nouvelle génération avec référence et édition vidéo

TypeDescriptionDuréeCrédits
o3-pro-text-to-videoO3 Pro texte-vidéo3-15s48/s
o3-pro-image-to-videoO3 Pro image-vidéo3-15s48/s
o3-pro-reference-to-videoO3 Pro avec images/vidéo de référence3-15s72/s
o3-pro-video-editO3 Pro édition vidéoauto435 fixed
o3-std-text-to-videoO3 Standard texte-vidéo3-15s36/s
o3-std-image-to-videoO3 Standard image-vidéo3-15s36/s
o3-std-reference-to-videoO3 Standard référence-vidéo3-15s20/s
o3-std-video-editO3 Standard édition vidéoauto360 fixed

Points de terminaison API

POST/api/generate

Créer une nouvelle tâche de génération vidéo. L'API route automatiquement vers le bon backend selon le type de tâche.

Corps de la requête

Body ParametersJSON
type:string

Type de tâche (ex: pro-text-to-video, o3-pro-reference-to-video)

prompt:string

Description textuelle de la vidéo à générer (max 2000 caractères)

duration:optional number

Durée vidéo en secondes. Kling 3.0: 3-15. O3: 3-15. Defaults to 5.

aspect_ratio:optional string

Ratio d'aspect de sortie (16:9, 9:16, 1:1) Defaults to 16:9.

image:optional string

URL d'image pour les tâches image-to-video

end_image:optional string

URL d'image de frame finale (image-to-video uniquement)

video:optional string

URL vidéo pour les tâches reference-to-video ou video-edit

images:optional string[]

Tableau d'URLs d'images de référence (O3 reference-to-video, max 7)

sound:optional boolean

Activer la génération audio native Defaults to true.

negative_prompt:optional string

Prompt négatif pour éviter certains éléments

cfg_scale:optional number

Adhérence au prompt (0-1, Kling 3.0 uniquement) Defaults to 0.5.

Kling 3.0 - Texte vers Vidéo

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 - Image vers Vidéo

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 - Référence vers Vidéo

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 - Édition Vidéo

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}

Réponses

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

Vérifier le statut d'une tâche de génération vidéo. Routage basé sur le préfixe task_id (n75 pour Kling 3.0, n71 pour Kling O3).

Paramètres de requête

Body ParametersJSON
task_id:string

L'ID unique de tâche retourné par l'endpoint generate (ex: n75xxx pour Kling 3.0, n71xxx pour O3)

Exemple de requête

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

💡 Tip: Le champ response dans l'API de statut est un tableau d'URLs vidéo. Vous pouvez directement accéder à data.response[0] pour obtenir l'URL vidéo.

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

Réponses

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}

Bac à sable API

Testez l'API directement depuis votre navigateur. Remplacez YOUR_API_KEY par votre véritable clé API.

Aire de jeux APIPOST

Codes d'erreur

StatusCodeDescription
400 Mauvaise requêteINVALID_PROMPTLe prompt est invalide ou vide
400 Mauvaise requêteINVALID_DURATIONDurée hors de la plage supportée
400 Mauvaise requêteINVALID_TYPEType de tâche non supporté
400 Mauvaise requêteMISSING_IMAGEImage requise pour les tâches image-to-video
400 Mauvaise requêteMISSING_VIDEOVidéo requise pour les tâches video-edit
401 Non autoriséINVALID_API_KEYClé API manquante ou invalide
402 INSUFFICIENT_CREDITSCrédits insuffisants pour cette opération
429 Trop de requêtesRATE_LIMITEDTrop de requêtes, veuillez ralentir
500 Erreur interne du serveurINTERNAL_ERRORErreur serveur, veuillez réessayer plus tard