Kling 4.0

Kling 4.0 generates videos from text prompts and image or video references at 720p or 1080p, with durations from 3 to 30 seconds and per-shot prompts.

Input

Fields marked * are required. Review the price before generating.

Text prompt. Reference inputs as @Image1, @Video1, @Element1, etc. Either prompt or multi_prompt must be provided.

Video duration in seconds (3-30).

Optional image to use as the first frame. Counts toward the image reference limit.

Uploading a file needs an account. Create accountJPEG, PNG, WebP · up to 25 MB

Optional ordered keyframes between the first and last frames (max 8). Count toward the image reference limit.

Uploading a file needs an account. Create accountJPEG, PNG, WebP · up to 25 MB

Optional image to use as the last frame. Counts toward the image reference limit.

Uploading a file needs an account. Create accountJPEG, PNG, WebP · up to 25 MB

Reference images, referenced as @Image1, @Image2, ... (max 10).

Uploading a file needs an account. Create accountJPEG, PNG, WebP · up to 25 MB

Reference videos (3-30s each, 30s combined with element videos), referenced as @Video1, @Video2, ... (max 5).

Uploading a file needs an account. Create accountMP4, WebM · up to 100 MB

Output resolution.

Aspect ratio of the generated video. 'auto' adapts it to the references.

Additional settings

Per-shot prompts for multi-shot generation. The video duration is the sum of the shot durations.

Characters/objects, referenced as @Element1, @Element2, ... (max 7). Up to 3 may be video elements.

Starting price$0.149 / second

You sign up first. Your settings are kept.

API code for this input

Uses your current form values and requests a new quote. Running the generation step uses your balance. Get an API key

# 1. Price the exact input (quotes are valid for up to 10 minutes)
curl -s https://api.raywake.com/v1/quotes \
  -H "Authorization: Bearer $RAYWAKE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "kling/v4/reference-to-video",
  "input": {
    "duration": 5,
    "resolution": "1080p",
    "aspect_ratio": "16:9"
  }
}'

# 2. Start the generation with the quote_id from step 1
curl -s https://api.raywake.com/v1/generate \
  -H "Authorization: Bearer $RAYWAKE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"model": "kling/v4/reference-to-video", "quote_id": "QUOTE_ID", "input": {"duration":5,"resolution":"1080p","aspect_ratio":"16:9"}}'

# 3. Poll until the status is terminal
curl -s https://api.raywake.com/v1/jobs/JOB_ID \
  -H "Authorization: Bearer $RAYWAKE_API_KEY"

Set RAYWAKE_API_KEY before running. Replace QUOTE_ID and JOB_ID in cURL with the returned values. File links can expire; refresh them if you run the code later.

More runnable examples on GitHub

How to use Kling 4.0

Getting started

Kling 4.0 is built for longer, planned clips. Write one prompt for a continuous shot, or split the scene into shots with their own prompts and lengths; the video lasts as long as the shots added together. Use Image to Video when a product photo, a character or a location must open the clip, and add an ending image when you need the shot to land on a specific frame.

Example prompt

A detective in a black trench coat stands on a rooftop in the rain, looking through a telescope at the street below. Neon reflections ripple across the wet concrete as the camera slowly circles behind him.

Review your result

Watch the whole clip, not only the first seconds. In multi-shot videos check each cut: the subject's face, clothing and props should stay consistent and every shot should follow its own prompt. Listen to the soundtrack too: Kling 4.0 generates sound with every clip and has no setting to switch it off.

Inputs and settings

Choose prompt (up to 26,000 characters) for one continuous shot, or multi_prompt for separate shots. Send one of the two, not both. Each shot takes a prompt of up to 512 characters and 1–30 seconds; shot lengths must add up to 3–30 seconds.

Pick 720p or 1080p (the default). Text to Video offers 16:9, 9:16, 1:1 and 21:9; Image to Video follows your start_image_url and accepts an optional end_image_url (JPEG, PNG or WebP, at least 300 px, aspect ratio 0.4–2.5).

Raywake bills Kling 4.0 per second of video: $0.2737 per second at 720p and $0.4097 per second at 1080p. A 5-second 1080p clip quotes at $2.05 and the full 30 seconds at $12.29. The quote is frozen before you generate.

How much does Kling 4.0 cost on Raywake?

Kling 4.0 is priced per second of output: $0.2737 per second at 720p and $0.4097 per second at 1080p. A 5-second clip is $1.37 at 720p or $2.05 at 1080p; the longest 30-second 1080p clip is $12.29. You see the exact quote before generating, with no subscription.

How long can a Kling 4.0 video be?

From 3 to 30 seconds in one request. With per-shot prompts the length is the sum of the shots, for example a 6-second wide shot and a 4-second close-up make one 10-second video.

Does Kling 4.0 generate sound?

Yes. Kling 4.0 returns each clip with generated sound, included in the per-second price. The request has no setting to switch sound off or choose the music, so replace the track with a separate audio model when you need exact music or a voice-over.

Do I need a Kling subscription to use Kling 4.0?

No. Each Kling 4.0 generation is paid from your Raywake USD balance. Kling's own plans, credits and daily allowances do not apply to Raywake.