跳到主要内容
AI
MarkdownLLMs.txt

Kling 视频生成

Kling 支持文生视频、图生视频、首尾帧和高级提示词控制。通过公共模型 ID 选择标准或 Pro 档,以及静音或带音频输出。

支持模型

模型档位音频
kling-v3-std-silent标准静音输出。
kling-v3-std-audio标准带音频输出。
kling-v3-pro-silentPro静音输出。
kling-v3-pro-audioPro带音频输出。

Endpoint

POST /v1/video/generations
GET /v1/videos/{task_id}

Authentication

Authorization: Bearer sk-***
Content-Type: application/json

请求参数

参数类型必填说明
modelstringKling v3 模型 ID。
promptstring主提示词。图生模式下不要与 extra_body.multi_prompt 同时传。
imagestring条件必填参考图 URL;如果存在 last_image,该字段表示首帧。
last_imagestring条件必填结束帧图 URL。
aspect_ratiostring16:99:161:1;图生模式不保证一定生效。
durationinteger来源范围为 315 秒。
extra_body.negative_promptstring不希望出现的内容。
extra_body.cfg_scalenumber提示词贴合强度,通常越高越贴近提示词。
extra_body.multi_promptarray高级图生模式的多镜头提示词列表。
extra_body.element_listarray元素参考列表。
extra_body.shot_typestringcustomizeintelligent

文生视频示例

curl -X POST "{BASE_URL}/v1/video/generations" \
-H "Authorization: Bearer sk-***" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-v3-std-silent",
"prompt": "A wide cinematic shot of a traveler walking through dusty desert ruins, cloak moving in the wind, slow pullback, natural motion.",
"aspect_ratio": "16:9",
"duration": 5,
"extra_body": {
"cfg_scale": 0.5,
"shot_type": "customize",
"negative_prompt": "blur, low detail"
}
}'

图生视频示例

curl -X POST "{BASE_URL}/v1/video/generations" \
-H "Authorization: Bearer sk-***" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-v3-pro-audio",
"prompt": "The person writes naturally in a notebook, subtle hand detail, small thoughtful pauses, soft classroom depth of field.",
"image": "https://example.com/start-frame.png",
"aspect_ratio": "16:9",
"duration": 6,
"extra_body": {
"cfg_scale": 0.6,
"shot_type": "intelligent",
"negative_prompt": "artifacts, distortion"
}
}'

首尾帧示例

curl -X POST "{BASE_URL}/v1/video/generations" \
-H "Authorization: Bearer sk-***" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-v3-pro-silent",
"prompt": "The portrait subject slowly turns toward the camera while keeping identity stable and motion natural.",
"image": "https://example.com/first-frame.png",
"last_image": "https://example.com/last-frame.png",
"duration": 8
}'

查询任务状态

curl "{BASE_URL}/v1/videos/task_xxx" \
-H "Authorization: Bearer sk-***"
{
"id": "task_xxx",
"task_id": "task_xxx",
"object": "video.generation.job",
"model": "kling-v3-pro-audio",
"status": "completed",
"progress": 100,
"video_url": "https://example.com/output.mp4"
}

计费说明

Kling 计费与模型档位、音频模式、输出秒数和生成模式有关。任务结算记录和当前产品价格是最终计费来源。

常见错误

  • 图生模式下同时传 promptextra_body.multi_prompt
  • 请求 315 以外的时长。
  • 认为图生模式一定遵循 aspect_ratio
  • 需要静音输出却使用带音频模型。
  • 传入私有媒体 URL。

相关页面