Kling 3.0 API Documentation
Complete guide to integrating the Kling 3.0 and Kling Video O3 APIs into your applications.
Quick Start
| 1 | curl -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 | }' |
Authentication
All API requests require authentication using a Bearer token in the Authorization header.
Get Your API Key: You can get your API key from the API Keys page in your dashboard. → Get Your API Key
| 1 | Authorization: Bearer YOUR_API_KEY |
Available Models
Kling 3.0
High-quality 4K video generation
| Type | Description | Duration | Credits |
|---|---|---|---|
pro-text-to-video | Pro quality text-to-video generation | 3-15s | 54/s (no audio) · 80/s (with audio) |
pro-image-to-video | Pro quality image-to-video animation | 3-15s | 54/s (no audio) · 80/s (with audio) |
std-text-to-video | Standard quality text-to-video | 3-15s | 40/s (no audio) · 60/s (with audio) |
std-image-to-video | Standard quality image-to-video | 3-15s | 40/s (no audio) · 60/s (with audio) |
Kling Video O3
Next-gen with reference & video editing
| Type | Description | Duration | Credits |
|---|---|---|---|
o3-pro-text-to-video | O3 Pro text-to-video | 3-15s | 48/s |
o3-pro-image-to-video | O3 Pro image-to-video | 3-15s | 48/s |
o3-pro-reference-to-video | O3 Pro with reference images/video | 3-15s | 72/s |
o3-pro-video-edit | O3 Pro video editing | auto | 435 fixed |
o3-std-text-to-video | O3 Standard text-to-video | 3-15s | 36/s |
o3-std-image-to-video | O3 Standard image-to-video | 3-15s | 36/s |
o3-std-reference-to-video | O3 Standard reference-to-video | 3-15s | 20/s |
o3-std-video-edit | O3 Standard video editing | auto | 360 fixed |
API Endpoints
/api/generateCreate a new video generation task. The API automatically routes to the correct backend based on task type.
Request Body
Task type (e.g., pro-text-to-video, o3-pro-reference-to-video)
Text description of the video to generate (max 2000 chars)
Video duration in seconds. Kling 3.0: 3-15. O3: 3-15. Defaults to 5.
Output aspect ratio (16:9, 9:16, 1:1) Defaults to 16:9.
Image URL for image-to-video tasks
End frame image URL (image-to-video only)
Video URL for reference-to-video or video-edit tasks
Array of reference image URLs (O3 reference-to-video, max 7)
Enable native audio generation Defaults to true.
Negative prompt to avoid certain elements
Prompt adherence (0-1, Kling 3.0 only) Defaults to 0.5.
Kling 3.0 - Text to Video
| 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 to Video
| 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 - Reference to Video
| 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 Edit
| 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 | } |
Responses
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 | } |
/api/statusCheck the status of a video generation task. Routes based on task_id prefix (n75 for Kling 3.0, n71 for Kling O3).
Query Parameters
The unique task ID returned from generate endpoint (e.g., n75xxx for Kling 3.0, n71xxx for O3)
Example Request
| 1 | curl -X GET 'https://kling3api.com/api/status?task_id=n75abc123kling3' \ |
| 2 | -H 'Authorization: Bearer YOUR_API_KEY' |
💡 Tip: The response field in the status API is an array of video URLs. You can directly access data.response[0] to get the video URL.
| 1 | // Extract video URL from response |
| 2 | const videoUrl = data.response[0]; |
Responses
| 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 Playground
Test the API directly from your browser. Replace YOUR_API_KEY with your actual API key.
Error Codes
| Status | Code | Description |
|---|---|---|
| 400 Bad Request | INVALID_PROMPT | The prompt is invalid or empty |
| 400 Bad Request | INVALID_DURATION | Duration out of supported range |
| 400 Bad Request | INVALID_TYPE | Unsupported task type |
| 400 Bad Request | MISSING_IMAGE | Image is required for image-to-video tasks |
| 400 Bad Request | MISSING_VIDEO | Video is required for video-edit tasks |
| 401 Unauthorized | INVALID_API_KEY | API key is missing or invalid |
| 402 | INSUFFICIENT_CREDITS | Not enough credits for this operation |
| 429 Too Many Requests | RATE_LIMITED | Too many requests, please slow down |
| 500 Internal Server Error | INTERNAL_ERROR | Server error, please try again later |