Kuaishou
Kling 4.0 Flash
kling-4.0-flash/text-to-video
A lightweight, fast video model in the Kuaishou Kling 4.0 series, supporting text-to-video, image-to-video, and reference-image generation, with a single clip length of 3 to 20 seconds and 720p output, suitable for rapid batch production of social media short videos and creative draft iteration
Try kling-4.0-flash/text-to-video
Input
Showcases
View all showcasesOutput
videoPricing
kling-4.0-flash/text-to-video per second
| Specifications | Unit Price |
|---|---|
| 720P | $0.1225 |
Positioning Overview
This is a text-to-video tool for short-video creators: simply provide a text description to generate a dynamic video clip directly. Output is at a fixed 720p resolution, with each generation producing a 3- to 20-second short clip, and it supports four aspect ratios: 16:9, 9:16, 1:1, and 21:9. It is suitable for social media content production, product showcases, and rapid iteration on creative drafts, helping developers quickly turn text ideas into video assets without any shooting footage.
Core Highlights
- Generate video clips directly from text — just enter a prompt describing the subject, action, camera, and atmosphere to get a complete dynamic video, with no image assets required.
- Duration can be freely set in seconds — a single generation supports 3 to 20 seconds, so developers can choose the right length for platform requirements, billed per second.
- Four aspect ratios cover mainstream scenarios — 16:9, 9:16, 1:1, and 21:9 are available; 21:9 suits ultra-wide cinematic styles, while 9:16 fits vertical short videos.
- Prompt limit of 2,500 characters — the relatively generous input length makes it easy to describe scene content, camera movement, and lighting atmosphere in detail.
Capability Description
- Generate video from text descriptions: Enter a prompt describing the subject, action, camera movement, lighting, and mood within the shot, and the model generates a corresponding dynamic video clip based on it, with up to 2,500 characters of input text.
- Adjustable duration on demand: Each request can specify a clip length of 3 to 20 seconds, with a default of 5 seconds, suitable for a range of needs from short hooks to longer scenes.
- Multi-aspect-ratio output: Choose one of 16:9, 9:16, 1:1, or 21:9 for output; 21:9 provides an ultra-wide cinematic frame that meets the display requirements of different platforms.
- Fixed 720p resolution: Output is uniformly 720p, suitable for scenarios with moderate clarity requirements such as social media publishing and quick previews.
Use Cases
- Vertical short-video production for social media — operators describe product selling points or lifestyle scenes in text and generate 3- to 20-second clips in 9:16 for direct publishing on short-video platforms.
- Rapid testing of video opening hooks — content creators write different prompts for the same topic, generate multiple short clips to compare opening effects, and pick a satisfactory version before continuing production.
- Product showcase short-video production — e-commerce teams describe product appearance and usage scenarios in text and generate 16:9 or 1:1 showcase videos for product detail pages or ad placements.
- Creative drafts and storyboard previews — directors or planners use short prompts to quickly generate visual drafts, validating shot composition and pacing as visual references before formal production.
- Ultra-wide atmospheric short videos — brands use the 21:9 ratio to generate cinematic visuals for widescreen display placements such as website hero sections and exhibition hall screens.
Limitations and Selection Advice
A single generation is capped at 20 seconds, so long videos cannot be produced directly; resolution is fixed at 720p, making it unsuitable for scenarios requiring higher clarity or high dynamic range output. Currently only plain text input is supported, with no fine-grained visual control such as first frame, last frame, or keyframes, so composition must be guided mainly through prompt descriptions. Prompt input is limited to 2,500 characters. If longer duration, higher resolution, or first/last-frame control is needed, consider other video models that support those capabilities.
What's new
View changelog →- New model Kling 4.0 Flash Now Available: Text, Image and Reference to Video
Frequently asked questions
View all FAQs →-
How long a video can this model generate?
A single generation produces 3 to 20 seconds, 5 seconds by default, billed per second. For long videos over 20 seconds, you need to split them into multiple segments, generate each separately, and then stitch them together.
-
What is the highest resolution that can be output?
Only one tier is available: 720p. The resolution parameter only accepts 720p, and this applies equally to text-to-video, image-to-video, and reference-to-video.
-
How do I choose between image-to-video and reference-to-video?
To make the picture start moving from a still frame, use image-to-video: put only 1 first-frame image in image_urls, and the output aspect ratio follows that image. To have the people and styles from multiple images participate in the composition, use reference-to-video: image_urls can hold 1 to 10 images, and you can choose aspect_ratio yourself.
-
Can the first frame and the last frame be controlled?
Specifying the end frame is currently not supported, and there is no multi-keyframe control. Image-to-video only fixes the starting image; the ending is generated by the model according to the prompt. To make the ending more controllable, you can clearly state the final action and where the camera stops in the prompt.
Create a generation task
https://api.hiapi.ai/v1/tasks Headers
AuthorizationstringRequiredAccount API key. Required on every request. Example: Bearer YOUR_HIAPI_API_KEY. Get your API key
Content-TypestringOptionalThe request body is always parsed as JSON; when sent, only application/json (optionally with charset) is accepted — any other value returns 415. Example: application/json.
Idempotency-KeystringOptionalIdempotency key, up to 255 bytes. Retries with the same key from the same account create the task only once; replays return the original taskId.
On network timeouts or client retries, the same key creates the task only once — no double charges (scope: the API key's account). Use a business-unique identifier as the key (e.g. "order-42"); replays return the original taskId, and keys expire 24 hours after the first request. See the Unified Async API overview for the full scenario matrix.
Body
modelstringRequiredCurrent fixed value: kling-4.0-flash/text-to-video
routestringOptionalCurrent fixed value: default
inputobjectRequired
Business parameters for kling-4.0-flash/text-to-video and route default — see the parameter table below.
promptstringRequiredminLength 1maxLength 2500A prompt describing the shot content, covering subject, action, camera movement, lighting, and atmosphere; audio is generated alongside the visuals.
durationintegerOptionalDefault: 5min 3max 20Duration of the video clip in seconds, ranging from 3 to 20; billed per second. Default is 5 seconds.
resolutionstringOptionalDefault: "720p"Output resolution; this model only supports rendering at 720p. Default is 720p.
720paspect_ratiostringOptionalDefault: "16:9"Aspect ratio of the output frame; 21:9 is the ultra-wide cinematic aspect ratio. Default is 16:9.
16:99:161:121:9callbackobjectOptional
Terminal-state notification config. When omitted, no callback is delivered — poll the task yourself. See the callback note below.
Provide callback.url when creating a task and HiAPI POSTs to your service once the task reaches a terminal state — no polling needed. The callback payload mirrors the task detail structure; signature verification, delivery retries and idempotency are documented on the Unified Async API overview page.
urlstringRequiredRequired when callback is present. A POST is sent to this URL once the task reaches a terminal state; must be a valid http(s) URL.
whenstringOptionalDefault: "final"Only final is supported today — notified on both success and fail.
finalstoragestringOptionalDefault: "temp"Artifact storage tier: temp (default, retained about 7 days) or persistent (long-term, billed by size). Insufficient balance or exceeding the storage cap silently downgrades to temp; the effective tier is shown in the task detail response.
temppersistentRequest examples
# Submit an async task; returns a taskId immediately (no waiting for generation)
curl -X POST "https://api.hiapi.ai/v1/tasks" \
-H "Authorization: Bearer $HIAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-4.0-flash/text-to-video",
"input": {
"prompt": "…",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}
}' const res = await fetch("https://api.hiapi.ai/v1/tasks", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.HIAPI_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "kling-4.0-flash/text-to-video",
input: {
"prompt": "…",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}
}),
});
const task = await res.json();
// { code: 200, message: "success", data: { taskId } } import os, requests
res = requests.post(
"https://api.hiapi.ai/v1/tasks",
headers={"Authorization": f"Bearer {os.environ['HIAPI_API_KEY']}"},
json={
"model": "kling-4.0-flash/text-to-video",
"input": {
"prompt": "…",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}
},
)
print(res.json()) # { code, message, data: { taskId } } 200 OK
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR"
}
} 400 Bad Request
{
"code": 400,
"message": "invalid request",
"data": null,
"error_code": "INVALID_REQUEST"
} Get task detail
https://api.hiapi.ai/v1/tasks/:id Response fields
taskIdstringRequiredTask ID, always prefixed with tk-hiapi-.
modelstringRequiredResolved full model name. Tasks submitted with the route parameter return base@route (e.g. gpt-image-2/text-to-image@ext); otherwise identical to the name passed at creation.
routestringOptionalPresent only when the task was submitted with an explicit route parameter; echoes the submitted value.
statusstringRequiredTask status.
queued Queued, not started yet.
handling Being processed.
archiving Processing finished, artifacts being prepared.
success Terminal: completed, artifacts available (output returned).
fail Terminal: failed (error returned).
After submission, check status: success and fail are terminal, everything else is non-terminal. Poll every 1–3 seconds until terminal. On success, download artifacts from output[].url and transfer them before expireAt; pass storage: "persistent" at creation time when long-term retention is needed.
creatednumberRequiredTask creation time (Unix seconds).
completednumberRequiredUnix seconds when the task reached a terminal state; fixed to 0 while not terminal.
outputarrayOptional
Present only when status == success. Artifact list — always an array; a single task may return multiple types at once (e.g. video + first_frame).
Array [ object ]
Array items
urlstringRequiredArtifact URL, directly downloadable.
typestringRequiredCurrent possible values: video, image, audio, first_frame, last_frame, thumbnail; more may be added later.
expireAtnumberRequiredUnix seconds until which the artifact remains accessible; download or transfer before it expires.
errorobjectOptional
Present only when status == fail.
codestringRequiredBusiness error code.
messagestringRequiredError description.
Response examples
Success
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR",
"model": "happyhorse-1-0",
"status": "success",
"created": 1777282033,
"completed": 1777282099,
"output": [
{
"url": "https://cdn.hiapi.ai/tasks/.../video.mp4",
"type": "video",
"expireAt": 1777886899
}
]
}
} Processing (non-terminal)
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "archiving",
"created": 1777282033,
"completed": 0
}
} Failed
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "fail",
"created": 1777282033,
"completed": 1777282099,
"error": {
"code": "TASK_FAILED",
"message": "task failed"
}
}
} Articles
View all articles →-
Tutorial
How to Call kling-4.0-flash Reference-to-Video via the HiAPI API: curl and Python
A working request walkthrough for multi-reference image-to-video, async polling, and troubleshooting
11 min read -
Tutorial
How to Use kling-4.0-flash Image-to-Video via the HiAPI API: curl and Python
A practical request walkthrough: first-frame image input, async job polling, sync audio, and error triage
10 min read -
Guide
Kling 4.0 Flash API Guide: Three Modes, $0.1225 per Second and Examples
Text-to-video, image-to-video and reference-to-video share one set of parameters: 720p, 3–20 seconds, native audio
5 min read
Related Models
View all models →Same Type
-
Kling 3.0 Kuaishou $0.100 /second -
Vidu Q4 Preview Vidu $0.051 /second -
Hailuo 2.3 MiniMax $0.270 /video -
Kling 4.0 Kuaishou $0.204 /second -
Kling 2.5 Kuaishou $0.090 /second -
FLUX 3 Max Black Forest Labs $0.243 /second -
Creatify Boreal Creatify $0.015 /second -
Wan 3.0 Video Alibaba $0.040 /second -
Ray 3.2 Luma $0.214 /video -
HappyHorse 1.1 Alibaba $0.160 /second -
Wan 2.6 Flash Alibaba $0.029 /second -
Vidu Q3 Vidu $0.149 /second