Kling 4.0 is Kuaishou's newest flagship Kling video model and generates sound with every clip. One model id, kling-4.0, covers two routes: a prompt alone or a prompt with reference images, reference videos, named subjects and voices (called by @mention) is reference-to-video; first, middle and last frames are keyframe-to-video. Any whole length from 3 to 30 seconds, at 720p or 1080p. Billed per billed second: without video input $0.157/s at 720p and $0.235/s at 1080p; with a reference video $0.094 / $0.141 per billed second.
| Petición | 720p | 1080p | Billed seconds |
|---|---|---|---|
| Per second, no video input | $0.157 | $0.235 | Output length |
| Per billed second, with reference video / video subject | $0.094 | $0.141 | Output + max(input video, output) |
| 5 s, no video input | $0.785 | $1.175 | 5 |
| 10 s, no video input | $1.57 | $2.35 | 10 |
| 30 s, no video input | $4.71 | $7.05 | 30 |
| 10 s output + 5 s reference video | $1.88 | $2.82 | 20 |
| 10 s output + 20 s reference video | $2.82 | $4.23 | 30 |
Without video input (text, reference images, image subjects, voices, keyframes) the billed seconds equal the output length. With a reference video or video subject the billed seconds are output + max(total input video, output); each clip is rounded up to whole seconds and measured by us when the task is created. Reference images, subject images and keyframes are not billed separately; the smallest request (720p, 3 s) is $0.471. Charged only on success; failed generations are not charged.
All requests carry the API key in the header:
Authorization: Bearer YOUR_API_KEYhttps://api.apimodels.app/v1/video/generations·GET/v1/video/generations?task_id=# Reference-to-video: images + a reference video, mentioned by position
curl -X POST https://api.apimodels.app/v1/video/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-4.0",
"prompt": "The dancer in @image_1 performs the routine from @video_1 on the rooftop in @image_2 at dusk",
"image_urls": ["https://example.com/dancer.png", "https://example.com/rooftop.jpg"],
"video_urls": ["https://example.com/routine.mp4"],
"keep_original_sound": false,
"duration": 10,
"resolution": "720p",
"aspect_ratio": "9:16"
}'
# Keyframe-to-video: first + middle + last frame (a 5 s clip takes up to 6 frames)
curl -X POST https://api.apimodels.app/v1/video/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-4.0",
"prompt": "The girl in @first_frame walks out, crosses the street in @keyframe_1 and arrives at the party in @last_frame",
"first_frame_url": "https://example.com/first.png",
"keyframe_urls": ["https://example.com/street.png"],
"last_frame_url": "https://example.com/party.png",
"duration": 5,
"resolution": "1080p"
}'
# Response (async — a task is created):
# { "code": 200, "msg": "success", "data": { "taskId": "clxxx", "state": "pending" } }
# Poll until completed (result files are kept 30 days)
curl "https://api.apimodels.app/v1/video/generations?task_id=TASK_ID" \
-H "Authorization: Bearer YOUR_API_KEY"
# { "code": 200, "data": { "state": "completed",
# "resultUrls": ["https://r2.apimodels.app/videos/clxxx.mp4"] } }elements and voices are API-only for now (the playground covers reference images, reference videos and keyframes). Image subject: image_urls with 2-4 images, the first being the main view. Video subject: video_url with one 3-8 second single-shot character clip, shortest side at least 700 px; at most 3 video subjects. tag is optional: character, animal, prop, costume, scene, effect or others (video subjects can only be character); description up to 100 characters; voice_url only on character subjects. voices are standalone {name, audio_url} clips, up to 3, and must contain a recognizable voice. Names are 1-20 characters (Chinese, letters, digits, underscore), unique across elements and voices regardless of case, and cannot be image_N, video_N, keyframe_N, object_N, audio_N, first_frame or last_frame.
{
"model": "kling-4.0",
"prompt": "@Hero opens the door of @image_1 and greets @Robot; @Robot answers in the voice of @Narrator",
"image_urls": ["https://example.com/door.jpg"],
"elements": [
{
"name": "Hero",
"image_urls": ["https://example.com/hero-front.jpg", "https://example.com/hero-side.jpg"],
"tag": "character",
"description": "Young man in a red jacket",
"voice_url": "https://example.com/hero-voice.mp3"
},
{
"name": "Robot",
"image_urls": ["https://example.com/robot-front.png", "https://example.com/robot-back.png"],
"tag": "prop"
}
],
"voices": [
{ "name": "Narrator", "audio_url": "https://example.com/narrator.mp3" }
],
"duration": 10
}| Field | Required | Type | Description |
|---|---|---|---|
| model | Yes | string | kling-4.0 (kling-4-0 and kling-v4 also work) |
| prompt | Yes | string | Scene, action, camera and sound, with @mentions for inputs; up to 10,000 characters. |
| duration | No | integer | Whole seconds from 3 to 30, default 5. seconds is accepted as an alias. |
| resolution | No | string | 720p (default) or 1080p. |
| aspect_ratio | No | string | auto, 16:9, 9:16, 1:1, 21:9. Omitted: follows the references, or 16:9 for a prompt alone; keyframe clips follow the first frame. |
| image_urls | No | string[] | Reference images, up to 10, @image_1 onward. reference_image_urls and images are accepted as aliases. |
| video_urls | No | string[] | Reference videos, up to 5, 2-30 s each, ≤30 s together with video subjects; public mp4 / mov / mkv / avi / webm. reference_video_urls and video_list are accepted as aliases. |
| keep_original_sound | No | boolean | Keep the reference videos' own audio; default false. Only applies with video_urls. |
| elements | No | object[] | Named subjects, up to 7 (≤3 video subjects): {name, image_urls | video_url, tag?, description?, voice_url?}. |
| voices | No | object[] | Named voices, up to 3: {name, audio_url}. |
| first_frame_url | No | string | First frame for the keyframe route. image and image_url are accepted as aliases. |
| keyframe_urls | No | string[] | Middle frames, up to 8, in time order, @keyframe_1 onward. |
| last_frame_url | No | string | Last frame for the keyframe route. |
| callback_url | No | string | We POST the result to this URL on completion; omit it and poll the GET endpoint instead. |
Try it in the Playground. What is new, worked price examples and a comparison with Kling V3, Kling V3 Omni and Vidu Q4 are on the Kling 4.0 model page.
Without video input: $0.157/s at 720p and $0.235/s at 1080p for the seconds you request, so 5 s at 720p is $0.785 and 10 s at 1080p $2.35. With a reference video or video subject: $0.094/s (720p) or $0.141/s (1080p) per billed second, where billed seconds = output + max(input video, output); 10 s of output with a 5 s reference is 20 billed seconds, $1.88. Failed generations are not charged.
first_frame_url, keyframe_urls or last_frame_url select keyframe-to-video. Everything else (a prompt alone, image_urls, video_urls, elements, voices) is reference-to-video. Frames cannot be combined with references; that request returns a 400 at create time.
By position and by name: the first item in image_urls is @image_1, the first in video_urls @video_1, the first middle frame @keyframe_1, plus @first_frame and @last_frame; subjects and voices are called by their name, such as @Mia. Every mention must match an input in the same request, otherwise the request is rejected and nothing is charged.
First, middle and last frames together are capped at min(10, duration + 1): 4 frames at 3 seconds, 6 at 5 seconds, 10 from 9 seconds up, with at most 8 middle frames in keyframe_urls. The clip follows the first frame's aspect ratio.
generate_audio: false (audio is always on), negative prompts, multi-shot storyboards, video extension, resolutions above 1080p, more than 15 materials, reference videos outside 2-30 seconds or above 30 seconds in total, and frames mixed with references. Each returns a clear 400 instead of a degraded video.