kling-4-0-flash
Kling 4.0 Flash on reAPI — 3–20 second 720p video with sound from text, reference images, reference videos and reusable elements.
Kuaishou's Kling 4.0 Flash, the fast tier of Kling 4.0, live on reAPI. One
model id, kling-4-0-flash, covers text to video and reference-based
generation: up to 10 reference images, up to 5 reference videos and up to 7
elements (named subjects built from 2–4 images or one short video), each
mentioned in the prompt. Every clip is 3–20 seconds at 720p with sound.
See current pricing on the model page.
Quick example
curl https://reapi.ai/api/v1/videos/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-4-0-flash",
"prompt": "A paper boat drifts down a rain-filled city gutter at dusk, the camera skimming the water beside it past glowing shop windows, raindrops ticking on the surface. No text, no logos.",
"duration": 5,
"aspect_ratio": "16:9"
}'import requests
response = requests.post(
"https://reapi.ai/api/v1/videos/generations",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"model": "kling-4-0-flash",
"prompt": "A paper boat drifts down a rain-filled city gutter at dusk, the camera skimming the water beside it past glowing shop windows, raindrops ticking on the surface. No text, no logos.",
"duration": 5,
"aspect_ratio": "16:9",
},
timeout=60,
)
response.raise_for_status()
task_id = response.json()["id"]const response = await fetch('https://reapi.ai/api/v1/videos/generations', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'kling-4-0-flash',
prompt:
'A paper boat drifts down a rain-filled city gutter at dusk, the camera skimming the water beside it past glowing shop windows, raindrops ticking on the surface. No text, no logos.',
duration: 5,
aspect_ratio: '16:9',
}),
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const { id: taskId } = await response.json();package main
import (
"encoding/json"
"fmt"
"net/http"
"strings"
"time"
)
func main() {
body := strings.NewReader(`{
"model": "kling-4-0-flash",
"prompt": "A paper boat drifts down a rain-filled city gutter at dusk, the camera skimming the water beside it past glowing shop windows, raindrops ticking on the surface. No text, no logos.",
"duration": 5,
"aspect_ratio": "16:9"
}`)
req, err := http.NewRequest("POST", "https://reapi.ai/api/v1/videos/generations", body)
if err != nil { panic(err) }
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{Timeout: 60 * time.Second}
res, err := client.Do(req)
if err != nil { panic(err) }
defer res.Body.Close()
var task struct { ID string `json:"id"` }
if err := json.NewDecoder(res.Body).Decode(&task); err != nil { panic(err) }
fmt.Println(task.ID)
}Authentication
Every call needs a Bearer token. Generate keys at reapi.ai/settings/apikeys.
Authorization: Bearer YOUR_API_KEYEndpoint
POST /api/v1/videos/generations
GET /api/v1/tasks/{id}Submission is async. The POST returns a task id right away; poll the task
endpoint until status is completed or failed. Polling does not consume
credits.
Request body
| Field | Type | Default | Notes |
|---|---|---|---|
model | string | — | kling-4-0-flash. Required. |
prompt | string | — | Required, up to 8,000 characters. Mention materials as @image_1, @video_1 or @<element name> — see Mentions. |
duration | integer | 5 | 3–20 seconds of output. |
resolution | string | 720p | 720p is the only output. |
aspect_ratio | string | by input | auto / 16:9 / 9:16 / 1:1 / 21:9. Left out: auto when any reference material is given, 16:9 otherwise. |
image_urls | string[] | — | Reference images, up to 10, mentioned as @image_1, @image_2, … in order. |
video_urls | string[] | — | Reference videos, up to 5, mentioned as @video_1, @video_2, … Billed at the video-input rate. |
keep_original_sound | boolean | false | Keep the reference videos' own audio. Only takes effect with video_urls; without reference videos the clip always gets new sound. |
elements | object[] | — | Subjects for this request, up to 7, mentioned as @name — see Elements. |
Every clip comes with sound; there is no sound switch. There are no first,
middle or last frame fields, no negative_prompt, watermark or standalone
voices field: bind a voice to an element with voice_url. Unknown fields
are refused rather than ignored.
Checked by reAPI before anything is charged:
- every media field, including each element's
image_urls,video_urlandvoice_url, is a public HTTP(S) URL — base64 anddata:URIs are rejected resolutionis720p, anddurationis a positive whole number- every reference video and video element can be measured (its length sets the bill — see Pricing)
Every other rule on this page — counts, element shapes, names, mentions,
input length — is checked by the model when the task starts. A request that
breaks one ends as a failed task with code 80007 and the exact reason, and
is refunded in full.
Mentions
Every material is optional; with none, the request is plain text to video. Once you send materials, point at them from the prompt:
| Material | Mention | Limit |
|---|---|---|
image_urls | @image_1, @image_2, … | 10 images |
video_urls | @video_1, @video_2, … | 5 videos |
elements | @name | 7 elements, at most 3 of them video elements |
Every @ followed by a letter, digit, underscore or Chinese character must
name a material of this request, or the request fails. Names are matched
longest first and without regard to case. A name that ends in a letter, digit
or underscore cannot run straight into another one: @image_12 with a single
image fails; write @image_1 2 or @image_1,.
Reference videos plus video elements are at most 5, and images, videos and elements together at most 15.
{
"model": "kling-4-0-flash",
"prompt": "The dancer from @image_1 performs the routine of @video_1 on a rooftop at dusk",
"image_urls": ["https://example.com/dancer.png"],
"video_urls": ["https://example.com/routine.mp4"],
"keep_original_sound": false,
"duration": 8
}Elements
An element is a named subject you can reuse in the prompt. There are two kinds:
| Field | Image element | Video element |
|---|---|---|
name | required | required |
type | image (default) | video |
image_urls | 2–4 views, the first being the main view | not accepted |
video_url | not accepted | one 3–8 second single-shot video of a character, shortest side at least 700 pixels |
tag | character, animal, prop, costume, scene, effect or others; inferred when left out | character only |
description | up to 100 characters | up to 100 characters |
voice_url | reference audio; characters only (tag character or left out) | reference audio; left out, the video's own speech is used |
Names are 1–20 letters, digits, underscores or Chinese characters, unique
without regard to case. image_N, video_N, keyframe_N, object_N,
audio_N, first_frame and last_frame are reserved.
{
"model": "kling-4-0-flash",
"prompt": "@Mira opens the shop door and greets the morning crowd",
"elements": [
{
"name": "Mira",
"image_urls": ["https://example.com/mira-front.png", "https://example.com/mira-side.png"],
"tag": "character",
"description": "baker in a flour-dusted apron"
}
],
"aspect_ratio": "9:16",
"duration": 6
}Reference videos and video elements together must be 2–20 seconds long.
Troubleshooting
| Failure | What it means | What to do |
|---|---|---|
Synchronous 400 (code 30002) | resolution or duration is not a priced value, or an input video's length could not be read | Use 720p and a whole number of seconds; pass a public MP4 or MOV URL. Nothing was charged |
Task fails with code 80007 | A model rule was broken: an undeclared mention, a bad element, input videos outside 2–20 seconds, an unknown field, … | The message names the field. Fully refunded |
Task fails with code 80006 | The prompt or media was rejected by content review | Fully refunded. Revise the prompt or inputs |
402 on submit | Not enough credits for the reserve | Top up, or lower duration |
Task stays processing | Generation takes a few minutes | Keep polling; a task that can never finish is failed and refunded automatically |
No data: URIs. reAPI rejects base64 inputs platform-wide — every URL
field must be a public HTTP(S) URL. Upload to your own object storage and pass
the URL.
Response envelope
{
"id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e",
"model": "kling-4-0-flash",
"status": "completed",
"created_at": 1789689600,
"output": {
"video_urls": ["https://cdn.reapi.ai/media/tasks/.../0.mp4"]
},
"error": null
}Poll GET /api/v1/tasks/{id} (see the Tasks reference)
until status === "completed", then read output.video_urls. A failed task
carries error.code and error.message; see the
errors catalog.
Pricing
Kling 4.0 Flash bills per second of 720p video, at a rate set by whether the request has input videos:
credits = ceil(per_second_rate × billable_seconds × 1000) 1 credit = $0.001| Request | billable_seconds | Rate |
|---|---|---|
| Text, reference images, image elements | duration | standard |
| Reference videos or video elements | output + max(output, input) | video input |
input is the total length of the reference videos and video elements,
measured by reAPI when the request is accepted and rounded up to whole
seconds. output is duration (default 5). A 5-second clip guided by a
7.2-second reference video bills 5 + 8 = 13 seconds; with a 3-second
reference video it bills 5 + 5 = 10 seconds. Failed tasks are refunded in
full.
Live per-second rates for both rates are on the model page.
Tips
- Describe subject, place, camera move, light and sound; the clip's audio follows the prompt.
- Use Flash to try prompts, ratios and references, then move the shot that works to Kling 4.0 when you need 1080p, keyframes, editing or extension.
- Give a recurring character an element with two or three clear views instead of one reference image.
- Add
no text, no logosto keep invented marks out.