Kling Videos Generation API
POSThttps://api.ace.324567.xyz/kling/videos

This API can generate videos by inputting prompt words and the first and last frame images.

Agent integrations

Related Products

Kling - 胖狐中转
Kling video generation platform, directly interfaces with this API, high-speed and stable availability.

Request Headers

acceptstring
The format of the server response should be set to application/json.
Please select
authorizationstring
Bearer token

Request Body

actionstringRequired parameter
Video generation action. If the value is `text2video`, then generate a video based on the prompt.
modelstring
The model used for generating videos, with a default value of kling-v1.
Please select
promptstring
Prompts for generating videos. When using Omni All-Purpose Reference (model `kling-o1` or `kling-v3-omni`), you need to reference the corresponding numbers (starting from 1) in `image_list` / `video_list` in the form of `<<<image_1>>>`, `<<<video_1>>>` in the prompts for the model to apply these references; for example, "Change `<<<video_1>>>` to anime style."
start_image_urlstring
You can specify the first frame reference image of the video, which is effective when the action is image2video.
end_image_urlstring
End frame reference image URL. Valid only when `action=image2video` and `start_image_url` is not empty. Model/mode restrictions (consistent with Kling official documentation): `kling-v1` requires `duration=5`; `kling-v1-6`/`kling-v2-5-turbo`/`kling-v2-6` require `mode=pro`; `kling-v3`/`kling-v3-omni`/`kling-o1` support end frames in all modes; `kling-v2-master`/`kling-v2-1-master` do not support end frames.
video_idstring
When the action is extend, you can specify the video_id to continue the extension of that video.
cfg_scalenumber
The strength of relevance of the prompt words, used to control the degree of alignment between the generated video and the prompt words, is optional. The larger the value, the stronger the association between the video and the prompt words (the creative space is smaller); the smaller the value, the higher the degree of creative freedom. The range of values is: [0, 1].
negative_promptstring
Optional parameters, supporting up to 200 characters, used to describe content that you do not wish to appear in the video.
modestring
Video generation mode, optional. Supported values: `std` (high performance mode), `pro` (high quality mode), `4k` (native 4K, only supported by `kling-v3` and `kling-v3-omni`, incompatible with "motion control"). The default value is `std`.
Please select
aspect_ratiostring
Video aspect ratio, optional, enumeration values: 16:9, 9:16, 1:1. The default value is 16:9.
Please select
durationnumber
Video generation duration, measured in seconds, is optional. For kling-v3/kling-v3-omni: supports flexible settings of 3–15 seconds (integer); kling-o1 only supports 5 seconds; other models: enumerated values are 5 or 10. Requests that include tail frames only support 5 seconds.
generate_audioboolean
Whether to generate audio while generating the video, optional. `kling-v3`, `kling-v3-omni`, and `kling-v2-6` (pro mode only) default to false. `kling-v3-turbo` comes with native audio and does not provide a switch to turn it off; omit this field or set it to true. Other models will return an error if set to true.
Please select
image_listarray
Omni reference image list, only applicable to models `kling-o1` and `kling-v3-omni`. Array elements pass image links through `image_url`; optional `type` can be the first frame `first_frame` or the end frame `end_frame`. The current legacy-compatible interface accepts .jpg/.jpeg/.png, with a single image ≤10MB, both width and height ≥300px, and an aspect ratio of 1:2.5–2.5:1. A maximum of 7 images is allowed without a reference video, and a maximum of 4 images is allowed with a reference video; the end frame must be used together with the first frame. Assets must be referenced in the prompt using `<<<image_N>>>`. Omni requests do not support `negative_prompt`, `cfg_scale`, `camera_control`, or `mode=4k`.
video_listarray
Omni reference video list, applicable only to models `kling-o1` and `kling-v3-omni`, with a maximum of 1 MP4/MOV video, ≤200MB, 24–60fps. Model limitations differ: the reference video for `kling-o1` is 3–10 seconds, with width and height each 700–2160px; for `kling-v3-omni`, it is 3–15.5 seconds, with width and height each 700–4553px, total pixels ≤8,294,400, and aspect ratio 0.4–2. `refer_type` can be `feature` or `base` (default); `keep_original_sound` can be `yes` or `no`. Materials must be referenced in the prompt using `<<<video_1>>>`. `base` cannot be used together with the first frame/last frame; when a reference video exists, `generate_audio` must be `false`.
asyncboolean
Whether to process in asynchronous mode. When set to `true`, the interface immediately returns `task_id`, without the need to provide `callback_url`, and then the result can be obtained by polling the corresponding task query interface; if `callback_url` is also provided, the result will be pushed to that callback address.
Please select
shot_typestring
Storyboard method; required when multi_shot=true. intelligence uses prompt for automatic splitting; customize uses multi_prompt.
Please select
multi_shotboolean
Whether to generate a multi-shot video, only kling-v3 and kling-v3-omni are supported.
Please select
voice_listarray
Platform asset ID reference, verify ownership by user and application. Only V2.6 pro with generate_audio=true, the prompt must use <<<voice_1>>> or <<<voice_2>>>; specified voice is billed at 1.68 Credits/second.
callback_urlstring
The callback URL that will be called after the video generation is complete.
element_listarray
Platform asset ID references, ownership validated by user and application. V3, V3 Omni, and O1 only; the total number of subject and image references is limited by the model.
multi_promptarray
1–6 shots, with the index increasing consecutively from 1; each prompt may contain up to 512 characters; the total duration of all shots must equal the total duration. Custom shots do not use the global prompt.
camera_controlobject
Contains 6 fields used to specify the movement or change of the camera in different directions. `camera_control.type` must be one of the following values: `simple`, `down_back`, `forward_up`, `left_turn_forward`, `right_turn_forward`. `camera_control.config` is an optional object that contains 6 optional fields: `camera_control.config.horizontal` (horizontal translation), `camera_control.config.vertical` (vertical translation), `camera_control.config.pan` (horizontal rotation), `camera_control.config.tilt` (pitch rotation), `camera_control.config.roll` (axial rotation), `camera_control.config.zoom` (zoom). The value of each field is of numeric type, with a range of [-1, 1].
typestring
Please select
configobject

Response

Integration guide

Shell

Python

JavaScript

Java

Go

PHP

Kind reminder: For streaming requests, the above code may not be fully applicable. Please refer to the integration documentation for changes.

Kling video generation
Allow Use General Balance

When 'Allow General Balance' is enabled, the general balance is used automatically if an app's balance is insufficient.