Kling 4.0 Text to Video API

klingai/video-v4-text-to-video
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.
Output
$0.157 / sec (variable)
Released
Oct 15, 2026

Overview

What is Kling 4.0 Text to Video API?

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.

Technical specifications

  • Supported inputs: text prompt or multi-shot prompts
  • Output: video, 3–30 seconds
  • Resolution: 720p or 1080p
  • Model ID: klingai/video-v4-text-to-video
  • Release date: October 15, 2026

Kling 4.0 Text to Video API pricing

  • 720p: $0.157 / sec
  • 1080p: $0.235 / sec

Where to use Kling 4.0 Text to Video

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.

Use cases

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.

How to use Kling 4.0 Text to Video API

Install any OpenAI-compatible SDK, point it at api.aimlapi.com/v1, and set the model to klingai/video-v4-text-to-video.
import requests, time

headers = {"Authorization": "Bearer " + AIMLAPI_KEY}
job = requests.post(
    "https://api.aimlapi.com/v2/video/generations",
    headers=headers,
    json={
      "model": "klingai/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": "klingai/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": "klingai/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.

Kling 4.0 Text to Video API Pricing

TypePrice
Output
$0.157 / sec (variable)

Billed per second of video: 720p — $0.157 / sec, 1080p — $0.235 / sec. Clips from 3 to 30 seconds.

Kling 4.0 Text to Video vs other models

ModelInputOutputContextBest for
$0.157 / sec (variable)
Video generation
$0.2 / sec (variable)
Video generation
$1.95 / 1M tokens
$0.10136 / sec
Video generation
$0.0711 / sec
Cinematic video + native audio

Frequently asked questions

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.

Start building with Kling 4.0 Text to Video

Get API Key
1000+ models, one API.