All models
Kling
Video
Available
Kling 4.0 Keyframe to Video
Generate a video from first, middle, and last keyframe images with Kling 4.0. Mention frames in the prompt using `@first_frame`, `@keyframe_1`, and `@last_frame`.
Image to Video
Text to Video
From 400 credits (≈ ₹400.00) per request.
Parameters
| Parameter | Type | Description |
|---|---|---|
promptRequired |
string | Video description. Required. Maximum 8000 characters. Use `@first_frame`, `@keyframe_1`, `@keyframe_2`, …, `@last_frame` to mention frames that you uploaded in this request. You can only mention frames that are actually provided. Every `@` mention must match an asset included in this request, otherwise the request is rejected. Mentions use longest-match against declared names. If the matched name ends with a letter, digit, or underscore, the next character cannot be a letter, digit, or underscor max length 8000 |
duration |
integer | Output video duration in seconds. Integer from 3 to 30. Default: `5`. Also caps the total number of frames (first + middle + last): - 3 s → 4 frames - 4 s → 5 frames - 5 s → 6 frames - 6 s → 7 frames - 7 s → 8 frames - 8 s → 9 frames - 9 s or longer → 10 frames min 3 · max 30 · default 5 |
resolution |
string | Output resolution. Default: `720p`. - `720p`: 1280×720 (16:9) - `1080p`: 1920×1080 (16:9) - `4k`: 3840×2160 (16:9) Sizes for other aspect ratios scale accordingly. `4k` takes noticeably longer to generate (about 160 seconds for a 5-second video). one of: "720p", "1080p", "4k" · default "720p" |
dynamic_range |
string | Dynamic range of the output video. Optional. Default: `sdr`. - `sdr`: standard dynamic range, H.264 8-bit MP4 - `hdr`: high dynamic range, HEVC (H.265) 10-bit, BT.2020, HLG `hdr` only works with `resolution` set to `1080p` or `4k`; `720p` with `hdr` is rejected with a parameter error. HLG/HEVC playback is not supported by every browser, player, or transcoding pipeline and may look washed out or fail to play, so check your playback chain before using `hdr`. If a `4k` or `hdr` result cannot be pro one of: "sdr", "hdr" · default "sdr" |
aspect_ratio |
string | Output aspect ratio. Only used when no frame is provided (text-to-video); default is `16:9`. If any frame is provided, the output follows the first frame's aspect ratio. one of: "auto", "16:9", "9:16", "1:1", "21:9", "4:3", "3:4" |
first_frame_url |
string | First-frame image URL. Mention it in the prompt as `@first_frame`. format: uri |
keyframe_urls |
array<string> | Middle-frame image URLs, in chronological order. Up to 8 images, also limited by `duration`. Mention them in the prompt as `@keyframe_1`, `@keyframe_2`, …. default [] |
last_frame_url |
string | Last-frame image URL. Mention it in the prompt as `@last_frame`. format: uri |
What you get back
Files arrive in output.files[] as private links that expire, with their type and size.
Use it from your code
# 1. Create the task
curl https://nexus.promptscenes.in/api/v1/tasks \
-H "Authorization: Bearer $NEXUS_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "kling-4.0-keyframe-to-video",
"input": {
"prompt": "A cinematic shot of a lighthouse at dawn",
"duration": 5,
"resolution": "720p",
"dynamic_range": "sdr",
"aspect_ratio": "auto",
"keyframe_urls": []
},
"callback_url": "https://your-app.com/webhooks/nexus"
}'
# 2. Poll for the result
curl https://nexus.promptscenes.in/api/v1/tasks/TASK_ID \
-H "Authorization: Bearer $NEXUS_API_KEY"
import os, time, uuid, requests
API = "https://nexus.promptscenes.in/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['NEXUS_API_KEY']}"}
task = requests.post(
f"{API}/tasks",
headers={**HEADERS, "Idempotency-Key": str(uuid.uuid4())},
json={
"model": "kling-4.0-keyframe-to-video",
"input": {
"prompt": "A cinematic shot of a lighthouse at dawn",
"duration": 5,
"resolution": "720p",
"dynamic_range": "sdr",
"aspect_ratio": "auto",
"keyframe_urls": [],
},
"callback_url": "https://your-app.com/webhooks/nexus",
},
).json()
while task["status"] not in ("succeeded", "failed", "cancelled"):
time.sleep(3)
task = requests.get(f"{API}/tasks/{task['id']}", headers=HEADERS).json()
print(task["status"], task.get("output"))
const API = "https://nexus.promptscenes.in/api/v1";
const headers = {
Authorization: `Bearer ${process.env.NEXUS_API_KEY}`,
"Content-Type": "application/json",
};
let task = await fetch(`${API}/tasks`, {
method: "POST",
headers: { ...headers, "Idempotency-Key": crypto.randomUUID() },
body: JSON.stringify({
"model": "kling-4.0-keyframe-to-video",
"input": {
"prompt": "A cinematic shot of a lighthouse at dawn",
"duration": 5,
"resolution": "720p",
"dynamic_range": "sdr",
"aspect_ratio": "auto",
"keyframe_urls": []
},
"callback_url": "https://your-app.com/webhooks/nexus"
}),
}).then((r) => r.json());
while (!["succeeded", "failed", "cancelled"].includes(task.status)) {
await new Promise((r) => setTimeout(r, 3000));
task = await fetch(`${API}/tasks/${task.id}`, { headers }).then((r) => r.json());
}
console.log(task.status, task.output);
Request
{
"model": "kling-4.0-keyframe-to-video",
"input": {
"prompt": "A cinematic shot of a lighthouse at dawn",
"duration": 5,
"resolution": "720p",
"dynamic_range": "sdr",
"aspect_ratio": "auto",
"keyframe_urls": []
}
}
Response
{
"id": "6f1c…",
"object": "task",
"model": "kling-4.0-keyframe-to-video",
"status": "succeeded",
"output": {
"files": [
{
"url": "https://…signed…",
"mime": "…",
"size": 0
}
]
},
"estimated_cost": "…",
"charged": "…"
}