Kling 4.0 is LIVE — Unbelievably Real Video | Try Now →
Kuaishouvideo APIFrom $0.785/run

Kling 4.0 API

Kuaishou Kling 4.0 — text-to-video, image-to-video and reference-to-video with 3-30 second clips, 720p and 1080p output, and synchronized stereo audio generated with the picture.

Three endpoints: kwaivgi/kling-v4.0/text-to-video turns a prompt into a clip, image-to-video animates a first frame with an optional last frame and keyframes, and reference-to-video builds a new clip from up to 10 images, 5 videos and 3 audios. Every endpoint takes any length from 3 to 30 seconds at 720p or 1080p.

Overview

About the Kling 4.0 API

What Kling 4.0 does, how it fits in the Kuaishou model lineup, and why teams reach for it.

Kling 4.0 is a video generation model from Kuaishou, available through the WaveSpeedAI REST API. Kuaishou Kling 4.0 — text-to-video, image-to-video and reference-to-video with 3-30 second clips, 720p and 1080p output, and synchronized stereo audio generated with the picture.

Three endpoints: kwaivgi/kling-v4.0/text-to-video turns a prompt into a clip, image-to-video animates a first frame with an optional last frame and keyframes, and reference-to-video builds a new clip from up to 10 images, 5 videos and 3 audios. Every endpoint takes any length from 3 to 30 seconds at 720p or 1080p.

The Kling 4.0 family on WaveSpeedAI ships 3 REST endpoints covering Text-To-Video, Image-To-Video, Reference-To-Video workflows. Each variant carries its own pricing, parameter knobs, and example outputs — pick the one that matches your input modality and production constraints, or call several from the same API key to compose multi-step pipelines.

Run Kling 4.0 through the same API key, billing account, and rate-limit envelope you use for the other 1,000+ AI models on WaveSpeedAI. No separate vendor setup, no per-provider SDKs, no per-vendor rate-limit envelopes — one integration covers everything from text-to-image and text-to-video through audio synthesis, 3D generation, upscaling, and editing.

Specs

Kling 4.0 API capabilities and release status

The model-specific details developers search for before choosing an API: availability, expected output length, reference support, and the current live fallback.

Endpoints

3 variants

Text-to-video, image-to-video and reference-to-video.

Duration

3-30 s

Any length from 3 to 30 seconds; 5 s is the default.

Resolution

720p / 1080p

720p is the default.

References

10 images + 5 videos + 3 audios

On reference-to-video, alongside a text prompt.

Endpoints

All Kling 4.0 API endpoints

3 Kling 4.0 endpoints available now on WaveSpeedAI — pick the variant that matches your workflow.

Examples

See Kling 4.0 in action

Real outputs generated by the Kling 4.0 API. Hover any video to preview, click to open the full-size viewer.

How to

How to use the Kling 4.0 API

Four steps from signup to a finished generation. Full Python, Node.js, and cURL examples are in the API section below.

  1. 01

    Get an API key

    Sign up for a WaveSpeedAI account and copy your API key from the dashboard. New accounts come with free starter credits — enough to run the playground a few dozen times before billing kicks in.

  2. 02

    Submit a prediction

    POST your input as JSON to https://api.wavespeed.ai/api/v3/kwaivgi/kling-v4.0/text-to-video. The endpoint returns a prediction id immediately — generations are async so you don't hold an open connection during inference.

  3. 03

    Poll for completion

    GET https://api.wavespeed.ai/api/v3/predictions/{request_id}/result. Return outputs on completed; stop with an error on failed, cancelled, timeout, or deleted; continue polling for every other status.

  4. 04

    Read the output URL

    Once status is "completed", read the URL from data.outputs[0]. The URL points to your generated media on the WaveSpeedAI CDN — image, video, audio, or 3D file depending on the Kling 4.0 variant you called.

Use cases

What you can build with Kling 4.0

Common workflows developers and creators use the Kling 4.0 API for.

01

Long single takes

kwaivgi/kling-v4.0/text-to-video generates any length from 3 to 30 seconds in one pass, leaving room for real action and camera movement instead of stitching short clips together.

