Skip to main content
POST
Kling 4.0 I2V

Authorizations

Authorization
string
header
required

API Key authentication. Format: Bearer YOUR_API_KEY.

Body

application/json

Kling 4.0 I2V request. Media inputs must be accessible HTTP(S) URLs; base64 and data URIs are not accepted. At least one of first_frame_image, mid_frame_images or last_frame_image is required. Keyframe images combined must not exceed 10.

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. Use @image_1, @image_2, and so on to refer to keyframes in first, middle, then last frame order.

Required string length: 1 - 26000
Example:

"A cat walks through a sunlit garden."

first_frame_image
string<uri>
required

Publicly accessible first keyframe image URL. Optional.

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

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

duration
integer

Optional output duration in seconds (3-30). 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 <= 30
Example:

5

resolution
enum<string>
default:1080p

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

Available options:
720p,
1080p,
2k,
4k
mid_frame_images
string<uri>[]

Middle keyframe image URLs in temporal order. All keyframes and reference images together must not exceed 10.

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

Publicly accessible last keyframe image URL. A last frame alone is accepted.

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

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

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.