Video
Kling 4.0
用 Kling 4.0 从文本、关键帧或图片、视频和音频参考生成 3–30 秒带立体声的视频,也可以编辑或续写视频,720p 或 1080p 分辨率。
Kling 4.0(可灵 4.0)是快手于 2026 年 9 月发布的视频模型,是 Kling 3.0 的下一步。一个模型 ID 覆盖五种模式:文生视频、图生视频(最多 10 个关键帧)、用图片、视频和音频参考的参考生成、视频编辑和视频续写。每段视频 3–30 秒、720p 或 1080p 分辨率、带立体声。发送请求,保存返回的任务 ID,再从该任务读取生成完成的视频。媒体以 URL 形式传入。
模型 ID
| 模型 ID | 模式 | 分辨率 | 时长 |
|---|---|---|---|
kling-4-0 | 文本、图片、参考、编辑、续写 | 720p、1080p | 3–30 秒 |
当前价格请查看模型页面。
快速示例
curl https://api.seedrouter.ai/v1/videos/generations \
-H "Authorization: Bearer $SEEDROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-4-0",
"prompt": "A woman with a red umbrella walks down a neon-lit street on a rainy night, signs shimmering in the puddles, the camera tracking low beside her. No text, no logos.",
"resolution": "720p",
"duration": 5,
"aspect_ratio": "16:9"
}'端点
POST https://api.seedrouter.ai/v1/videos/generations| 请求头 | 值 |
|---|---|
| Authorization | Bearer YOUR_API_KEY |
| Content-Type | application/json |
响应是一个任务({"id": "task_...", "status": "processing"}),不是生成完成的视频。轮询 GET /v1/tasks/{task_id} 获取结果。保持 API Key 在服务端代码中。
参数
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
model | 字符串 | 必填 | kling-4-0 |
prompt | 字符串 | 必填 | 仅图生视频时为可选。用 @Image1、@Video1、@Audio1 提及参考,按各列表从 1 开始编号。 |
duration | 整数 | 5 | 3–30 秒。编辑:留空,输出跟随输入视频。续写:新部分的长度。 |
resolution | 枚举 | 720p | 720p 或 1080p。 |
aspect_ratio | 枚举 | 按模式 | 16:9、9:16、1:1、21:9;参考模式下仅 auto。默认:文本 16:9、图片用首帧的宽高比、参考 auto、编辑用输入视频的宽高比。续写时不接受。 |
image_urls | URL 列表 | 无 | 图生视频:最多 2 张,首帧和尾帧。参考(带 omni_reference_task_type: "reference")和编辑:最多 10 张参考图片。 |
image_with_roles | 对象列表 | 无 | {"url", "role"},role 为 first_frame、last_frame、keyframe(或 middle_frame)或 reference_image。恰好 1 个首帧,最多 8 个关键帧(按顺序使用),共 10 张。 |
first_frame_image | URL | 无 | 图生视频的首帧。 |
last_frame_image | URL | 无 | 图生视频的尾帧,或续写的目标尾帧。 |
video_urls | URL 列表 | 无 | 参考视频:最多 5 个,共用 30 秒。编辑或续写时用 video_url 代替。 |
video_url | URL | 无 | 编辑或续写的输入视频;需要 omni_reference_task_type 为 edit 或 extend。 |
audio_urls | URL 列表 | 无 | 参考音频:最多 3 个音频片段,各 5–30 秒。 |
omni_reference_task_type | 枚举 | auto | auto、reference、edit 或 extend。 |
audio_setting | 枚举 | 按模式 | origin 保持输入视频的音频,auto 重新生成。编辑默认保持;参考视频默认重新生成。续写时不接受。 |
每段视频都带立体声,没有音频开关。不支持 mode、negative_prompt、watermark 或多镜头字段。模式严格:未知字段会被拒绝而不是忽略。不支持 callback_url;改为轮询任务。
模式
模式由你发送的媒体和 omni_reference_task_type 决定:
| 模式 | 怎样选择 |
|---|---|
| 文生视频 | 无媒体。 |
| 图生视频 | 首帧,可选尾帧和关键帧。 |
| 参考 | video_urls、audio_urls 或 reference_image role,或 omni_reference_task_type: "reference"。 |
| 编辑 | omni_reference_task_type: "edit" 加一个输入视频。 |
| 续写 | omni_reference_task_type: "extend" 加一个输入视频。 |
一个请求不能既有帧也有参考视频或音频。参考视频或音频旁边,image_urls 仅在 omni_reference_task_type: "reference" 时作为参考图片读取;否则用 reference_image role。无 edit 或 extend 的 video_url 会被拒绝。
关键帧
{
"model": "kling-4-0",
"prompt": "A girl walks from the window to the door, then looks back and smiles",
"image_with_roles": [
{"url": "https://example.com/1.png", "role": "first_frame"},
{"url": "https://example.com/2.png", "role": "keyframe"},
{"url": "https://example.com/3.png", "role": "last_frame"}
],
"duration": 10
}参考
{
"model": "kling-4-0",
"prompt": "The woman from @Image1 walks along the beach with the camera movement of @Video1",
"image_with_roles": [{"url": "https://example.com/woman.png", "role": "reference_image"}],
"video_urls": ["https://example.com/camera.mp4"],
"aspect_ratio": "auto",
"duration": 5
}编辑
{
"model": "kling-4-0",
"prompt": "Change the scene to a snowy winter evening",
"omni_reference_task_type": "edit",
"video_url": "https://example.com/in.mp4"
}输入视频至少 3 秒;仅使用前 30 秒。不指定 duration 时,输出跟随输入视频长度。
续写
{
"model": "kling-4-0",
"prompt": "The camera keeps moving forward as the sky grows darker",
"omni_reference_task_type": "extend",
"video_url": "https://example.com/in.mp4",
"duration": 5
}续写从输入视频的尾帧继续,返回原视频加新部分。加 last_frame_image 选择续写的终点。
媒体输入
图片、视频和音频是公开的 HTTP(S) URL。不接受 base64 数据 URI:把文件上传到你自己的存储,再传它们的 URL。图片、视频和音频一共最多 15 个参考文件。
计费维度
查看模型价格部分获取当前费率。Kling 4.0 按视频秒数计费,费率由分辨率决定:
text, image, reference without videos: cost = duration × standard rate
extend: cost = new seconds × standard rate
edit, reference with videos: cost = (output + max(output, input)) × video-input rate输入 是输入视频的总长度,四舍五入到整秒且上限 30 秒。在请求被接受时测量,所以保留的金额就是最后扣费的金额。无法读取长度的视频在扣费前会被拒绝。例:编辑一个 5.2 秒的视频生成 3 秒结果,扣费 3 + 6 = 9 秒。失败的任务不收费。
输出格式
提交返回任务:
{"id": "task_...", "model": "kling-4-0", "status": "processing", "created_at": 1789689600}获取任务
GET https://api.seedrouter.ai/v1/tasks/{task_id}每 10–20 秒轮询一次,直到 status 为 completed 或 failed。轮询时网络超时不意味着生成失败:保存任务 ID 并继续检查。不要为了检查进度而创建新任务。
完成的任务
{
"id": "task_...",
"model": "kling-4-0",
"status": "completed",
"created_at": 1789689600,
"finished_at": 1789689800,
"output": {
"video_url": "https://static.seedrouter.ai/media/tasks/task_example/0.mp4"
}
}我们在 2026 年 10 月 22 日的测试中,3 秒 720p 视频返回 MP4(H.264)格式、1280 × 720 分辨率、立体声 AAC 音频,提交后 2 分 41 秒到 4 分 22 秒内返回。一个 5.2 秒的续写视频返回了 8.1 秒长。
错误
任务创建前被拒的请求返回 HTTP 错误和 error 对象,且不收费。任务接受后失败的返回 HTTP 200,status: "failed" 和 error 对象。
查看共享错误目录了解错误码、HTTP 状态和重试指导。
{
"id": "task_...",
"model": "kling-4-0",
"status": "failed",
"error": {
"code": 60001,
"message": "The request was rejected by the content policy. Please revise the prompt or input images."
}
}如果提交本身超时,检查你的任务后再重新提交:第一个请求可能已经被接受。
提示
- 描述主体、场景、摄像机运动、光线和声音;视频的音频会跟随提示词。
- 先用
720p出草稿,再用相同请求在1080p渲染最终成品。 - 给长视频加关键帧,让镜头按你的意图运动。
- 加上「no text, no logos」防止生成虚拟标记。