text-to-video30-secondslong-form
02

Ultrawide cinematic framing

Text-to-video renders 16:9, 9:16, 1:1 or 21:9, so one prompt can serve a widescreen trailer, a vertical social post or an ultrawide cinematic shot.

aspect-ratio21:9cinematic
03

Direct the story with keyframes

kwaivgi/kling-v4.0/image-to-video uses your image as the first frame and accepts an optional last frame plus in-between keyframes, up to 10 images in total, so you decide where the clip starts, passes through and ends.

image-to-videokeyframesstorytelling
04

Scenes built from mixed references

kwaivgi/kling-v4.0/reference-to-video combines up to 10 reference images, 5 reference videos and 3 reference audios, which the prompt refers to as @Image1, @Video1 and @Audio1.

reference-to-videomulti-referenceconsistency
05

Borrow a camera move or a performance

Point to a reference video in the prompt to reuse its camera movement or follow its performance, while the output length is chosen independently of the reference.

cameraperformancereference-video
06

Sound generated with the picture

Every endpoint produces synchronized stereo audio together with the video. On reference-to-video you can instead keep the reference video's own sound.

audiostereosound

Tips

Tips for prompting Kling 4.0

Practical advice for getting better outputs from Kling 4.0 — drawn from the patterns that work across video models in production pipelines.

  1. 01

    Name the subject, action, setting and camera

    Give the model a subject, what it does, where it happens and how the camera moves, for example a slow dolly-in or a handheld tracking shot. For longer clips, describe how the scene develops from beginning to end.

  2. 02

    Describe the sound you want

    Audio is generated together with the picture, so name the ambience, music or line of dialogue you want to hear in the prompt.

  3. 03

    Say what each reference is for

    On kwaivgi/kling-v4.0/reference-to-video, refer to inputs as @Image1, @Video1 and @Audio1 in the order you provide them, and say how each one should appear, for example the character from @Image1 walking through the street from @Image2.

  4. 04

    Keyframes are used in order

    On kwaivgi/kling-v4.0/image-to-video, in-between keyframes are used in the order you list them, and the first frame, keyframes and last frame add up to at most 10 images. Describe the change that connects the frames.

  5. 05

    Draft at 720p, deliver at 1080p

    Explore ideas at 720p and a short duration, then re-run the chosen prompt at 1080p for delivery.

Pricing

Kling 4.0 API pricing

Pricing is per-output. The final charge scales with the parameters you set in each variant's playground (resolution, duration, output count, references).

Starting price

$0.785/ run

3 endpoints · Kling 4.0

Open Playground
EndpointTypeStarting price
kwaivgi/kling-v4.0/text-to-videotext-to-video$0.785
kwaivgi/kling-v4.0/image-to-videoimage-to-video$0.785
kwaivgi/kling-v4.0/reference-to-videoreference-to-video$0.785

API

Call the Kling 4.0 API

Sign up for an API key at wavespeed.ai/accesskey, then submit a prediction via REST. The playground generates ready-to-paste samples for any combination of inputs.

POSThttps://api.wavespeed.ai/api/v3/kwaivgi/kling-v4.0/text-to-video

# 1. Submit the prediction.
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
  -X POST "https://api.wavespeed.ai/api/v3/kwaivgi/kling-v4.0/text-to-video" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $WAVESPEED_API_KEY" \
  -d '{
    "prompt": "A cinematic shot of a city at sunset, soft golden light",
    "resolution": "720p",
    "duration": 5,
    "aspect_ratio": "16:9"
}')

TASK=$(printf '%s' "$SUBMIT_RESPONSE" | jq 'if has("data") then .data else . end')
PREDICTION_ID=$(printf '%s' "$TASK" | jq -r '.id')
if [ -z "$PREDICTION_ID" ] || [ "$PREDICTION_ID" = "null" ]; then
  printf 'Submission response did not contain a prediction id
' >&2
  exit 1
fi
RESULT_URL="https://api.wavespeed.ai/api/v3/predictions/$PREDICTION_ID/result"

