Skip to main content
POST
Kling 4.0 Flash Video Edit

Authorizations

Authorization
string
header
required

API Key authentication. Format: Bearer YOUR_API_KEY.

Body

application/json

Kling 4.0 Flash Video Edit request. Media inputs must be accessible HTTP(S) URLs; base64 and data URIs are not accepted. Images, videos and subjects combined must not exceed 15 references.

prompt
string
required

Required non-whitespace prompt. Up to 26,000 English characters or 11,000 non-English characters. Mixed prompts must satisfy English/26000 + non-English/11000 <= 1. Reference labels follow input order: @image_1, @video_1 and @element_1.

Required string length: 1 - 26000
Example:

"Edit @video_1. Remove the person in the foreground. Keep everything else unchanged."

video
string<uri>
required

Required base video URL for editing (MP4/MOV). All supplied video inputs together must fit within 20 seconds, with a minimum video duration of 3 seconds. Media validity is checked by the upstream service.

Minimum string length: 1
Pattern: ^[Hh][Tt][Tt][Pp][Ss]?://[^\s]+$
Example:

"https://example.com/source.mp4"

duration
integer

Optional output duration in seconds (3-20). When omitted, duration is inferred from the prompt and inputs. Final billing uses the output duration reported for the completed task.

Required range: 3 <= x <= 20
Example:

5

resolution
enum<string>
default:720p

Output resolution. 720p is native; 1080p, 2k and 4k are upscaled outputs.

Available options:
720p,
1080p,
2k,
4k
first_frame_image
string<uri>

Publicly accessible first keyframe image URL. Optional.

Minimum string length: 1
Pattern: ^[Hh][Tt][Tt][Pp][Ss]?://[^\s]+$
Example:

"https://example.com/frame.png"

reference_images
string<uri>[]

Reference image URLs, ordered after the optional first keyframe. At most 10 images including that keyframe.

Required array length: 1 - 10 elements
Minimum string length: 1
Pattern: ^[Hh][Tt][Tt][Pp][Ss]?://[^\s]+$
reference_videos
string<uri>[]

Additional motion or camera reference video URLs (MP4/MOV). At most 4 in addition to the base video; total input video duration must not exceed 20 seconds.

Required array length: 1 - 4 elements
Minimum string length: 1
Pattern: ^[Hh][Tt][Tt][Pp][Ss]?://[^\s]+$
subject_ids
string[]

Existing subject IDs available through this model's channel, referenced as @element_1, @element_2, and so on. This endpoint does not create subjects.

Required array length: 1 - 7 elements
Minimum string length: 1
audio
enum<string>
default:native

native generates new audio; original preserves the source video audio and disables generated audio.

Available options:
native,
original
aspect_ratio
enum<string>
default:adaptive

Output aspect ratio. adaptive follows the source video.

Available options:
adaptive,
21:9,
16:9,
9:16,
1:1

Response

Task submitted successfully

code
integer
required

Response code, 0 indicates success

Example:

0

message
string
required

Response message

Example:

"success"

data
object
required

Detailed data about the submitted asynchronous task.