All models
Kling
Video
Available
Kling 4.0 Flash Reference to Video
Generate videos with Kling 4.0 Flash from reference images, reference videos, and elements. Mention your materials in the prompt using `@image_1`, `@video_1`, or custom `@name` tags. Standalone `voices` is not supported; bind character audio on the element's `voice_url`. Try it online and see pricing on the Kling 4.0 Flash API page.
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` 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 char max length 8000 |
duration |
integer | Output video duration in seconds. Integer from 3 to 20. Default: `5`. min 3 · max 20 · default 5 |
resolution |
string | Output resolution. Kling 4.0 Flash only supports `720p`. Default: `720p`. one of: "720p" · default "720p" |
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. default [] |
video_urls |
array<string> | Reference videos, up to 5 publicly accessible URLs. Mention them in the prompt as `@video_1`, `@video_2`, …. Reference videos plus video subjects in `elements` cannot exceed 5 in total. Combined duration of all reference videos and video elements must be 2–20 seconds; if it is outside that range the completion callback returns a failure. 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`, and `elements` together cannot exceed 15 items. Standalone `voices` is not supported on Flash. 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-flash-reference-to-video",
"input": {
"prompt": "A cinematic shot of a lighthouse at dawn",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "auto",
"image_urls": [],
"video_urls": [],
"keep_original_sound": false,
"elements": []
},
"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-flash-reference-to-video",
"input": {
"prompt": "A cinematic shot of a lighthouse at dawn",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "auto",
"image_urls": [],
"video_urls": [],
"keep_original_sound": False,
"elements": [],
},
"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-flash-reference-to-video",
"input": {
"prompt": "A cinematic shot of a lighthouse at dawn",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "auto",
"image_urls": [],
"video_urls": [],
"keep_original_sound": false,
"elements": []
},
"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-flash-reference-to-video",
"input": {
"prompt": "A cinematic shot of a lighthouse at dawn",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "auto",
"image_urls": [],
"video_urls": [],
"keep_original_sound": false,
"elements": []
}
}
Response
{
"id": "6f1c…",
"object": "task",
"model": "kling-4.0-flash-reference-to-video",
"status": "succeeded",
"output": {
"files": [
{
"url": "https://…signed…",
"mime": "…",
"size": 0
}
]
},
"estimated_cost": "…",
"charged": "…"
}