Kling 3.0 API Documentation
Complete guide to integrating the Kling 3.0 and Kling Video O3 APIs into your applications.
API v1.0 Base URL: https://kling3api.com
Quick Start
bash
curl -X POST 'https://kling3api.com/api/generate' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"type": "pro-text-to-video",
"prompt": "A cinematic shot of mountains at sunrise",
"duration": 5,
"aspect_ratio": "16: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.
http
Authorization: Bearer YOUR_API_KEYAvailable Models
3.0
Kling 3.0
High-quality 4K video generation
| Type | Description | Duration | Credits |
|---|---|---|---|
pro-text-to-video | Pro quality text-to-video generation | 5s / 10s | 240 / 480 |
pro-image-to-video | Pro quality image-to-video animation | 5s / 10s | 240 / 480 |
std-text-to-video | Standard quality text-to-video | 5s / 10s | 180 / 360 |
std-image-to-video | Standard quality image-to-video | 5s / 10s | 180 / 360 |
O3
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
POST
/api/generateCreate a new video generation task. The API automatically routes to the correct backend based on task type.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | Required | Task type (e.g., pro-text-to-video, o3-pro-reference-to-video) |
prompt | string | Required | Text description of the video to generate (max 2000 chars) |
duration | number | Optional | Video duration in seconds. Kling 3.0: 5 or 10. O3: 3-15. (Default: 5) |
aspect_ratio | string | Optional | Output aspect ratio (16:9, 9:16, 1:1) (Default: 16:9) |
image | string | Optional | Image URL for image-to-video tasks |
end_image | string | Optional | End frame image URL (image-to-video only) |
video | string | Optional | Video URL for reference-to-video or video-edit tasks |
images | string[] | Optional | Array of reference image URLs (O3 reference-to-video, max 7) |
sound | boolean | Optional | Enable native audio generation (Default: false) |
negative_prompt | string | Optional | Negative prompt to avoid certain elements |
cfg_scale | number | Optional | Prompt adherence (0-1, Kling 3.0 only) (Default: 0.5) |
Kling 3.0 - Text to Video
json
{
"type": "pro-text-to-video",
"prompt": "A majestic eagle soaring through clouds at sunset",
"duration": 5,
"aspect_ratio": "16:9",
"sound": true
}Kling 3.0 - Image to Video
json
{
"type": "pro-image-to-video",
"prompt": "The character slowly turns and smiles",
"image": "https://example.com/my-image.jpg",
"duration": 5
}Kling O3 - Reference to Video
json
{
"type": "o3-pro-reference-to-video",
"prompt": "The character walks through a futuristic city",
"images": [
"https://example.com/character-reference.jpg",
"https://example.com/style-reference.jpg"
],
"duration": 5,
"aspect_ratio": "16:9"
}Kling O3 - Video Edit
json
{
"type": "o3-pro-video-edit",
"prompt": "Change the background to a snowy mountain landscape",
"video": "https://example.com/original-video.mp4",
"keep_original_sound": true
}Responses
Task created successfully
{
"code": 200,
"message": "success",
"data": {
"task_id": "n70abc123kling3",
"status": "IN_PROGRESS",
"consumed_credits": 240
}
}GET
/api/statusAPI Playground
Test the API directly from your browser. Replace YOUR_API_KEY with your actual API key.
API PlaygroundPOST
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 |