Nexus
All models
Kling Video Available

Kling 4.0 Flash Keyframe to Video

Generate a video from a first-frame image with Kling 4.0 Flash, or run as plain text-to-video when no frame is provided. Mention the first frame in the prompt as `@first_frame`. Middle frames (`keyframes`) and a last frame are not supported. Try it online and see pricing on the Kling 4.0 Flash API page.

Image to Video Text to Video

From 400 credits (≈ ₹400.00) per request.

Parameters

ParameterTypeDescription
promptRequired string Video description. Required. Maximum 8000 characters. When `first_frame_url` is provided, mention it as `@first_frame`. Middle frames and a last frame are not supported on Kling 4.0 Flash — sending `keyframes` or `last_frame` is rejected.
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. `16:9`, `9:16`, `1:1`, `21:9`, `4:3`, or `3:4`. There is no `auto`. Only used when `first_frame_url` is omitted (text-to-video); default `16:9`. When a first frame is provided, the output follows that image's aspect ratio.
one of: "16:9", "9:16", "1:1", "21:9", "4:3", "3:4"
first_frame_url string Optional first-frame image URL. Mention it in the prompt as `@first_frame`. If omitted, the request is plain text-to-video. Middle frames (`keyframes`) and a last frame (`last_frame`) are not supported.
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-flash-keyframe-to-video",
    "input": {
        "prompt": "A cinematic shot of a lighthouse at dawn",
        "duration": 5,
        "resolution": "720p",
        "aspect_ratio": "16:9"
    },
    "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-keyframe-to-video",
        "input": {
            "prompt": "A cinematic shot of a lighthouse at dawn",
            "duration": 5,
            "resolution": "720p",
            "aspect_ratio": "16:9",
        },
        "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-keyframe-to-video",
      "input": {
          "prompt": "A cinematic shot of a lighthouse at dawn",
          "duration": 5,
          "resolution": "720p",
          "aspect_ratio": "16:9"
      },
      "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-keyframe-to-video",
    "input": {
        "prompt": "A cinematic shot of a lighthouse at dawn",
        "duration": 5,
        "resolution": "720p",
        "aspect_ratio": "16:9"
    }
}

Response

{
    "id": "6f1c…",
    "object": "task",
    "model": "kling-4.0-flash-keyframe-to-video",
    "status": "succeeded",
    "output": {
        "files": [
            {
                "url": "https://…signed…",
                "mime": "…",
                "size": 0
            }
        ]
    },
    "estimated_cost": "…",
    "charged": "…"
}