Wide LabsCompute

Kling v4

New
KlingTeam/v4 KlingText → videoRESTAsync task
Price$0.16 /seclowest tier
EndpointPOST /v2/video/kling-4/generateREST
Example output

Made with Kling v4

“A vintage red tram moves slowly along İstiklal Avenue in Istanbul on a rainy evening, reflections on wet cobblestones, people walking with umbrellas, cinematic 35 mm look”

resolution: 720pduration: 5aspect_ratio: 16:9

One request to this model through the API, at list price; compressed for the web.

Try this prompt

Quick start

This model runs asynchronously: the request returns a task ID, and you poll GET /v2/tasks/{task_id} or receive a webhook when the result is ready.
curl -X POST https://api.widelabs.tr/v2/video/kling-4/generate \
  -H "Authorization: Bearer $WIDELABS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "A street-food cook in a rainy Tokyo alley at night flips sizzling yakitori over glowing charcoal; neon signs reflect in the puddles and steam curls into the light. She glances up at the camera, smiles and says in English: \"Two more minutes!\" Slow push-in, shallow depth of field. Sound: sizzling grill, steady rain, distant traffic.",
  "resolution": "1080p",
  "duration": 5,
  "aspect_ratio": "16:9"
}'
import os
import requests

resp = requests.post(
    "https://api.widelabs.tr/v2/video/kling-4/generate",
    headers={"Authorization": "Bearer " + os.environ["WIDELABS_API_KEY"]},
    json={
        "prompt": "A street-food cook in a rainy Tokyo alley at night flips sizzling yakitori over glowing charcoal; neon signs reflect in the puddles and steam curls into the light. She glances up at the camera, smiles and says in English: \"Two more minutes!\" Slow push-in, shallow depth of field. Sound: sizzling grill, steady rain, distant traffic.",
        "resolution": "1080p",
        "duration": 5,
        "aspect_ratio": "16:9"
    },
)
resp.raise_for_status()
# Video jobs are asynchronous: poll the task until it finishes.
import time
task = resp.json()
while task.get("status") not in ("completed", "failed"):
    time.sleep(5)
    task = requests.get("https://api.widelabs.tr/v2/tasks/" + task["task_id"], params={"wait": 30}).json()
print(task.get("result"))
const resp = await fetch("https://api.widelabs.tr/v2/video/kling-4/generate", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.WIDELABS_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    prompt: "A street-food cook in a rainy Tokyo alley at night flips sizzling yakitori over glowing charcoal; neon signs reflect in the puddles and steam curls into the light. She glances up at the camera, smiles and says in English: \"Two more minutes!\" Slow push-in, shallow depth of field. Sound: sizzling grill, steady rain, distant traffic.",
    resolution: "1080p",
    duration: 5,
    aspect_ratio: "16:9"
  }),
});
let task = await resp.json();
// Video jobs are asynchronous: poll the task until it finishes.
while (!["completed", "failed"].includes(task.status)) {
  await new Promise(r => setTimeout(r, 5000));
  task = await (await fetch(`https://api.widelabs.tr/v2/tasks/${task.task_id}?wait=30`)).json();
}
console.log(task.result);

Parameters

NameTypeDescription
store_output"provider" | "wl1d" | "wl7d" | "wl30d"
default "provider"
Where this request's output media is hosted, and for how long. `provider` (default) returns a Wide Labs CDN link that live-proxies the provider for 1 hour — the same hour the task record itself lives. `wl1d` / `wl7d` / `wl30d` copy the output into Wide Labs own storage and keep BOTH the link and the task record for 1, 7 or 30 days,…
prompt requiredstringText description of the video (required; English up to 26,000 characters, other languages up to 11,000). Refer to inputs as @first_frame, @frame_1... (middle frames), @last_frame, @image_1... (reference_image_urls).
resolution"720p" | "1080p"
default "720p"
Output resolution: 720p or 1080p. Priced per output second by resolution.
durationinteger
default 5
Video duration in seconds (3-15). Billed per output second.
aspect_ratio"16:9" | "9:16" | "1:1" | "21:9" | "adaptive"Aspect ratio. Text only: default 16:9 (adaptive not allowed). Frames only: the video follows the first frame (leave empty or adaptive). With reference images or videos: default adaptive.
first_frame_urlstringFirst frame image: URL or base64 data URI (JPG/PNG, max 30MB, sides >=300 px, ratio 2:5 to 5:2).
middle_frame_urlsstring[]Middle keyframe images in playback order (URLs or base64 data URIs).
last_frame_urlstringLast frame image: URL or base64 data URI.
reference_image_urlsstring[]Reference images (characters, objects, scenes, style), referred to as @image_1...; URLs or base64 data URIs (each side >=300 px). Images in total (frames included): max 10.
webhook_urlstringHTTPS URL to receive a signed completion webhook when the async task reaches a terminal state (requires an API key, "async": true and direct mode; otherwise 422). See the Webhooks section for the delivery payload and events, and GET /v2/customer/webhook-secret for the signing secret + verification.

Start building on Wide Labs Compute

Create an account, add credit and send your first request with the SDK you already use.