Kuaishou
Kling 4.0 Flash
kling-4.0-flash/reference-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/reference-to-video
Input
Showcases
View all showcasesOutput
videoPricing
kling-4.0-flash/reference-to-video per second
| Specifications | Unit Price |
|---|---|
| 720P | $0.1225 |
Overview
This model takes reference images and a text prompt and outputs short 720p videos. Developers can upload 1 to 10 reference images, refer to them in the prompt as @Image1 and so on, describe the scene and the purpose of each image, and generate clips of 3 to 20 seconds. It suits developers and content teams that need to rapidly iterate on reference-driven ideas, for social media short videos, product showcases, and concept drafts.
Key Highlights
- Multiple reference images flexibly guide the visuals — Upload up to 10 reference images and refer to them in the prompt as @Image1 through @Image10, describing the scene and the purpose of each image.
- 3- to 20-second clips with on-demand duration — Each generation can be 3 to 20 seconds long, making it easy to control the pacing and output volume of short-scene videos.
- Fast output at a fixed 720p resolution — Output is uniformly 720p, with 16:9, 9:16, 1:1, 21:9, or auto aspect ratios, suited to social media and mobile short-form content.
Capabilities
- Reference-image-driven video generation: Provide 1 to 10 JPEG or PNG reference images, specify each image's content and purpose in the prompt, and generate a video clip containing the corresponding subjects or style. Reference images are content references, not first frames.
- Custom clip duration and aspect ratio: Duration can be 3 to 20 seconds, and aspect ratio can be 16:9, 9:16, 1:1, 21:9, or auto; auto selects a suitable aspect ratio based on the reference images, making it easy to fit vertical, horizontal, or square publishing scenarios.
- Prompts that precisely reference images: Prompts can be up to 2500 characters, and you can refer to specific reference images via @Image1, @Image2, etc., describing character actions, scene relationships, and the purpose of each image to improve controllability when working with multiple images.
Use Cases
- Batch production of vertical social media short videos — Operations staff upload product and scene reference images, describe the visuals in a prompt, and generate 9:16 videos of 3 to 20 seconds for daily content updates on platforms such as Douyin and Reels.
- Rapid production of looping product showcase clips — E-commerce teams provide multi-angle product reference images and generate 1:1 or 16:9 short clips for product detail pages, ad creatives, or social media placements.
- Iterating on creative drafts and visual concepts — Directors or designers use multiple mood-board reference images to quickly generate 720p video drafts, validating scene atmosphere and composition direction before formal production.
- Testing video opening hooks and layouts — Content creators upload character or scene reference images and generate 3- to 10-second short video clips to test the appeal of different aspect ratios and opening shots.
Limitations and Selection Advice
A single generation is capped at 20 seconds, so long videos cannot be generated directly; output resolution is fixed at 720p, and the aspect ratio must be one of 16:9, 9:16, 1:1, 21:9, or auto. Reference images must be JPEG or PNG, at least 300px on each side, with an aspect ratio between 2:5 and 5:2, otherwise submission will fail. Prompts can be up to 2500 characters and must use @ImageN to refer to reference images. Reference images serve only as content or style references; absolute character consistency or exact visual reproduction is not guaranteed.
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/reference-to-video
routestringOptionalCurrent fixed value: default
inputobjectRequired
Business parameters for kling-4.0-flash/reference-to-video and route default — see the parameter table below.
promptstringRequiredminLength 1maxLength 2500Describe the scene and how each reference image is used. You can reference the corresponding reference images in the copy using placeholders such as @Image1 and @Image2.
durationintegerOptionalDefault: 5min 3max 20Controls the length of the generated video clip, in whole seconds. Range is 3-20, default is 5. Billed per second.
image_urlsarrayRequiredminItems 1maxItems 10Array of reference images. Provide 1-10 images as reference material (not first frames). Supports JPEG or PNG, at least 300px per side, with an aspect ratio between 2:5 and 5:2. Can be referenced in the prompt using @Image1, @Image2, etc.
Array [ string ]
resolutionstringOptionalDefault: "720p"Controls the output resolution. This model only supports 720p rendering, default is 720p.
720paspect_ratiostringOptionalDefault: "auto"Controls the output aspect ratio. Default is auto, which automatically selects the most suitable ratio based on the reference images.
16:99:161:121:9autocallbackobjectOptional
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/reference-to-video",
"input": {
"prompt": "…",
"duration": 5,
"image_urls": "…",
"resolution": "720p",
"aspect_ratio": "auto"
}
}' 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/reference-to-video",
input: {
"prompt": "…",
"duration": 5,
"image_urls": "…",
"resolution": "720p",
"aspect_ratio": "auto"
}
}),
});
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/reference-to-video",
"input": {
"prompt": "…",
"duration": 5,
"image_urls": "…",
"resolution": "720p",
"aspect_ratio": "auto"
}
},
)
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 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 -
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
Related Models
View all models →Same Type
-
OmniHuman 2.0 ByteDance $0.100 /second -
Hailuo 2.3 MiniMax $0.270 /video -
Vidu Q3 Vidu $0.149 /second -
Gemini Omni 1.2 Google $0.023 /second -
Gemini Omni 1.1 Google $0.450 /video -
Grok Imagine 1.5 xAI $0.011 /second -
Runway Gen 4.5 Runway $0.172 /second -
HappyHorse 1.1 Alibaba $0.160 /second -
MiniMax H3 MiniMax $0.072 /second -
Creatify Boreal Creatify $0.015 /second -
Veo 3.1 Fast Google $0.170 /second -
HappyHorse 1.0 Alibaba $0.168 /second