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/text-to-video",
"input": {
"prompt": "Wildlife documentary tracking shot at blue hour in a snowy Hokkaido pine clearing: a wild red fox trots smoothly across deep untouched powder snow, leaving crisp paw prints, warm breath misting in the freezing air. Midway it pauses, ears pivoting sharply as a clump of snow slips off a dark cedar bough behind it. Natural twilight, steady lateral tracking camera, no cuts. Audio: soft crunching snow footsteps, gentle winter wind through pine needles. No text, no logos, no watermarks.",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}
}
'{
"code": 200,
"data": {
"task_id": "WEGGOG5CV8XNKEN5",
"status": "not_started",
"created_time": "2026-11-25T11:13:02"
}
}{
"detail": "prompt must contain 1-26000 characters"
}{
"detail": "prompt must contain 1-26000 characters"
}Kling
Kling 4.0 Flash 文生视频
Kling 4.0 Flash 文生视频 API 将最多 26,000 字符的提示词生成为 3–20 秒的 720p 视频,支持五种宽高比。
POST
/
api
/
generate
/
submit
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/text-to-video",
"input": {
"prompt": "Wildlife documentary tracking shot at blue hour in a snowy Hokkaido pine clearing: a wild red fox trots smoothly across deep untouched powder snow, leaving crisp paw prints, warm breath misting in the freezing air. Midway it pauses, ears pivoting sharply as a clump of snow slips off a dark cedar bough behind it. Natural twilight, steady lateral tracking camera, no cuts. Audio: soft crunching snow footsteps, gentle winter wind through pine needles. No text, no logos, no watermarks.",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}
}
'{
"code": 200,
"data": {
"task_id": "WEGGOG5CV8XNKEN5",
"status": "not_started",
"created_time": "2026-11-25T11:13:02"
}
}{
"detail": "prompt must contain 1-26000 characters"
}{
"detail": "prompt must contain 1-26000 characters"
}- 提交后会返回
task_id。如果提供了callback_url,当任务状态变为finished或failed时,系统会向callback_url发送 POST 请求。 - 无论是否提供
callback_url,都可以通过统一的查询任务状态接口获取结果。
模型
- kwaivgi/kling-v4.0-flash/text-to-video — Kling 4.0 Flash 文生视频,3–20 秒,720p。
功能
- 提示词最多 26,000 个字符,可详细描述动作、运镜、光线和声音。
- 时长可选 3 到 20 秒之间的任意整数秒。
- 五种宽高比:
auto、16:9、9:16、1:1、21:9。 - 一次生成 720p 视频。
必填参数
prompt(string):场景描述,去除首尾空白后 1–26,000 个字符。
可选参数
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 视频。
示例
注意事项
duration接收 3 到 20 的整数(或整数字符串)。model和callback_url放在请求根级,与input并列。input接收上文列出的字段,其他字段返回 400。- 积分在提交时预扣,按输出时长以 720p 费率计费。任务失败全额退还。当前费率见定价页。
请求体
application/json