Kling Video Generation API Documentation
Call the BeeRoute video generation API to generate video content. This document is dedicated to the Kling series of video generation models, supporting text-to-video, image-to-video (first-frame based), image-to-video (first/last-frame based), reference-to-video, and video editing.
Download the MD file of this document
1. Supported Models
Model List
| Model Name | Description | Use Cases |
|---|---|---|
kling-v3-omni-video-generation | Kling V3 all-in-one video generation | Text-to-video, image-to-video, reference-to-video, video editing |
kling-v3-video-generation | Kling V3 video generation | Text-to-video, image-to-video (first frame / first-last frame) |
Kling Video Generation
| Model | Resolution | Mode | Price (USD) |
|---|---|---|---|
| kling-v3-video-generation | 720P | std (standard) | $0.0985 / second |
| 1080P | pro (professional) | $0.1314 / second | |
| kling-v3-omni-video-generation | 720P | std (standard) | $0.0985 / second |
| 1080P | pro (professional) | $0.1314 / second |
Billing Notes:
- Billed by the actual duration (seconds) of the generated video; the
durationparameter directly affects the cost.- The watermark feature (
watermark) incurs no additional charge.
2. Generate Video
Since video generation tasks take a relatively long time (usually 1-5 minutes), the API uses asynchronous calls. The entire process consists of two core steps: "Create task → Poll for result".
API Endpoint
POST /v1/videos
Request Headers
| Parameter | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | User authentication token (Bearer sk-xxxx) |
| Content-Type | string | Yes | application/json |
Request Parameters (JSON Body)
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model name. Options:kling-v3-omni-video-generationkling-v3-video-generation |
| input | object | Yes | Basic input information such as prompt and media materials. See input Parameter Descriptions below. |
| parameters | object | No | Video generation parameters such as generation mode, aspect ratio, video duration, etc. See parameters Parameter Descriptions below. |
input Parameter Descriptions
| Parameter | Type | Required | Description |
|---|---|---|---|
| prompt | string | Conditionally required | Text prompt. Describes the elements and visual characteristics expected in the generated video. Supports Chinese and English, no more than 2500 characters; excess is automatically truncated. Logic: - Required when shot_type=intelligence.- Not effective when shot_type=customize; multi_prompt takes precedence.Omni model reference format (only kling-v3-omni-video-generation):Reference subjects/images/videos via the <<<>>> format, e.g. <<<element_1>>>, <<<image_1>>>, <<<video_1>>>. The reference order is defined by the order of the media array. |
| media | array | No | Media material list, used to specify image or video materials. Not required for text-to-video tasks. See media Element Descriptions below. |
| multi_shot | boolean | No | Whether to enable multi-shot generation.false (default): not enabled.true: enables multi-shot generation. |
| shot_type | string | Conditionally required | Required when multi_shot=true. Multi-shot mode type:intelligence: smart storyboarding, the model automatically plans shots.customize: customize mode, supports custom prompts and durations for each segment. |
| multi_prompt | array | Conditionally required | Required when shot_type=customize. List of segments in multi-shot customize mode. See multi_prompt Element Descriptions below. |
| element_list | array | No | Subject list, used to specify subject elements to be introduced into the video. See element_list Element Descriptions below. |
media Element Descriptions
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | Media material type.kling-v3-video-generation options:- first_frame: first-frame image- last_frame: last-frame imagekling-v3-omni-video-generation options:- first_frame: first-frame image- last_frame: last-frame image- refer: reference image- base: video to be edited- feature: feature reference video |
| url | string | Yes | Media material URL (HTTP/HTTPS protocol). Image restrictions (type=first_frame / last_frame / refer): - Format: JPEG, JPG, PNG (transparent channel not supported) - Resolution: width/height range [300, 8000] pixels - File size: ≤10MB Video restrictions (type=base / feature): - Format: mp4, mov - Duration: 3 ~ 10s - Resolution: width/height range [720, 2160] pixels - File size: ≤200MB - Frame rate: 24 ~ 60fps |
| keep_original_sound | string | No | Only supported by kling-v3-omni-video-generation.Effective when a video is passed (type=base or feature). no (default): do not keep the original sound.yes: keep the original sound. |
Material Combination Rules
kling-v3-video-generation supports the following combinations:
- Image-to-video, first-frame based:
first_frame(1 first-frame image) - Image-to-video, first/last-frame based:
first_frame+last_frame(1 first-frame image, 1 last-frame image)
kling-v3-omni-video-generation supports the following combinations:
- Image-to-video, first-frame based:
first_frame(1 image) - Image-to-video, first/last-frame based:
first_frame+last_frame(1 each) - Reference-to-video:
featureonly: must pass 1 videoreferonly: the sum of reference images andelement_listcount ≤ 7feature+refer: 1 video, the sum of reference images andelement_listcount ≤ 4feature+first_frame: 1 video + 1 first frame
- Video editing:
baseonly: must pass 1 videobase+refer: 1 video, the sum of reference images andelement_listcount ≤ 4
multi_prompt Element Descriptions
| Parameter | Type | Required | Description |
|---|---|---|---|
| index | integer | Yes | Storyboard segment index; the number of shots is 1 ~ 6, indexed from 0. |
| prompt | string | Yes | Prompt for the corresponding segment, no more than 512 characters; excess is automatically truncated. |
| duration | integer | Yes | Duration of the corresponding segment (seconds), an integer between [1, parameters.duration]. |
element_list Element Descriptions
| Parameter | Type | Required | Description |
|---|---|---|---|
| element_id | integer | Conditionally required | Required when passing element_list. Subject ID; please refer to the Kling subject ID list to obtain it.Quantity limits: - Image-to-video, first-frame/first-last-frame based: up to 3 subjects - Reference-to-video ( type=refer): the sum of reference images and subject count ≤ 7- Reference-to-video ( type=feature+refer): the sum of reference images and subject count ≤ 4 |
parameters Parameter Descriptions
| Parameter | Type | Required | Description |
|---|---|---|---|
| mode | string | No | Video generation mode.pro (default): professional mode, outputs 1080P.std: standard mode, outputs 720P. |
| aspect_ratio | string | Conditionally required | Aspect ratio of the generated video. Options: 16:9 (default), 9:16, 1:1.Scenarios where it must be set: - Text-to-video - Reference-to-video ( type=feature, type=feature+refer, type=refer)Scenarios where it is not required (based on the aspect ratio of the first frame or input video): - Image-to-video, first-frame/first-last-frame based - Reference-to-video ( type=feature+first_frame)- Video editing |
| duration | integer | No | Generated video duration (seconds). - kling-v3-omni-video-generation: integer [3, 15], default 5. When a reference video is passed, [3, 10], default 5.- kling-v3-video-generation: integer [3, 15], default 5.⚠️ duration directly affects cost, billed per second. |
| audio | boolean | No | Whether to generate video with sound (automatically generates background music or sound effects based on the video content).false (default): outputs silent video.true: outputs video with sound.** |
| watermark | boolean | No | Whether to add a watermark (located in the bottom-right corner of the video, with the fixed text "Kling AI").false (default): not added.true: adds a watermark. |
Request Examples
1. Text-to-Video
curl --location --request POST 'https://beeroute.ai/v1/videos' \
--header 'Authorization: Bearer sk-xxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "kling-v3-video-generation",
"input": {
"prompt": "A kitten running under the moonlight"
},
"parameters": {
"mode": "std",
"aspect_ratio": "16:9",
"duration": 5,
"audio": false,
"watermark": true
}
}'
2. Text-to-Video (Smart Storyboarding)
curl --location --request POST 'https://beeroute.ai/v1/videos' \
--header 'Authorization: Bearer sk-xxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "kling-v3-video-generation",
"input": {
"prompt": "",
"multi_shot": true,
"shot_type": "customize",
"multi_prompt": [
{
"index": 1,
"prompt": "Fogridge Town is even smaller than it looks on the map, with mountain fog clogging the street corners like cotton wool. Behind the post office there are indeed three locust trees, and the soil beside the roots of the third one has been disturbed.",
"duration": 5
},
{
"index": 2,
"prompt": "Lin Che crouches down and digs up an iron box containing a rusty key and an old cassette tape.",
"duration": 5
}
],
"media": [],
"element_list": []
},
"parameters": {
"mode": "pro",
"duration": 10,
"audio": true,
"aspect_ratio": "9:16",
"watermark": true
}
}'
3. Image-to-Video (First-Frame Based)
curl --location --request POST 'https://beeroute.ai/v1/videos' \
--header 'Authorization: Bearer sk-xxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "kling-v3-omni-video-generation",
"input": {
"prompt": "Bring the person in the image to life, with their hair blowing in the breeze",
"media": [
{
"type": "first_frame",
"url": "https://example.com/first_frame.jpg"
}
]
},
"parameters": {
"mode": "std",
"duration": 5,
"audio": false,
"watermark": true
}
}'
4. Image-to-Video (First/Last-Frame Based)
curl --location --request POST 'https://beeroute.ai/v1/videos' \
--header 'Authorization: Bearer sk-xxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "kling-v3-omni-video-generation",
"input": {
"prompt": "Realistic style: a little black kitten looks curiously up at the sky; the camera rises gradually from eye level and ends with a high-angle shot of its curious eyes.",
"media": [
{
"type": "first_frame",
"url": "https://example.com/first_frame.png"
},
{
"type": "last_frame",
"url": "https://example.com/last_frame.png"
}
]
},
"parameters": {
"mode": "std",
"duration": 5,
"audio": false,
"watermark": true
}
}'
5. Reference-to-Video (Video + Image)
Only supported by kling-v3-omni-video-generation.
curl --location --request POST 'https://beeroute.ai/v1/videos' \
--header 'Authorization: Bearer sk-xxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "kling-v3-omni-video-generation",
"input": {
"prompt": "With <<<element_1>>> as the background, <<<image_2>>> and <<<image_1>>> shake hands and talk, while the character from <<<video_1>>>, a detective in a black trench coat, stands on the apartment rooftop",
"multi_shot": false,
"shot_type": "intelligence",
"multi_prompt": [],
"media": [
{
"url": "https://example.com/reference_video.mp4",
"type": "base",
"keep_original_sound": "yes"
},
{
"type": "refer",
"url": "https://example.com/refer_image_1.jpg"
},
{
"type": "refer",
"url": "https://example.com/refer_image_2.jpg"
}
],
"element_list": [
{
"element_id": 171
}
]
},
"parameters": {
"mode": "pro",
"duration": 10,
"audio": false,
"aspect_ratio": "1:1",
"watermark": true
}
}'
Response Format
200 - Submitted Successfully
{
"id": "task-xxxxxxxxxxxx"
}
Note: The task ID is valid for 24 hours; the result cannot be queried after expiration. Do not create duplicate tasks; just poll using the returned ID.
Error Response
{
"code": "InvalidApiKey",
"message": "No API-key provided.",
"request_id": "7438d53d-6eb8-4596-8835-xxxxxx"
}
3. Query Task Status
Video generation usually takes 1-5 minutes; poll the status using the task ID. A polling interval of 15 seconds is recommended.
API Endpoint
GET /v1/videos/{video_id}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| video_id | string | Yes | The id returned by the generation API |
Request Example
curl --location --request GET 'https://beeroute.ai/v1/videos/task-xxxxxxxxxxxx' \
--header 'Authorization: Bearer sk-xxx'
Response Format
200 - Completed Successfully (Completed)
{
"id": "task-xxxxxxxxxxxx",
"object": "video.generation",
"model": "kling-v3-video-generation",
"status": "completed",
"progress": "100%",
"created_at": 1769263230,
"started_at": 1769263245,
"completed_at": 1769263322,
"video_url": "https://xxx/xxx.mp4",
"watermark_video_url": "https://xxx/xxx_watermark.mp4",
"orig_prompt": "A kitten running under the moonlight",
"usage": {
"duration": 5,
"size": "1280*720",
"fps": 24,
"video_count": 1,
"audio": false,
"SR": "720"
}
}
200 - Processing
{
"id": "kling-task-xxxxxxxxxxxx",
"object": "video.generation",
"model": "kling-v3-video-generation",
"status": "processing",
"progress": "50%",
"created_at": 1769263230,
"started_at": 1769263245
}
200 - Queued
{
"id": "kling-task-xxxxxxxxxxxx",
"object": "video.generation",
"model": "kling-v3-video-generation",
"status": "queued",
"progress": "0%",
"created_at": 1769263230
}
200 - Task Failed (Failed)
{
"id": "kling-task-xxxxxxxxxxxx",
"object": "video.generation",
"model": "kling-v3-video-generation",
"status": "failed",
"created_at": 1769263230,
"started_at": 1769263245,
"completed_at": 1769263322,
"code": "InvalidParameter",
"message": "The parameter is invalid xxxxxx"
}
Key Field Descriptions
| Field | Type | Description |
|---|---|---|
| id | string | Task ID. |
| object | string | Fixed as video.generation. |
| model | string | The model name used. |
| status | string | Task status:queued: queuedprocessing: processingcompleted: completedfailed: failed |
| progress | string | Generation progress percentage (e.g. "50%", "100%"). |
| created_at | integer | Task creation time (Unix timestamp). |
| started_at | integer | Task processing start time (Unix timestamp). |
| completed_at | integer | Task completion time (Unix timestamp). |
| video_url | string | Video download link (returned only when completed). MP4 format (H.264 encoding); the link is valid for 30 days, please download promptly. |
| watermark_video_url | string | Download link for the watermarked video (returned only when completed). The link is valid for 30 days. |
| orig_prompt | string | The original input prompt. |
| usage | object | Output information statistics (returned only when completed). |
| usage.duration | integer | Total duration of the generated video (seconds), used for billing. |
| usage.size | string | Resolution of the generated video. Example: "1280*720". |
| usage.fps | integer | Frame rate of the generated video. Example: 24. |
| usage.SR | string | Resolution tier of the generated video. Example: "720". |
| usage.audio | boolean | Whether it is a video with sound. |
| usage.video_count | integer | Number of generated videos, fixed at 1. |
| code | string | Error code (returned only when failed). |
| message | string | Error details (returned only when failed). |
4. Task Status Transitions
queued → processing → completed / failed
- The initial query status is usually
queuedorprocessing. - When the status becomes
completed, the response will includevideo_url. - If the status is
failed, check thecodeandmessageerror information and retry. - The task ID is valid for 24 hours; the result cannot be queried after expiration.
5. Applicable Models per Scenario (Quick Reference)
| Scenario | kling-v3-video-generation | kling-v3-omni-video-generation |
|---|---|---|
| Text-to-video | ✅ | ✅ |
| Text-to-video (smart storyboarding) | ✅ | ✅ |
| Image-to-video, first-frame based | ✅ | ✅ |
| Image-to-video, first/last-frame based | ✅ | ✅ |
| Reference-to-video | ❌ | ✅ |
| Video editing | ❌ | ✅ |
Last updated 2026-11-27 · Markdown source · llms.txt