提交 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/image-to-video",
"input": {
"prompt": "Warm steam curls gently upward from the enamel cup of tea as the station attendant hands it to the elderly grandfather; raindrops streak steadily down the dark waiting-room window while warm train headlights glide across the misty platform outside. Subtle slow push-in, preserving faces, clothing, and warm tungsten light. Audio: soft autumn rain and distant train rumble.",
"image_urls": [
"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/text-to-image/v1/01/output.png"
],
"duration": 5,
"resolution": "720p"
}
}
'import requests
url = "https://api.vidgo.ai/api/generate/submit"
payload = {
"model": "kwaivgi/kling-v4.0-flash/image-to-video",
"input": {
"prompt": "Warm steam curls gently upward from the enamel cup of tea as the station attendant hands it to the elderly grandfather; raindrops streak steadily down the dark waiting-room window while warm train headlights glide across the misty platform outside. Subtle slow push-in, preserving faces, clothing, and warm tungsten light. Audio: soft autumn rain and distant train rumble.",
"image_urls": ["https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/text-to-image/v1/01/output.png"],
"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/image-to-video',
input: {
prompt: 'Warm steam curls gently upward from the enamel cup of tea as the station attendant hands it to the elderly grandfather; raindrops streak steadily down the dark waiting-room window while warm train headlights glide across the misty platform outside. Subtle slow push-in, preserving faces, clothing, and warm tungsten light. Audio: soft autumn rain and distant train rumble.',
image_urls: [
'https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/text-to-image/v1/01/output.png'
],
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/image-to-video',
'input' => [
'prompt' => 'Warm steam curls gently upward from the enamel cup of tea as the station attendant hands it to the elderly grandfather; raindrops streak steadily down the dark waiting-room window while warm train headlights glide across the misty platform outside. Subtle slow push-in, preserving faces, clothing, and warm tungsten light. Audio: soft autumn rain and distant train rumble.',
'image_urls' => [
'https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/text-to-image/v1/01/output.png'
],
'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/image-to-video\",\n \"input\": {\n \"prompt\": \"Warm steam curls gently upward from the enamel cup of tea as the station attendant hands it to the elderly grandfather; raindrops streak steadily down the dark waiting-room window while warm train headlights glide across the misty platform outside. Subtle slow push-in, preserving faces, clothing, and warm tungsten light. Audio: soft autumn rain and distant train rumble.\",\n \"image_urls\": [\n \"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/text-to-image/v1/01/output.png\"\n ],\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/image-to-video\",\n \"input\": {\n \"prompt\": \"Warm steam curls gently upward from the enamel cup of tea as the station attendant hands it to the elderly grandfather; raindrops streak steadily down the dark waiting-room window while warm train headlights glide across the misty platform outside. Subtle slow push-in, preserving faces, clothing, and warm tungsten light. Audio: soft autumn rain and distant train rumble.\",\n \"image_urls\": [\n \"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/text-to-image/v1/01/output.png\"\n ],\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/image-to-video\",\n \"input\": {\n \"prompt\": \"Warm steam curls gently upward from the enamel cup of tea as the station attendant hands it to the elderly grandfather; raindrops streak steadily down the dark waiting-room window while warm train headlights glide across the misty platform outside. Subtle slow push-in, preserving faces, clothing, and warm tungsten light. Audio: soft autumn rain and distant train rumble.\",\n \"image_urls\": [\n \"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/text-to-image/v1/01/output.png\"\n ],\n \"duration\": 5,\n \"resolution\": \"720p\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"task_id": "537F9S6N1LJBX0VK",
"status": "not_started",
"created_time": "2026-11-25T11:17:21"
}
}{
"detail": "image_urls must contain exactly 1 start frame"
}{
"detail": "image_urls must contain exactly 1 start frame"
}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 '
{
"model": "kwaivgi/kling-v4.0-flash/image-to-video",
"input": {
"prompt": "Warm steam curls gently upward from the enamel cup of tea as the station attendant hands it to the elderly grandfather; raindrops streak steadily down the dark waiting-room window while warm train headlights glide across the misty platform outside. Subtle slow push-in, preserving faces, clothing, and warm tungsten light. Audio: soft autumn rain and distant train rumble.",
"image_urls": [
"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/text-to-image/v1/01/output.png"
],
"duration": 5,
"resolution": "720p"
}
}
'import requests
url = "https://api.vidgo.ai/api/generate/submit"
payload = {
"model": "kwaivgi/kling-v4.0-flash/image-to-video",
"input": {
"prompt": "Warm steam curls gently upward from the enamel cup of tea as the station attendant hands it to the elderly grandfather; raindrops streak steadily down the dark waiting-room window while warm train headlights glide across the misty platform outside. Subtle slow push-in, preserving faces, clothing, and warm tungsten light. Audio: soft autumn rain and distant train rumble.",
"image_urls": ["https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/text-to-image/v1/01/output.png"],
"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/image-to-video',
input: {
prompt: 'Warm steam curls gently upward from the enamel cup of tea as the station attendant hands it to the elderly grandfather; raindrops streak steadily down the dark waiting-room window while warm train headlights glide across the misty platform outside. Subtle slow push-in, preserving faces, clothing, and warm tungsten light. Audio: soft autumn rain and distant train rumble.',
image_urls: [
'https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/text-to-image/v1/01/output.png'
],
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/image-to-video',
'input' => [
'prompt' => 'Warm steam curls gently upward from the enamel cup of tea as the station attendant hands it to the elderly grandfather; raindrops streak steadily down the dark waiting-room window while warm train headlights glide across the misty platform outside. Subtle slow push-in, preserving faces, clothing, and warm tungsten light. Audio: soft autumn rain and distant train rumble.',
'image_urls' => [
'https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/text-to-image/v1/01/output.png'
],
'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/image-to-video\",\n \"input\": {\n \"prompt\": \"Warm steam curls gently upward from the enamel cup of tea as the station attendant hands it to the elderly grandfather; raindrops streak steadily down the dark waiting-room window while warm train headlights glide across the misty platform outside. Subtle slow push-in, preserving faces, clothing, and warm tungsten light. Audio: soft autumn rain and distant train rumble.\",\n \"image_urls\": [\n \"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/text-to-image/v1/01/output.png\"\n ],\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/image-to-video\",\n \"input\": {\n \"prompt\": \"Warm steam curls gently upward from the enamel cup of tea as the station attendant hands it to the elderly grandfather; raindrops streak steadily down the dark waiting-room window while warm train headlights glide across the misty platform outside. Subtle slow push-in, preserving faces, clothing, and warm tungsten light. Audio: soft autumn rain and distant train rumble.\",\n \"image_urls\": [\n \"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/text-to-image/v1/01/output.png\"\n ],\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/image-to-video\",\n \"input\": {\n \"prompt\": \"Warm steam curls gently upward from the enamel cup of tea as the station attendant hands it to the elderly grandfather; raindrops streak steadily down the dark waiting-room window while warm train headlights glide across the misty platform outside. Subtle slow push-in, preserving faces, clothing, and warm tungsten light. Audio: soft autumn rain and distant train rumble.\",\n \"image_urls\": [\n \"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/text-to-image/v1/01/output.png\"\n ],\n \"duration\": 5,\n \"resolution\": \"720p\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"task_id": "537F9S6N1LJBX0VK",
"status": "not_started",
"created_time": "2026-11-25T11:17:21"
}
}{
"detail": "image_urls must contain exactly 1 start frame"
}{
"detail": "image_urls must contain exactly 1 start frame"
}- 提交后会返回
task_id。如果提供了callback_url,当任务状态变为finished或failed时,系统会向callback_url发送 POST 请求。 - 无论是否提供
callback_url,都可以通过统一的查询任务状态接口获取结果。
模型
- kwaivgi/kling-v4.0-flash/image-to-video — Kling 4.0 Flash 图生视频,一张首帧,3–20 秒,720p。
功能
- 通过
image_urls提供一张首帧图片。 - 可选提示词,最多 26,000 个字符。
- 时长可选 3 到 20 秒之间的任意整数秒,输出 720p。
必填参数
image_urls(string[]):恰好一个公开的 HTTP(S) 图片 URL,作为首帧。
可选参数
prompt(string):动作和运镜描述,去除首尾空白后 1–26,000 个字符。duration(integer):输出时长,3–20秒。默认5。resolution(string):720p。默认720p。
输出
任务完成后,查询任务状态接口和回调内容的files 数组中返回一个 720p MP4 视频。
示例
- 雨夜车站:雨水划过候车室窗户,站务员递给老人的热茶冒着蒸汽,5 秒 (结果)。
注意事项
image_urls只放一张图片;第二张图片返回 400。model和callback_url放在请求根级,与input并列。input接收上文列出的字段,其他字段返回 400。- 积分在提交时预扣,按输出时长以 720p 费率计费。任务失败全额退还。当前费率见定价页。
请求体
application/json