Kling 4.0
One take up to 30 s at 1080p, first and last frames, 10 images and 5 clips — also edits clips. By Kling (Kuaishou).
kling/kling-4/reference-to-video
const res = await fetch("https://api.elyum.ai/v1/generations", { method: "POST", headers: { Authorization: `Bearer ${process.env.ELYUM_API_KEY}`, "Content-Type": "application/json", Prefer: "wait=55", }, body: JSON.stringify({ "model": "kling/kling-4/reference-to-video", "prompt": "A slow push-in on a lighthouse at dusk, waves breaking below", "inputs": [ { "role": "reference", "url": "https://example.com/reference.jpg" } ] }),});const generation = await res.json();console.log(generation.status, generation.outputs);Input
Advanced settings
Model options (multiShot, asmr, soundPrompt, musicPrompt, keepSound, orientation, motionId, imageRoles, subjects) go in options: switch to JSON to set them.
Result
$0.141 at 720p and $0.2103 at 1080p per second of video. With a reference clip, $0.0841 at 720p and $0.1262 at 1080p per second of the clip and the output together: the clip's seconds are charged too; a clip shorter than the output counts as the output's length. Charged when the file is delivered; a render that fails or is canceled costs nothing.
Kling 4.0 reference to video uses the model id kling/kling-4/reference-to-video. One take up to 30 s at 1080p, first and last frames, 10 images and 5 clips — also edits clips
1. Calling the API
Endpoint
Send a POST to https://api.elyum.ai/v1/generations with a JSON body matching the parameters below. Every model uses the same endpoint; the model field picks this one.
const res = await fetch("https://api.elyum.ai/v1/generations", { method: "POST", headers: { Authorization: `Bearer ${process.env.ELYUM_API_KEY}`, "Content-Type": "application/json", Prefer: "wait=55", }, body: JSON.stringify({ "model": "kling/kling-4/reference-to-video", "prompt": "A slow push-in on a lighthouse at dusk, waves breaking below", "inputs": [ { "role": "reference", "url": "https://example.com/reference.jpg" } ] }),});const generation = await res.json();console.log(generation.status, generation.outputs);Request parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | — | kling/kling-4/reference-to-video, or kling/kling-4 to let your inputs pick the task. |
prompt | string | Yes | — | Sent to the model as written, never shortened. |
inputs | array | Yes | — | Files the task takes, each with a role and a url or file. See Inputs. |
duration | number | No | 5 | 3 to 30, whole numbers |
resolution | string | No | "1080p" | 720p, 1080p |
aspect_ratio | string | No | — | auto, 21:9, 16:9, 9:16, 1:1 |
audio | boolean | No | false | true or false |
options | object | No | — | This model's own settings: multiShot, asmr, soundPrompt, musicPrompt, keepSound, orientation, motionId, imageRoles, subjects. |
max_usd | number | No | — | Refuse the render, with nothing held, if it would cost more than this many dollars. |
metadata | object | No | — | Up to 16 string pairs, echoed back on the generation. |
A value outside these lists is refused with a 400 naming the field, before anything is charged. Nothing is quietly rounded or dropped.
Inputs
| Role | Types | Required | Limits |
|---|---|---|---|
reference | image, video | Yes |
|
A reference image wider or taller than 0.4 to 2.5 (width ÷ height) is padded to fit, never cropped. An image under 300 or over 6,000 px a side is scaled to fit.
Cite an input in the prompt by type and order (@image1, @video1, @audio1), or give it a name and cite @name. An input outside these limits is refused with a 400 naming it, before anything is charged.
2. Authentication
API key
Create a key on Keys with the generate and spend scopes and send it as a bearer token. Keep it on your server; never send it to a browser.
Authorization: Bearer $ELYUM_API_KEY3. Queue
Submit and wait
With Prefer: wait=55 the request holds until the render ends or 55 seconds pass. A finished render answers 200 with its outputs; one still running answers 202 with its id. This task usually takes about 10 min.
Poll and cancel
const headers = { Authorization: `Bearer ${process.env.ELYUM_API_KEY}` }; // Poll until the render ends: succeeded, failed or canceledlet generation = await (await fetch(`https://api.elyum.ai/v1/generations/${id}`, { headers })).json();while (generation.status === "queued" || generation.status === "running") { await new Promise((r) => setTimeout(r, 5000)); generation = await (await fetch(`https://api.elyum.ai/v1/generations/${id}`, { headers })).json();} // Or stop it (a hold is refunded)await fetch(`https://api.elyum.ai/v1/generations/${id}/cancel`, { method: "POST", headers });Output links are signed and last 24 hours: download them to your own storage, or fetch the generation again for fresh ones.
4. Pricing
| Resolution | Price | With a reference clip |
|---|---|---|
| 720p | $0.0841 / s of clip + output | |
| 1080p | $0.1262 / s of clip + output |
A struck price is the list price before today's. A reference clip's seconds are charged too, an edit's source clip included: every second of the clip and the output together at the rate in that column; a clip shorter than the output counts as the output's length. Send ?dry_run=true for the exact price of a request with nothing held. The API spends your API balance; a render that fails or is canceled costs nothing.
Compare with others
What every provider charges for Kling 4.0, from their own pricing pages. The line under our price is how much less you pay.
| Resolution | Elyum | Higgsfield | fal.ai | Kie.ai | Sume | Sunra |
|---|---|---|---|---|---|---|
| 720p | $0.141 / s−10 % vs Higgsfield · −1.1 % vs Kie.ai | $0.157 / s | $0.157 / s | $0.1425 / s | $0.157 / s | — |
| 1080p | $0.2103 / s−11 % vs Higgsfield · −1 % vs Kie.ai | $0.235 / s | $0.235 / s | $0.2125 / s | $0.235 / s | — |
| 720p, with a reference clip | $0.0841 / s−11 % vs Higgsfield · −1.1 % vs Kie.ai | $0.094 / s | $0.094 / s | $0.085 / s | — | — |
| 1080p, with a reference clip | $0.1262 / s−10 % vs Higgsfield · −1 % vs Kie.ai | $0.141 / s | $0.141 / s | $0.1275 / s | — | — |
The most expensive provider is in red; * is a limited-time promotion, counted while it runs. A dash means the provider does not sell it. A row with a reference clip is priced per second of the clip and the output together, against the providers that bill a clip's seconds that way; the clip's seconds are always charged. Prices read from each provider's pricing page on 2026-10-27; every model and source.
More models by Kling (Kuaishou)
Kling 4.0 task by task, then the lowest price of each other model. What a render costs depends on the resolution and length you choose.
| Model | Price | Resolution | Length |
|---|---|---|---|
| Kling 4.0 Text to video | $0.141 – $0.2103 / s | 720p – 1080p | 3 – 30 s |
| Kling 4.0 Image to video | $0.141 – $0.2103 / s | 720p – 1080p | 3 – 30 s |
| Kling 4.0 Reference to video | $0.141 – $0.2103 / sWith a reference clip: $0.0841 – $0.1262 / s of clip + output | 720p – 1080p | 3 – 30 s |
| Kling 4.0 Video edit | $0.0841 – $0.1262 / s of clip + output | 1080p – 720p | — |
| Kling 2.5 TurboText to video · Image to video | $0.23 / s | 720p – 1080p | 5 – 10 s |
| Kling 2.6Text to video · Image to video · Motion control | $0.16 / s | 720p – 1080p | 5 – 10 s |
| Kling O1Text to video · Image to video · Reference to video · Video edit | $0.23 / s | 720p – 1080p | 3 – 10 s |
| Kling 3.0 TurboText to video · Image to video | $0.23 / s | 720p – 1080p | 3 – 15 s |
| Kling 3.0Text to video · Image to video · Motion control | from $0.099 / s | 720p – 4K | 3 – 15 s |
| Kling 3.0 OmniText to video · Image to video · Reference to video · Video edit | $0.23 / s | 720p – 4K | 3 – 15 s |
| Kling 3.0 Motion Control ProMotion control | $0.36 / s | — | — |
| Kling Image 2.1Text to image · Image edit | $0.04 / image | 1K – 2K | — |
| Kling Image O1Text to image · Image edit | $0.04 / image | 1K – 2K | — |
| Kling Image O3Text to image · Image edit | $0.04 / image | 1K – 4K | — |
| Kling Image 3Text to image · Image edit | $0.04 / image | 1K – 2K | — |