Documentary medium tracking shot at golden dawn: the woman field sound recordist from the first reference image walks carefully across the steaming dark basalt geothermal plain from the second reference image, raising her grey furry handheld microphone toward a bubbling turquoise mineral pool while white steam drifts past in cool morning air. Preserve her exact face, curly hair, olive jacket, headphones, and recorder bag. Audio: hissing geothermal steam and crunching volcanic gravel.
Kling 4.0 Flash Reference to Video API
kwaivgi/kling-v4.0-flash/reference-to-videoKling 4.0 Flash Reference to Video API combines reference images, reference videos, and subject elements into 3–20 second 720p clips. It keeps character appearance, outfits, and motion coherent across shots while lowering per-second cost.
Drag and drop files, paste from clipboard, or provide a URL. Optional start frame (at most 1 image; shares the 10-image cap with reference_image_urls).
Drag and drop files, paste from clipboard, or provide a URL. Up to 10 reference images (including optional start frame).
2/10 files added
Drag and drop files, paste from clipboard, or provide a URL. Up to 5 reference videos, 3–20 s each, combined input videos ≤ 20 s.
Switch to JSON mode to attach kling_elements.
Examples
REST API
Quick Start
Submit a Kling 4.0 Flash Reference to Video request in three steps, capture task_id, and fetch the generated 720p video.
Connect to the Vidgo API
Create an API key on your server and send it in the Authorization header as a Bearer token.
- Endpoint
- POST
https://api.vidgo.ai/api/generate/submit - Authentication
- Authorization: Bearer VIDGO_API_KEY
Submit one video task
Send the model ID and mode inputs to the unified submit endpoint.
curl --request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "kwaivgi/kling-v4.0-flash/reference-to-video",
"input": {
"prompt": "Documentary medium tracking shot at golden dawn: the woman field sound recordist from the first reference image walks carefully across the steaming dark basalt geothermal plain from the second reference image, raising her grey furry handheld microphone toward a bubbling turquoise mineral pool while white steam drifts past in cool morning air. Preserve her exact face, curly hair, olive jacket, headphones, and recorder bag. Audio: hissing geothermal steam and crunching volcanic gravel.",
"reference_image_urls": [
"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/edit/v1/01/input-01.jpg",
"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/edit/v1/01/input-02.jpg"
],
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}
}'Wait for the result
Poll the status endpoint with task_id until it reaches finished or failed.
Track status
GET https://api.vidgo.ai/api/generate/status/{task_id}Poll while not_started or running; read data.files[].file_url when finished.
not_startedrunningfinishedfailed{
"code": 200,
"data": {
"task_id": "Y1YTHP960WY5Z9OE",
"status": "not_started",
"created_time": "2026-11-25T11:17:22"
}
}{
"code": 200,
"data": {
"task_id": "Y1YTHP960WY5Z9OE",
"status": "finished",
"files": [
{
"file_type": "video",
"file_url": "https://cdn.vidgo.ai/apis/models/kwaivgi/kling-v4.0-flash/reference-to-video/v1/01/output.mp4"
}
],
"created_time": "2026-11-25T11:17:22",
"error_message": null,
"progress": 100
}
}Complete runnable example
End-to-end script combining submission, polling, terminal checks, and output extraction.
set -euo pipefail
: "${VIDGO_API_KEY:?Set VIDGO_API_KEY in your environment}"
REQUEST_BODY=$(cat <<'JSON'
{
"model": "kwaivgi/kling-v4.0-flash/reference-to-video",
"input": {
"prompt": "Documentary medium tracking shot at golden dawn: the woman field sound recordist from the first reference image walks carefully across the steaming dark basalt geothermal plain from the second reference image, raising her grey furry handheld microphone toward a bubbling turquoise mineral pool while white steam drifts past in cool morning air. Preserve her exact face, curly hair, olive jacket, headphones, and recorder bag. Audio: hissing geothermal steam and crunching volcanic gravel.",
"reference_image_urls": [
"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/edit/v1/01/input-01.jpg",
"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/edit/v1/01/input-02.jpg"
],
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}
}
JSON
)
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
--request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data "$REQUEST_BODY")
TASK_ID=$(printf '%s' "$SUBMIT_RESPONSE" | jq -r '.data.task_id // .task_id // empty')
if [ -z "$TASK_ID" ]; then
printf 'Submit response did not include task_id:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
while true; do
STATUS_RESPONSE=$(curl --silent --show-error --fail-with-body \
--url "https://api.vidgo.ai/api/generate/status/$TASK_ID" \
--header "Authorization: Bearer $VIDGO_API_KEY")
STATUS=$(printf '%s' "$STATUS_RESPONSE" | jq -r '.data.status // .status // empty')
case "$STATUS" in
finished)
printf '%s' "$STATUS_RESPONSE" | jq -r '(.data.files // .files // [])[]?.file_url'
break
;;
failed)
printf '%s' "$STATUS_RESPONSE" | jq -r '.data.error_message // .error_message // "Generation failed"' >&2
exit 1
;;
not_started|running)
sleep 2
;;
*)
printf 'Unexpected task status: %s
' "$STATUS" >&2
exit 1
;;
esac
doneRequest Parameters
Place model and optional callback_url at the request root, and mode parameters inside input.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| model | string | Yes | — | Fixed to kwaivgi/kling-v4.0-flash/reference-to-video. |
| callback_url | string (URL) | No | — | Public HTTP(S) URL that receives the terminal task payload. |
| input.prompt | string | Yes | — | Scene prompt citing references such as @Image1, @Video1, or @Element1 (1–26,000 characters). |
| input.reference_image_urls | string[] | No | — | Up to 10 reference image URLs (start frame + reference images ≤ 10). |
| input.reference_video_urls | string[] | No | — | Up to 5 reference videos, 3–20 s each; all input videos combined ≤ 20 s. |
| input.kling_elements | object[] | No | — | Up to 7 elements (image elements: 2–4 images; up to 3 video elements: 1 video of 3–8 s). |
| input.image_urls | string[] | No | — | Optional start frame (at most 1 image). |
| input.duration | integer | No | 5 | Whole seconds from 3 to 20. |
| input.resolution | string | No | 720p | Fixed to 720p. |
| input.aspect_ratio | string | No | 16:9 | auto, 16:9, 9:16, 1:1, or 21:9. |
Response Fields
Submission returns task_id immediately. Status responses provide generated video files or error details upon completion.
| Field | Type | Description |
|---|---|---|
| code | integer | Application result code; 0 or 200 indicates success. |
| data.task_id | string | Unique task identifier for status polling. |
| data.status | string | not_started | running | finished | failed |
| data.progress | number | Completion percentage (0–100). |
| data.files[].file_url | string | Public URL of the generated video. |
| data.files[].file_type | string | File type, video for video outputs. |
| data.error_message | string | null | Failure detail when status is failed. |
Task Lifecycle
Poll only while status is not_started or running; stop on finished or failed.
not_startedAccepted and queued to start.
runningVideo generation is running; keep polling.
finishedComplete; read video URL from data.files[].file_url.
failedFailed; read data.error_message and stop polling.
Polling and Errors
- Authentication401 means the Bearer API key is missing or invalid.
- Validation400 means a parameter, duration (3–20 s), or total input video duration (≤20 s) is invalid.
- Polling intervalPoll every 5–10 seconds, or set callback_url to avoid polling.
Model Specifications
| Specification | Value | Description |
|---|---|---|
| Model | kwaivgi/kling-v4.0-flash/reference-to-video | Public model identifier for asynchronous video generation. |
| Resolution | 720p | Fixed 720p output. |
| Duration | 3–20 s | Defaults to 5 s in generation modes; total input video duration up to 20 s. |
| Aspect ratio | auto | 16:9 | 9:16 | 1:1 | 21:9 | Defaults to 16:9. |
| Pricing | 18.8 / 12.6 credits/s | 18.8 credits/s ($0.094/s) without video input; 12.6 credits/s ($0.063/s) with video input, billed on output + max(output, ceil(total input seconds)). |
Related Models
Kling 4.0 Flash Reference to Video API FAQ
What is the Kling 4.0 Flash Reference to Video API?
Kling 4.0 Flash Reference to Video is a Kuaishou multi-reference video model for identity-consistent 720p clips. The Kling 4.0 Flash Reference to Video API combines up to 10 reference images, 5 reference videos, and 7 elements (15 total max) into 3–20 second videos. Grounding generation in explicit visual assets keeps characters, outfits, and props stable while running on the cost-efficient Flash tier. You can call it programmatically or try it from the playground above.
How many reference images can the Kling 4.0 Flash Reference to Video API use?
Up to 10 reference images in reference_image_urls; if you also pass a start frame in image_urls, the combined total of start frame and reference images cannot exceed 10.
What video length limits apply to Kling 4.0 Flash Reference to Video?
Each reference video must be 3–20 seconds (element videos 3–8 seconds), and all input videos combined cannot exceed 20 seconds.
How is the Kling 4.0 Flash Reference to Video API billed with video inputs?
Without video inputs, it bills output seconds × 18.8 credits. With video inputs, it bills (output + max(output, ceil(total input video seconds))) × 12.6 credits.
How many kling_elements can Kling 4.0 Flash Reference to Video accept?
Up to 7 elements total, with at most 3 video elements. Each image element takes 2–4 images and each video element takes 1 video of 3–8 seconds.
Can Kling 4.0 Flash Reference to Video use a start frame?
Yes. Pass 1 image in image_urls alongside at least one reference image, reference video, or kling_element.
What is the maximum total asset count in Kling 4.0 Flash Reference to Video?
Start frame, reference images, reference videos, and kling_elements combined can total at most 15 assets.



