Transform the snowy winter pine clearing into a misty golden autumn birch forest carpeted with crisp fallen amber and crimson leaves, with soft warm morning sunlight filtering through yellow foliage. Preserve the red fox's exact trotting gait, pause, ear turn, and steady lateral camera tracking completely intact. No text, no logos, no watermarks.
Kling 4.0 Flash Video Edit API
kwaivgi/kling-v4.0-flash/video-editKling 4.0 Flash Video Edit API transforms an existing 3–20 second video using text prompts, reference images, up to 4 reference videos, and subject elements. It preserves source motion and temporal continuity at 12.6 credits per billed second.
Drag and drop files, paste from clipboard, or provide a URL. Required. One MP4, MOV, or WebM source video (3–20 s, up to 100 MB).
1/1 files added
Drag and drop files, paste from clipboard, or provide a URL. Optional. Up to 10 reference images.
Drag and drop files, paste from clipboard, or provide a URL. Optional. Up to 4 reference videos (3–20 s each; all input videos combined ≤ 20 s).
Switch to JSON mode to attach kling_elements.
Examples
REST API
Quick Start
Submit a Kling 4.0 Flash Video Edit 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/video-edit",
"input": {
"prompt": "Transform the snowy winter pine clearing into a misty golden autumn birch forest carpeted with crisp fallen amber and crimson leaves, with soft warm morning sunlight filtering through yellow foliage. Preserve the red fox's exact trotting gait, pause, ear turn, and steady lateral camera tracking completely intact. No text, no logos, no watermarks.",
"video_url": "https://cdn.vidgo.ai/apis/models/kwaivgi/kling-v4.0-flash/text-to-video/v1/01/output.mp4",
"duration": 5,
"resolution": "720p"
}
}'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": "RWNYZX4GKVV4WF0U",
"status": "not_started",
"created_time": "2026-11-25T11:17:25"
}
}{
"code": 200,
"data": {
"task_id": "RWNYZX4GKVV4WF0U",
"status": "finished",
"files": [
{
"file_type": "video",
"file_url": "https://cdn.vidgo.ai/apis/models/kwaivgi/kling-v4.0-flash/video-edit/v1/01/output.mp4"
}
],
"created_time": "2026-11-25T11:17:25",
"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/video-edit",
"input": {
"prompt": "Transform the snowy winter pine clearing into a misty golden autumn birch forest carpeted with crisp fallen amber and crimson leaves, with soft warm morning sunlight filtering through yellow foliage. Preserve the red fox's exact trotting gait, pause, ear turn, and steady lateral camera tracking completely intact. No text, no logos, no watermarks.",
"video_url": "https://cdn.vidgo.ai/apis/models/kwaivgi/kling-v4.0-flash/text-to-video/v1/01/output.mp4",
"duration": 5,
"resolution": "720p"
}
}
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/video-edit. |
| callback_url | string (URL) | No | — | Public HTTP(S) URL that receives the terminal task payload. |
| input.video_url | string | Yes | — | Public HTTP(S) URL of the source video (3–20 s, up to 100 MB). |
| input.prompt | string | Yes | — | Editing instructions (1–26,000 characters). |
| input.duration | integer | No | Match source | Output seconds (3–20); omit to match the source video length. |
| input.resolution | string | No | 720p | Fixed to 720p. |
| input.reference_image_urls | string[] | No | — | Up to 10 reference image URLs. |
| input.reference_video_urls | string[] | No | — | Up to 4 reference videos (3–20 s each); all input videos combined ≤ 20 s. |
| input.kling_elements | object[] | No | — | Up to 7 image or video elements (at most 3 video elements, 3–8 s each). |
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/video-edit | Public model identifier for asynchronous video generation. |
| Resolution | 720p | Fixed 720p output. |
| Duration | 3–20 s (optional, follows source) | Defaults to 5 s in generation modes; total input video duration up to 20 s. |
| 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 Video Edit API FAQ
What is the Kling 4.0 Flash Video Edit API?
Kling 4.0 Flash Video Edit is a Kuaishou 720p video editing model guided by text and multimodal visual references. The Kling 4.0 Flash Video Edit API transforms a 3–20 second source video using prompts, reference images, up to 4 reference videos, and subject elements at 12.6 credits per billed second. It preserves source camera movement and temporal continuity while executing targeted visual changes. You can call it programmatically or try it from the playground above.
How long can the source video be in the Kling 4.0 Flash Video Edit API?
The source video must be 3–20 seconds (up to 100 MB), and all input videos combined—including reference videos and video elements—cannot exceed 20 seconds.
Can Kling 4.0 Flash Video Edit accept reference videos and elements?
Yes. Alongside video_url, you can pass up to 4 reference_video_urls (3–20 s each) and up to 7 kling_elements (including up to 3 video elements of 3–8 s).
What happens if duration is omitted in Kling 4.0 Flash Video Edit?
The output follows the source video length, and billing uses ceil(source video seconds) as the output duration.
How is the Kling 4.0 Flash Video Edit API billed?
Credits equal 12.6 × (output seconds + max(output seconds, ceil(total input video seconds))). For a single 5-second source clip edited at source length, that is 126 credits ($0.63).
Can I control aspect ratio in Kling 4.0 Flash Video Edit?
Output framing follows the source video in video_url; aspect_ratio is not passed in video-edit mode.
How does Kling 4.0 Flash Video Edit differ from Kling 4.0 Video Edit?
Kling 4.0 Flash Video Edit runs at 720p (12.6 credits/billed second, up to 20 s total video) and adds support for reference videos and video elements, whereas Kling 4.0 Video Edit adds 1080p and up to 30 s clips.



