BeeRoute logoBeeRoute.

Home / Docs / Kling Video Generation API Documentation

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 NameDescriptionUse Cases
kling-v3-omni-video-generationKling V3 all-in-one video generationText-to-video, image-to-video, reference-to-video, video editing
kling-v3-video-generationKling V3 video generationText-to-video, image-to-video (first frame / first-last frame)

Kling Video Generation

ModelResolutionModePrice (USD)
kling-v3-video-generation720Pstd (standard)$0.0985 / second
1080Ppro (professional)$0.1314 / second
kling-v3-omni-video-generation720Pstd (standard)$0.0985 / second
1080Ppro (professional)$0.1314 / second

Billing Notes:

  • Billed by the actual duration (seconds) of the generated video; the duration parameter 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

ParameterTypeRequiredDescription
AuthorizationstringYesUser authentication token (Bearer sk-xxxx)
Content-TypestringYesapplication/json

Request Parameters (JSON Body)

ParameterTypeRequiredDescription
modelstringYesModel name. Options:
kling-v3-omni-video-generation
kling-v3-video-generation
inputobjectYesBasic input information such as prompt and media materials. See input Parameter Descriptions below.
parametersobjectNoVideo generation parameters such as generation mode, aspect ratio, video duration, etc. See parameters Parameter Descriptions below.

input Parameter Descriptions

ParameterTypeRequiredDescription
promptstringConditionally requiredText 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.
mediaarrayNoMedia material list, used to specify image or video materials. Not required for text-to-video tasks. See media Element Descriptions below.
multi_shotbooleanNoWhether to enable multi-shot generation.
false (default): not enabled.
true: enables multi-shot generation.
shot_typestringConditionally requiredRequired 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_promptarrayConditionally requiredRequired when shot_type=customize. List of segments in multi-shot customize mode. See multi_prompt Element Descriptions below.
element_listarrayNoSubject list, used to specify subject elements to be introduced into the video. See element_list Element Descriptions below.
media Element Descriptions
ParameterTypeRequiredDescription
typestringYesMedia material type.

kling-v3-video-generation options:
- first_frame: first-frame image
- last_frame: last-frame image

kling-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
urlstringYesMedia 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_soundstringNoOnly 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:
    • feature only: must pass 1 video
    • refer only: the sum of reference images and element_list count ≤ 7
    • feature + refer: 1 video, the sum of reference images and element_list count ≤ 4
    • feature + first_frame: 1 video + 1 first frame
  • Video editing:
    • base only: must pass 1 video
    • base + refer: 1 video, the sum of reference images and element_list count ≤ 4
multi_prompt Element Descriptions
ParameterTypeRequiredDescription
indexintegerYesStoryboard segment index; the number of shots is 1 ~ 6, indexed from 0.
promptstringYesPrompt for the corresponding segment, no more than 512 characters; excess is automatically truncated.
durationintegerYesDuration of the corresponding segment (seconds), an integer between [1, parameters.duration].
element_list Element Descriptions
ParameterTypeRequiredDescription
element_idintegerConditionally requiredRequired 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

ParameterTypeRequiredDescription
modestringNoVideo generation mode.
pro (default): professional mode, outputs 1080P.
std: standard mode, outputs 720P.
aspect_ratiostringConditionally requiredAspect 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
durationintegerNoGenerated 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.
audiobooleanNoWhether 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.**
watermarkbooleanNoWhether 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

ParameterTypeRequiredDescription
video_idstringYesThe 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

FieldTypeDescription
idstringTask ID.
objectstringFixed as video.generation.
modelstringThe model name used.
statusstringTask status:
queued: queued
processing: processing
completed: completed
failed: failed
progressstringGeneration progress percentage (e.g. "50%", "100%").
created_atintegerTask creation time (Unix timestamp).
started_atintegerTask processing start time (Unix timestamp).
completed_atintegerTask completion time (Unix timestamp).
video_urlstringVideo download link (returned only when completed). MP4 format (H.264 encoding); the link is valid for 30 days, please download promptly.
watermark_video_urlstringDownload link for the watermarked video (returned only when completed). The link is valid for 30 days.
orig_promptstringThe original input prompt.
usageobjectOutput information statistics (returned only when completed).
usage.durationintegerTotal duration of the generated video (seconds), used for billing.
usage.sizestringResolution of the generated video. Example: "1280*720".
usage.fpsintegerFrame rate of the generated video. Example: 24.
usage.SRstringResolution tier of the generated video. Example: "720".
usage.audiobooleanWhether it is a video with sound.
usage.video_countintegerNumber of generated videos, fixed at 1.
codestringError code (returned only when failed).
messagestringError details (returned only when failed).

4. Task Status Transitions

queued → processing → completed / failed
  • The initial query status is usually queued or processing.
  • When the status becomes completed, the response will include video_url.
  • If the status is failed, check the code and message error 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)

Scenariokling-v3-video-generationkling-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