提交 Kling 4.0 Flash 参考生视频 任务
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 参考生视频
Kling 4.0 Flash 参考生视频 API 用最多 10 张参考图、5 个参考视频和 7 个主体引导生成 3–20 秒的 720p 视频。
POST
/
api
/
generate
/
submit
提交 Kling 4.0 Flash 参考生视频 任务
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"
}- 提交后会返回
task_id。如果提供了callback_url,当任务状态变为finished或failed时,系统会向callback_url发送 POST 请求。 - 无论是否提供
callback_url,都可以通过统一的查询任务状态接口获取结果。
@Image1、@Video1 或 @Element1。
Kling 4.0 Flash 是快手 Kling 4.0 视频模型中速度更快的 720p 版本。Vidgo 提供四个模型 ID:文生视频、图生视频、参考生视频和视频编辑。
模型
- kwaivgi/kling-v4.0-flash/reference-to-video — Kling 4.0 Flash 参考生视频,基于图片、视频和主体,3–20 秒,720p。
功能
- 最多 10 张参考图、5 个参考视频和 7 个主体,合计最多 15 个素材。
- 主体可由同一对象的 2–4 张图片或一个视频构成。
- 可通过
image_urls指定首帧。 - 3–20 秒,720p,五种宽高比。
输入模式
至少提供一种参考输入,可以组合使用:- 参考图(
reference_image_urls):用@Image1、@Image2… 引用。 - 参考视频(
reference_video_urls):用@Video1、@Video2… 引用。按输入视频计费。 - 主体(
kling_elements):用@Element1、@Element2… 引用。视频主体按输入视频计费。
image_urls 中放一张图片可固定开场画面。
必填参数
prompt(string):场景描述,去除首尾空白后 1–26,000 个字符。reference_image_urls、reference_video_urls、kling_elements至少提供一项。
可选参数
reference_image_urls(string[]):最多 10 个公开的 HTTP(S) 图片 URL。reference_video_urls(string[]):最多 5 个公开的 HTTP(S) 视频 URL,每个 3–20 秒。kling_elements(object[]):最多 7 个主体,其中视频主体最多 3 个。每个主体二选一:element_input_urls(string[]):该主体的 2–4 个图片 URL。element_input_video_urls(string[]):该主体的恰好 1 个视频 URL,3–8 秒。
image_urls(string[]):一个首帧图片 URL。duration(integer):输出时长,3–20秒。默认5。resolution(string):720p。默认720p。aspect_ratio(string):auto、16:9、9:16、1:1或21:9。默认16:9。
输出
任务完成后,查询任务状态接口和回调内容的files 数组中返回一个 720p MP4 视频。
示例
- 人物与场景参考:第一张图中的录音师在黎明时走过第二张图中蒸汽升腾的地热平原,5 秒,
16:9(结果)。
注意事项
- 限制:首帧加参考图 ≤ 10;全部素材(首帧、参考图、参考视频、主体)≤ 15;视频主体 ≤ 3。
- 输入视频(MP4、MOV 或 WebM,每个最大 100 MB)在提交时下载并测量时长,须包含视频轨。参考视频和源视频为 3–20 秒,主体视频为 3–8 秒,全部输入视频合计最多 20 秒。
- 每个主体只接收
element_input_urls或element_input_video_urls;主体中的其他键(如voice_id)返回 400。 model和callback_url放在请求根级,与input并列。input接收上文列出的字段,其他字段返回 400。- 积分在提交时预扣。只含图片和文本的请求按输出秒数以 720p 费率计费。含输入视频(参考视频、视频主体或源视频)的请求按输入视频费率计费,计费秒数 = 输出时长 + max(输出时长, 全部输入视频总时长向上取整)。任务失败全额退还。当前费率见定价页。
请求体
application/json