All models
Kling
Video
Available
Kling 4.0 Reference to Video
Generate videos with Kling 4.0 from reference images, reference videos, elements, and voices. Reference your materials in the prompt using `@image_1`, `@video_1`, or custom `@name` tags.
Image to Video
From 400 credits (≈ ₹400.00) per request.
Parameters
| Parameter | Type | Description |
|---|---|---|
promptRequired |
string | Video description. Required. Maximum 8000 characters. Use `@` to mention assets uploaded in this request: - `@image_1`, `@image_2`, … map to `image_urls` in order (1-based) - `@video_1`, `@video_2`, … map to `video_urls` - `@name` maps to the `name` of an item in `elements` or `voices` 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, t max length 8000 |
duration |
integer | Output video duration in seconds. Integer from 3 to 30. Default: `5`. 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. Optional. - If omitted and any reference asset is provided, the model uses `auto` - If omitted and no reference asset is provided, the model uses `16:9` one of: "auto", "16:9", "9:16", "1:1", "21:9", "4:3", "3:4" |
image_urls |
array<string> | Reference images, up to 10 publicly accessible URLs. Mention them in the prompt as `@image_1`, `@image_2`, … in array order. Each side must be 300–65536 pixels; aspect ratio 0.40–2.5. default [] |
video_urls |
array<string> | Reference videos, up to 5 clips, each 2–30 seconds. Mention them in the prompt as `@video_1`, `@video_2`, …. Reference videos plus video subjects in `elements` cannot exceed 5 in total. default [] |
keep_original_sound |
boolean | Whether to keep the original audio of the reference videos. Only takes effect when `video_urls` is provided. Default: `false`. If no reference video is provided, native audio is always generated. default false |
elements |
array<object> | Subjects used only for this task. Up to 7 items, of which at most 3 can be video subjects. Mention them in the prompt as `@name`. `image_urls`, `video_urls`, `elements`, and `voices` together cannot exceed 15 items. default [] |
voices |
array<object> | Standalone voice references used only for this task. Up to 3 items. Mention them in the prompt as `@name`. Audio bound on a subject via `voice_url` is separate and does not count toward this quota. default [] |
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-reference-to-video",
"input": {
"prompt": "A cinematic shot of a lighthouse at dawn",
"duration": 5,
"resolution": "720p",
"dynamic_range": "sdr",
"aspect_ratio": "auto",
"image_urls": [],
"video_urls": [],
"keep_original_sound": false,
"elements": [],
"voices": []
},
"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-reference-to-video",
"input": {
"prompt": "A cinematic shot of a lighthouse at dawn",
"duration": 5,
"resolution": "720p",
"dynamic_range": "sdr",
"aspect_ratio": "auto",
"image_urls": [],
"video_urls": [],
"keep_original_sound": False,
"elements": [],
"voices": [],
},
"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-reference-to-video",
"input": {
"prompt": "A cinematic shot of a lighthouse at dawn",
"duration": 5,
"resolution": "720p",
"dynamic_range": "sdr",
"aspect_ratio": "auto",
"image_urls": [],
"video_urls": [],
"keep_original_sound": false,
"elements": [],
"voices": []
},
"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-reference-to-video",
"input": {
"prompt": "A cinematic shot of a lighthouse at dawn",
"duration": 5,
"resolution": "720p",
"dynamic_range": "sdr",
"aspect_ratio": "auto",
"image_urls": [],
"video_urls": [],
"keep_original_sound": false,
"elements": [],
"voices": []
}
}
Response
{
"id": "6f1c…",
"object": "task",
"model": "kling-4.0-reference-to-video",
"status": "succeeded",
"output": {
"files": [
{
"url": "https://…signed…",
"mime": "…",
"size": 0
}
]
},
"estimated_cost": "…",
"charged": "…"
}