curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "kwaivgi/kling-image-v4.0/text-to-image",
"input": {
"prompt": "High fashion model wearing a dress made of living moss, standing in an abandoned greenhouse, shafts of light, editorial photography",
"size": "16:9",
"resolution": "4K"
}
}
'
{
"code": 200,
"data": {
"task_id": "task-example-001",
"status": "not_started",
"created_time": "2026-11-19T10:30:00"
}
}{
"detail": "prompt is required"
}{
"detail": "prompt is required"
}Kling
Kling Image 4.0 文生图
Kling Image 4.0 文生图 API 根据提示词生成 1–9 张图片或 2–10 张连贯组图,支持 2K、4K 和原生 8K 分辨率。
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-image-v4.0/text-to-image",
"input": {
"prompt": "High fashion model wearing a dress made of living moss, standing in an abandoned greenhouse, shafts of light, editorial photography",
"size": "16:9",
"resolution": "4K"
}
}
'
{
"code": 200,
"data": {
"task_id": "task-example-001",
"status": "not_started",
"created_time": "2026-11-19T10:30:00"
}
}{
"detail": "prompt is required"
}{
"detail": "prompt is required"
}- 提交后会返回
task_id。如果提供了callback_url,当任务状态变为finished或failed时,系统会向callback_url发送 POST 请求。 - 无论是否提供
callback_url,都可以通过统一的查询任务状态接口获取结果。
模型
- kwaivgi/kling-image-v4.0/text-to-image — Kling Image 4.0 文生图,每次 1–9 张图片或 2–10 张组图。
功能
- 原生 2K、4K、8K 输出。
- 每次请求最多 9 张独立图片。
- 连贯组图(
enable_sequential):2–10 张主体和风格一致的图片,按顺序返回。 - 9 种宽高比,或用
auto由模型选择。
必填参数
prompt(string):图片描述。1–50,000 个字符的文本。
可选参数
size(string):auto、16:9、9:16、1:1、4:3、3:4、3:2、2:3或21:9。默认auto,根据提示词自动选择宽高比。resolution(string):2K、4K或8K。默认2K。enable_sequential(boolean):为true时生成n张主体和风格一致的连贯组图。默认false。n(integer):图片数量。enable_sequential为false时为 1–9(默认 1),为true时为 2–10(默认 4)。
分辨率
resolution | 尺寸示例 |
|---|---|
2K | 1:1 下为 2048x2048 |
4K | 16:9 下为 5440x3072 |
8K | 1:1 下为 8192x8192 |
示例
- 一张 4K 图片:
16:9、4K的时尚大片。 - 多张独立图片:用
n: 3生成同一产品图的三个版本。 - 连贯组图:
enable_sequential: true、n: 4生成四格水彩故事。
注意事项
n取值 1–9(enable_sequential: true时为 2–10),resolution取值2K、4K、8K,其他值返回 400。使用参考图请用 Kling Image 4.0 图像编辑。enable_sequential: true时由模型决定组图的最终构成,偶尔返回的图片少于n张。model和callback_url放在请求根级,与input并列。input接收上文列出的字段,其他字段返回 400。- 积分取决于
resolution和图片数量(n)。组图实际返回的图片少于n时,任务完成后退还缺少图片的积分。任务失败会全额退还。当前费率见定价页。
请求体
application/json