提交 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 @- <<EOF
{
"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"
}
}
EOFimport requests
url = "https://api.vidgo.ai/api/generate/submit"
payload = {
"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"
}
}
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/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'
}
})
};
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/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'
]
]),
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/video-edit\",\n \"input\": {\n \"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.\",\n \"video_url\": \"https://cdn.vidgo.ai/apis/models/kwaivgi/kling-v4.0-flash/text-to-video/v1/01/output.mp4\",\n \"duration\": 5,\n \"resolution\": \"720p\"\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/video-edit\",\n \"input\": {\n \"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.\",\n \"video_url\": \"https://cdn.vidgo.ai/apis/models/kwaivgi/kling-v4.0-flash/text-to-video/v1/01/output.mp4\",\n \"duration\": 5,\n \"resolution\": \"720p\"\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/video-edit\",\n \"input\": {\n \"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.\",\n \"video_url\": \"https://cdn.vidgo.ai/apis/models/kwaivgi/kling-v4.0-flash/text-to-video/v1/01/output.mp4\",\n \"duration\": 5,\n \"resolution\": \"720p\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"task_id": "RWNYZX4GKVV4WF0U",
"status": "not_started",
"created_time": "2026-11-25T11:17:25"
}
}{
"detail": "video_url is required for video-edit"
}{
"detail": "video_url is required for video-edit"
}Kling
Kling 4.0 Flash 视频编辑
Kling 4.0 Flash 视频编辑 API 按提示词编辑 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 @- <<EOF
{
"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"
}
}
EOFimport requests
url = "https://api.vidgo.ai/api/generate/submit"
payload = {
"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"
}
}
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/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'
}
})
};
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/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'
]
]),
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/video-edit\",\n \"input\": {\n \"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.\",\n \"video_url\": \"https://cdn.vidgo.ai/apis/models/kwaivgi/kling-v4.0-flash/text-to-video/v1/01/output.mp4\",\n \"duration\": 5,\n \"resolution\": \"720p\"\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/video-edit\",\n \"input\": {\n \"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.\",\n \"video_url\": \"https://cdn.vidgo.ai/apis/models/kwaivgi/kling-v4.0-flash/text-to-video/v1/01/output.mp4\",\n \"duration\": 5,\n \"resolution\": \"720p\"\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/video-edit\",\n \"input\": {\n \"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.\",\n \"video_url\": \"https://cdn.vidgo.ai/apis/models/kwaivgi/kling-v4.0-flash/text-to-video/v1/01/output.mp4\",\n \"duration\": 5,\n \"resolution\": \"720p\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"task_id": "RWNYZX4GKVV4WF0U",
"status": "not_started",
"created_time": "2026-11-25T11:17:25"
}
}{
"detail": "video_url is required for video-edit"
}{
"detail": "video_url is required for video-edit"
}- 提交后会返回
task_id。如果提供了callback_url,当任务状态变为finished或failed时,系统会向callback_url发送 POST 请求。 - 无论是否提供
callback_url,都可以通过统一的查询任务状态接口获取结果。
模型
- kwaivgi/kling-v4.0-flash/video-edit — Kling 4.0 Flash 视频编辑,一个 3–20 秒源视频,输出 720p。
功能
- 编辑
video_url中 3–20 秒的源视频。 - 可选引导素材:最多 10 张参考图、4 个参考视频和 7 个主体。
- 输出时长默认跟随源视频,也可用
duration设为 3 到 20 秒。 - 输出 720p。
必填参数
prompt(string):编辑指令,去除首尾空白后 1–26,000 个字符。video_url(string):源视频的公开 HTTP(S) URL,3–20 秒,最大 100 MB。
可选参数
duration(integer):输出时长,3–20秒。默认为源视频时长。resolution(string):720p。默认720p。reference_image_urls(string[]):最多 10 个公开的 HTTP(S) 图片 URL,用@Image1、@Image2… 引用。reference_video_urls(string[]):最多 4 个公开的 HTTP(S) 视频 URL,每个 3–20 秒,用@Video1、@Video2… 引用。kling_elements(object[]):最多 7 个主体,其中视频主体最多 3 个,用@Element1、@Element2… 引用。每个主体二选一:element_input_urls(string[]):该主体的 2–4 个图片 URL。element_input_video_urls(string[]):该主体的恰好 1 个视频 URL,3–8 秒。
输出
任务完成后,查询任务状态接口和回调内容的files 数组中返回一个 720p MP4 视频。
示例
- 季节变换:把雪中松林改成金色秋季白桦林,赤狐的步态和镜头跟拍保持不变,5 秒 (结果)。
注意事项
- 输入视频(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(输出时长, 全部输入视频总时长向上取整)。任务失败全额退还。省略
duration时,输出时长按源视频时长向上取整计。当前费率见定价页。
请求体
application/json