Submit Kling 4.0 Flash Reference to Video Task
curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--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"
}
}
'import requests
url = "https://api.vidgo.ai/api/generate/submit"
payload = {
"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"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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'
}
})
};
fetch('https://api.vidgo.ai/api/generate/submit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vidgo.ai/api/generate/submit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vidgo.ai/api/generate/submit"
payload := strings.NewReader("{\n \"model\": \"kwaivgi/kling-v4.0-flash/reference-to-video\",\n \"input\": {\n \"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.\",\n \"reference_image_urls\": [\n \"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/edit/v1/01/input-01.jpg\",\n \"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/edit/v1/01/input-02.jpg\"\n ],\n \"duration\": 5,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.vidgo.ai/api/generate/submit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"kwaivgi/kling-v4.0-flash/reference-to-video\",\n \"input\": {\n \"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.\",\n \"reference_image_urls\": [\n \"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/edit/v1/01/input-01.jpg\",\n \"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/edit/v1/01/input-02.jpg\"\n ],\n \"duration\": 5,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vidgo.ai/api/generate/submit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"kwaivgi/kling-v4.0-flash/reference-to-video\",\n \"input\": {\n \"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.\",\n \"reference_image_urls\": [\n \"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/edit/v1/01/input-01.jpg\",\n \"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/edit/v1/01/input-02.jpg\"\n ],\n \"duration\": 5,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"task_id": "Y1YTHP960WY5Z9OE",
"status": "not_started",
"created_time": "2026-11-25T11:17:22"
}
}{
"detail": "reference-to-video requires reference_image_urls, reference_video_urls or kling_elements"
}{
"detail": "reference-to-video requires reference_image_urls, reference_video_urls or kling_elements"
}Kling
Kling 4.0 Flash Reference to Video
The Kling 4.0 Flash Reference to Video API guides 3–20 second 720p videos with up to 10 reference images, 5 reference videos and 7 elements.
POST
/
api
/
generate
/
submit
Submit Kling 4.0 Flash Reference to Video Task
curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--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"
}
}
'import requests
url = "https://api.vidgo.ai/api/generate/submit"
payload = {
"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"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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'
}
})
};
fetch('https://api.vidgo.ai/api/generate/submit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vidgo.ai/api/generate/submit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vidgo.ai/api/generate/submit"
payload := strings.NewReader("{\n \"model\": \"kwaivgi/kling-v4.0-flash/reference-to-video\",\n \"input\": {\n \"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.\",\n \"reference_image_urls\": [\n \"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/edit/v1/01/input-01.jpg\",\n \"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/edit/v1/01/input-02.jpg\"\n ],\n \"duration\": 5,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.vidgo.ai/api/generate/submit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"kwaivgi/kling-v4.0-flash/reference-to-video\",\n \"input\": {\n \"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.\",\n \"reference_image_urls\": [\n \"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/edit/v1/01/input-01.jpg\",\n \"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/edit/v1/01/input-02.jpg\"\n ],\n \"duration\": 5,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vidgo.ai/api/generate/submit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"kwaivgi/kling-v4.0-flash/reference-to-video\",\n \"input\": {\n \"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.\",\n \"reference_image_urls\": [\n \"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/edit/v1/01/input-01.jpg\",\n \"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/edit/v1/01/input-02.jpg\"\n ],\n \"duration\": 5,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"task_id": "Y1YTHP960WY5Z9OE",
"status": "not_started",
"created_time": "2026-11-25T11:17:22"
}
}{
"detail": "reference-to-video requires reference_image_urls, reference_video_urls or kling_elements"
}{
"detail": "reference-to-video requires reference_image_urls, reference_video_urls or kling_elements"
}- After submission, a
task_idwill be returned. If you provided acallback_url, when the task status becomesfinishedorfailed, a POST request will be sent to thecallback_url. - Regardless of whether
callback_urlis provided, you can retrieve the result through the unified Query Task Status endpoint.
@Image1, @Video1 or @Element1.
Kling 4.0 Flash is the faster 720p tier of Kuaishou’s Kling 4.0 video model. Vidgo exposes it as four model IDs: Text to Video, Image to Video, Reference to Video and Video Edit.
Models
- kwaivgi/kling-v4.0-flash/reference-to-video — Reference-to-video with Kling 4.0 Flash from images, videos and elements, 3–20 seconds at 720p.
Features
- Up to 10 reference images, 5 reference videos and 7 elements, 15 assets in total.
- Elements built from 2–4 images or one video of the same subject.
- Optional start frame via
image_urls. - 3–20 seconds at 720p in five aspect ratios.
Input modes
Send at least one reference input; you can combine them:- Reference images (
reference_image_urls): cite as@Image1,@Image2, …. - Reference videos (
reference_video_urls): cite as@Video1,@Video2, …. Billed as input video. - Elements (
kling_elements): cite as@Element1,@Element2, …. Video-based elements are billed as input video.
image_urls with one image to fix the opening frame.
Required parameters
prompt(string): Scene description, 1–26,000 characters after trimming.- At least one of
reference_image_urls,reference_video_urlsorkling_elements.
Optional parameters
reference_image_urls(string[]): Up to 10 public HTTP(S) image URLs.reference_video_urls(string[]): Up to 5 public HTTP(S) video URLs, each 3–20 seconds.kling_elements(object[]): Up to 7 elements, at most 3 video-based. Each element has exactly one of:element_input_urls(string[]): 2–4 image URLs of the subject.element_input_video_urls(string[]): exactly 1 video URL of the subject, 3–8 seconds.
image_urls(string[]): One start-frame image URL.duration(integer): Output length,3–20seconds. Default5.resolution(string):720p. Default720p.aspect_ratio(string):auto,16:9,9:16,1:1or21:9. Default16:9.
Output
The finished task returns one 720p MP4 video in thefiles array of Query Task Status and the callback payload.
Examples
- Character and location references: a field sound recordist from the first image walks across the steaming geothermal plain from the second image at dawn, 5 seconds,
16:9(result).
Notes
- Limits: start frame plus reference images ≤ 10; all assets (start frame, reference images, reference videos, elements) ≤ 15; video-based elements ≤ 3.
- Input videos (MP4, MOV or WebM, up to 100 MB each) are downloaded and measured at submission and must contain a video track. Reference and source videos run 3–20 seconds, element videos 3–8 seconds, and all input videos together add up to at most 20 seconds.
- Each element takes
element_input_urlsorelement_input_video_urls; any other key in an element (such asvoice_id) returns 400. - Put
modelandcallback_urlat the request root, next toinput.inputaccepts the fields listed above; other fields return 400. - Credits are reserved at submission. Requests with images and text only are billed per output second at the 720p rate. Requests with input videos (reference videos, video elements or a source video) use the input-video rate on billed seconds = output duration + the larger of the output duration and the total input video length (rounded up to whole seconds). A failed task is refunded in full. See the pricing page for current rates.
Body
application/json