# 2. Poll until the prediction finishes.
while true; do
  RESPONSE=$(curl --silent --show-error --fail-with-body "$RESULT_URL" \
    -H "Authorization: Bearer $WAVESPEED_API_KEY")
  RESULT=$(printf '%s' "$RESPONSE" | jq 'if has("data") then .data else . end')
  STATUS=$(printf '%s' "$RESULT" | jq -r '.status')
  case "$STATUS" in
    completed) printf '%s\n' "$RESULT" | jq '.outputs'; break ;;
    failed|cancelled|timeout|deleted) printf '%s\n' "$RESULT" | jq . >&2; exit 1 ;;
    *) sleep 2 ;;
  esac
done

Compare

Kling 4.0 vs alternatives

When to pick Kling 4.0 over similar models on WaveSpeedAI.

Kling 4.0 vs Kling 3.0

Kling 3.0 offers Standard, Pro and 4K tiers and a separate motion-control endpoint. Kling 4.0 is one set of three endpoints with 3-30 second clips, and it adds reference-to-video with mixed image, video and audio references.

Kling 4.0 vs Seedance 2.5

Seedance 2.5 also reaches 30-second single shots and adds video editing and extension endpoints. Kling 4.0 focuses on text-, image- and reference-driven generation, with up to 10 images, 5 videos and 3 audios as references.

Kling 4.0 vs Wan 3.0

Wan 3.0 offers text-, image- and reference-to-video up to 30 seconds at up to 1080p. Kling 4.0 covers the same range and is the pick when you want 21:9 ultrawide output, first, last and in-between keyframe control, or mixed image, video and audio references.

FAQ

Kling 4.0 API — Frequently asked questions

Pricing, license, integration — common questions about running Kling 4.0 on WaveSpeedAI.

What is the Kling 4.0 API?

Kling 4.0 is a Kuaishou video generation model exposed as a REST API on WaveSpeedAI. Kuaishou Kling 4.0 — text-to-video, image-to-video and reference-to-video with 3-30 second clips, 720p and 1080p output, and synchronized stereo audio generated with the picture. You can call it programmatically or try it from the playground linked above.

How do I call the Kling 4.0 API?

Sign up for a WaveSpeedAI account, copy your API key from /accesskey, then POST to https://api.wavespeed.ai/api/v3/kwaivgi/kling-v4.0/text-to-video with your input as JSON. The endpoint returns a prediction id. Poll the result endpoint starting around every 2 seconds, increase the interval for long-running tasks, and stop on any terminal status. Production-oriented Python / Node.js / cURL examples are above.

How much does the Kling 4.0 API cost?

Kling 4.0 starts at $0.785 per run. The exact cost scales with the parameters you set (resolution, duration, output count, references). The live cost preview next to the Generate button in the playground shows the exact price for your current input.

Which Kling 4.0 variants are available?

WaveSpeedAI hosts 3 live Kling 4.0 endpoints: kwaivgi/kling-v4.0/text-to-video, kwaivgi/kling-v4.0/image-to-video, kwaivgi/kling-v4.0/reference-to-video. Each variant has its own playground page and pricing.

Can I use Kling 4.0 outputs commercially?

Commercial usage rights follow the Kuaishou model license. Most Kuaishou models permit commercial output use; see each model's playground page for the specific license summary, and WaveSpeedAI's Terms of Service for platform-level conditions.

Why use Kling 4.0 on WaveSpeedAI instead of going direct?

One API key + one billing account across Kling 4.0 AND 1,000+ other AI models from other providers. No per-vendor SDK setup, no separate rate-limit envelopes, no rewrite-per-vendor integration code. Pricing is typically at parity with or below Kuaishou's direct API.

Provider

About Kuaishou

The team behind Kling 4.0 and the broader Kuaishou model lineup on WaveSpeedAI.

Kuaishou is a major Chinese short-video platform and the team behind the Kling family of video generation models. Kling 3.0 ships Standard, Pro, and 4K tiers with native audio synthesis (a sound parameter on every variant), plus a dedicated motion-control endpoint that transfers motion from a reference video to animate a still character image.

Start building with Kling 4.0 on WaveSpeedAI

Free starter credits on signup. One API key across 1,000+ AI models from Kuaishou and every other provider.