Kling 4.0 text-to-video generates 3–30 second videos at 720p or 1080p from a prompt or a multi-shot storyboard, with stable motion and complex camera moves. It is part of Kling AI's new-generation Kling 4.0 video model family and is available on AI/ML API through the video generation endpoint.
Short-form and social video
Generate clips for social, ads and product demos directly from a prompt.
Multi-shot storytelling
Describe several shots with their own durations and get one continuous video of up to 30 seconds.
Previsualization and storyboards
Prototype camera moves and scene composition before committing to production.
Kling 4.0 Text to Video generates 3–30 second clips from a single prompt, suited to social posts, ads and product demos.
Multi-shot prompts let you script several shots with individual durations and get one continuous video, which fits storyboard-style storytelling.
Stable motion and complex camera moves make it a fit for cinematic scenes and previsualization.
720p output keeps iteration costs low, while 1080p is available for final renders.
import requests, time headers = {"Authorization": "Bearer " + AIMLAPI_KEY} job = requests.post( "https://api.aimlapi.com/v2/video/generations", headers=headers, json={ "model": "kling-video/v4/text-to-video", "prompt": "A serene timelapse of clouds over a mountain range", "duration": 5, "resolution": "1080p" }, ).json() gid = job["id"] while True: res = requests.get(f"https://api.aimlapi.com/v2/video/generations?generation_id={gid}", headers=headers).json() if res.get("status") in ("completed", "error"): break time.sleep(15) print(res["video"]["url"])
const headers = { Authorization: `Bearer ${process.env.AIMLAPI_KEY}`, "Content-Type": "application/json", }; const job = await (await fetch("https://api.aimlapi.com/v2/video/generations", { method: "POST", headers, body: JSON.stringify({ "model": "kling-video/v4/text-to-video", "prompt": "A serene timelapse of clouds over a mountain range", "duration": 5, "resolution": "1080p" }), })).json(); let res; do { await new Promise((r) => setTimeout(r, 15000)); res = await (await fetch(`https://api.aimlapi.com/v2/video/generations?generation_id=${job.id}`, { headers })).json(); } while (!["completed", "error"].includes(res.status)); console.log(res.video.url);
# submit the generation — the response contains the job "id" curl -X POST https://api.aimlapi.com/v2/video/generations \ -H "Authorization: Bearer $AIMLAPI_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "kling-video/v4/text-to-video", "prompt": "A serene timelapse of clouds over a mountain range", "duration": 5, "resolution": "1080p"}' # then poll until status is "completed" — video.url holds the result curl "https://api.aimlapi.com/v2/video/generations?generation_id={id}" -H "Authorization: Bearer $AIMLAPI_KEY"
OpenAI-compatible — swap the base URL and it works with your existing SDK.
| Type | Price |
|---|---|
| Output | |
Billed per second of video: 720p — $0.157 / sec, 1080p — $0.235 / sec. Clips from 3 to 30 seconds.
| Model | Input | Output | Context | Best for |
|---|---|---|---|---|
Kling 4.0 Text to Video This page | Video generation |
Kling 4.0 Text to Video is Kling AI's new-generation text-to-video model. It generates 3–30 second videos at 720p or 1080p from a single prompt or a multi-shot storyboard, with stable motion and complex camera moves.
Kling 4.0 Text to Video takes a text prompt (or a list of per-shot prompts) as input and returns a video.
Clips can be 3 to 30 seconds long. With multi-shot prompts, the video length is the sum of the shot durations. Output resolution is 720p or 1080p.
Kling 4.0 Text to Video is billed per second of generated video: $0.157 per second at 720p and $0.235 per second at 1080p.
Kling 4.0 is also available on AI/ML API as Image to Video, Reference to Video and Video Editing, all through the same video generation endpoint.
Submit a POST request to https://api.aimlapi.com/v2/video/generations with the model ID klingai/video-v4-text-to-video and a prompt, then poll the same endpoint with the returned generation_id until the status is completed.