| 说明 | 方法 | 路径 |
|---|---|---|
| 创建视频任务 | POST | {站 点根}/v1/videos |
| 查询任务状态 | GET | {站点根}/v1/videos/{task_id} |
| 获取视频内容 | GET | {站点根}/v1/videos/{task_id}/content |
model 使用以下模型名(大小写不敏感):| 模型名 | 说明 |
|---|---|
kling-1.0 | 1.0 普通文生/图生 |
kling-1.5 | 1.5 普通文生/图生 |
kling-2.0 | 2.0 普通文生/图生 |
kling-2.1 | 2.1 普通文生/图生 |
kling-2.5 | 2.5 普通文生/图生、无声/有声、动作控制 |
kling-3.0 | 3.0 无声/有声 |
kling-3.0-omni | 3.0 Omni,支持有/无参考 |
kling-o1 | O1 普通文生/图生 |
model 传入,用于特定场景:| 模型名 | 说明 |
|---|---|
kling-identify-face | 对口型(也可通过 scene_type: lip_sync 自动映射) |
kling-avatar-720p | 数字人 720P(也可通过 scene_type: avatar_i2v 自动映射) |
kling-avatar-1080p | 数字人 1080P |
POST /v1/videos| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 模型别名,见上表 |
prompt | string | 多数场景必填 | 文本提示词 |
seconds | string | 否 | 视频时长(秒),如 "5"、"10" |
duration | number / string | 否 | 时长(秒);与 seconds 同时存在时 seconds 优先 |
size | string | 否 | 尺寸快捷写法,如 720x1280、720P、1080P |
image | string | 否 | 单张参考图 URL |
images | string[] | 否 | 多张参考图 URL,最多 3 张 |
input_reference | string | 否 | 参考图 URL(与 image 类似) |
mode | string | 否 | 动作控制时可传 pro 表示 Pro 档位 |
content | array | 否 | OpenAI 风格多模态内容,见 3.3 |
metadata | object | 否 | 扩展参数,见 3.2 |
seconds(顶层) > duration(顶层) > metadata.seconds / metadata.duration / metadata.video_duration > 默认 5 秒image / images / input_reference / metadata.last_frame_* / 参考视频等 → 图生metadata 字段| 字段 | 类型 | 说明 |
|---|---|---|
scene_type | string | 场景类型,见 4.1 scene_type |
motion_level | string | 动作控制档位:std / pro,见 4.2 motion_level |
video_url | string | 参考视频 URL(动作控制必填;Omni 参考也可使用) |
last_frame_url | string | 尾帧图片 URL(首尾帧场景) |
last_frame_file_id | string | 尾帧文件 ID |
file_infos | array | 结构化文件输入,见 3.4 |
ext_info | string | 高级扩展 JSON 字符串(如多镜头),见 3.5 |
output_config | object | 输出配置,见 3.6 |
resolution | string | 分辨率快捷字段(等价于 output_config.resolution) |
audio_generation | string | 顶层有声开关(等价于 output_config.audio_generation) |
audio | boolean | true 表示开启有声 |
metadata.output_config 字段| 字段 | 类型 | 说明 |
|---|---|---|
duration | number | 输出时长(秒),建议与顶层 seconds 保持一致 |
resolution | string | 分辨率:720P / 1080P,见 4.3 resolution |
aspect_ratio | string | 宽高比,见 4.4 aspect_ratio |
audio_generation | string | 有声开关:Enabled / Disabled,见 4.5 audio_generation |
storage_mode | string | Permanent / Temporary |
media_name | string | 输出 媒体名称,最长 64 字符 |
class_id | integer | 分类 ID |
expire_time | string | 过期时间,ISO 8601 |
person_generation | string | AllowAdult / Disallowed |
input_compliance_check | string | Enabled / Disabled |
output_compliance_check | string | Enabled / Disabled |
enhance_switch | string | Enabled / Disabled |
| 参数 | Kling 支持 |
|---|---|
duration | 5 / 10 秒(默认 5) |
resolution | 720P / 1080P(默认 720P) |
aspect_ratio(文生) | 16:9 / 9:16 / 1:1(默认 16:9) |
metadata.output_config.resolutionmetadata.resolutionsize(如 720x1280 → 720P + 9:16)content 数组(可选写法)prompt 二选一或同时使用;网关会从 type=text 条目提取文本。| 字段 | 说明 |
|---|---|
type | text / image_url / video_url 等 |
text | 文本内容(type=text 时) |
image_url | { "url": "https://..." } |
metadata.file_infos 条目type=Url 时必须带 url;type=File 时必须带 file_id。| 字段 | 类型 | 说明 |
|---|---|---|
type | string | File / Url |
category | string | Image / Video |
url | string | 公网 URL(type=Url) |
file_id | string | 文件 ID(type=File) |
usage | string | 如 FirstFrame / Reference |
reference_type | string | 视频参考类型:feature / base |
metadata.ext_info(高级)kling-3.0 / kling-3.0-omni 配合使用。| 值 | 说明 | 适用模型 |
|---|---|---|
| (不传) | 普通文生/图生 | 全部别名 |
motion_control | 动作控制(必须提供参考视频 metadata.video_url) | kling-2.5 |
avatar_i2v | 数字人 | kling-1.0 ~ kling-2.5 |
lip_sync | 对口型(不足 5 秒按 5 秒计费) | 全部别名 |
| 值 | 说明 | 默认 |
|---|---|---|
std | 标准动作控制 | 是 |
pro | 专业动作控制 | 否 |
mode: "pro" 或 metadata.mode: "pro" 指定 Pro。| 值 | 说明 |
|---|---|
720P | 720P 档位 |
1080P | 1080P 档位 |
| 值 | 典型用途 |
|---|---|
16:9 | 横屏(文生默认) |
9:16 | 竖屏 |
1:1 | 方形 |
| 值 | 说明 | 默认 |
|---|---|---|
Enabled | 生成有声视频 | 否 |
Disabled | 无声视频 | 是 |
metadata.audio: true 也表示有声。status(查询响应)| 值 | 说明 |
|---|---|
queued / pending | 排队中 |
processing / in_progress | 生成中 |
completed | 成功 |
failed / cancelled | 失败 |
{
"model": "kling-2.5",
"prompt": "赛博朋克城市夜景,镜头缓慢推进,电影感",
"seconds": "5",
"metadata": {
"output_config": {
"duration": 5,
"resolution": "720P",
"aspect_ratio": "16:9"
}
}
}{
"model": "kling-3.0",
"prompt": "雪山之巅,雄鹰盘旋",
"seconds": "10",
"metadata": {
"output_config": {
"duration": 10,
"resolution": "1080P",
"aspect_ratio": "16:9",
"audio_generation": "Disabled"
}
}
}{
"model": "kling-2.5",
"prompt": "街头乐队演奏爵士乐,人群围观",
"seconds": "10",
"metadata": {
"output_config": {
"duration": 10,
"resolution": "1080P",
"aspect_ratio": "16:9",
"audio_generation": "Enabled"
}
}
}{
"model": "kling-2.5",
"prompt": "让人物向前走并微笑",
"image": "https://example.com/character.png",
"seconds": "5",
"metadata": {
"output_config": {
"duration": 5,
"resolution": "720P",
"aspect_ratio": "9:16",
"audio_generation": "Disabled"
}
}
}有参考计费需使用 images数组、metadata.video_url或metadata.file_infos;单张图请写入images: ["url"]而非仅顶层image。
{
"model": "kling-3.0-omni",
"prompt": "图1是角色,图2是场景,镜头从远到近",
"images": [
"https://example.com/role.png",
"https://example.com/scene.png"
],
"seconds": "15",
"metadata": {
"output_config": {
"duration": 15,
"resolution": "1080P",
"aspect_ratio": "9:16",
"audio_generation": "Enabled"
}
}
}{
"model": "kling-3.0-omni",
"prompt": "角色在蓝色面板前缓慢转身",
"seconds": "15",
"size": "720x1280",
"metadata": {
"output_config": {
"duration": 15,
"resolution": "720P",
"aspect_ratio": "9:16",
"audio_generation": "Enabled"
}
}
}{
"model": "kling-3.0",
"prompt": "从第一帧平滑过渡到最后一帧",
"image": "https://example.com/first.png",
"seconds": "8",
"metadata": {
"last_frame_url": "https://example.com/last.png",
"output_config": {
"duration": 8,
"resolution": "1080P",
"aspect_ratio": "16:9",
"audio_generation": "Enabled"
}
}
}必须提供公网可访问的参考视频 URL。
{
"model": "kling-2.6",
"prompt": "人物按参考视频动作运动",
"seconds": "5",
"metadata": {
"scene_type": "motion_control",
"motion_level": "std",
"video_url": "https://example.com/motion-ref.mp4",
"output_config": {
"duration": 5,
"resolution": "720P",
"aspect_ratio": "16:9"
}
}
}{
"model": "kling-2.6",
"prompt": "舞者复刻参考视频中的高难度动作",
"seconds": "10",
"metadata": {
"scene_type": "motion_control",
"motion_level": "pro",
"video_url": "https://example.com/dance-ref.mp4",
"output_config": {
"duration": 10,
"resolution": "1080P",
"aspect_ratio": "16:9"
}
}
}{
"model": "kling-2.5",
"prompt": "数字人播报今日新闻,表情自然",
"image": "https://example.com/avatar-face.png",
"seconds": "5",
"metadata": {
"scene_type": "avatar_i2v",
"output_config": {
"duration": 5,
"resolution": "720P",
"aspect_ratio": "9:16"
}
}
}{
"model": "kling-2.5",
"prompt": "人物口型与音频同步",
"image": "https://example.com/face.png",
"seconds": "4",
"metadata": {
"scene_type": "lip_sync",
"output_config": {
"duration": 4
}
}
}{
"model": "kling-3.0-omni",
"prompt": "基于参考视频生成同风格镜头",
"seconds": "5",
"metadata": {
"file_infos": [
{
"type": "Url",
"category": "Video",
"url": "https://example.com/ref-video.mp4",
"reference_type": "feature"
}
],
"output_config": {
"duration": 5,
"resolution": "720P",
"aspect_ratio": "16:9",
"audio_generation": "Disabled"
}
}
}{
"model": "kling-3.0",
"seconds": "5",
"metadata": {
"file_infos": [
{
"type": "Url",
"category": "Image",
"url": "https://example.com/ref-image.png"
}
],
"output_config": {
"duration": 5,
"resolution": "720P",
"aspect_ratio": "16:9",
"input_compliance_check": "Disabled"
},
"ext_info": "{\"AdditionalParameters\":\"{\\\"multi_prompt\\\":[{\\\"index\\\":1,\\\"prompt\\\":\\\"第一段描述\\\",\\\"duration\\\":\\\"2\\\"},{\\\"index\\\":2,\\\"prompt\\\":\\\"第二段描述\\\",\\\"duration\\\":\\\"3\\\"}],\\\"shot_type\\\":\\\"customize\\\",\\\"multi_shot\\\":true}\"}"
}
}{
"model": "kling-3.0-omni",
"seconds": "10",
"content": [
{
"type": "text",
"text": "角色在系统面板前缓慢转身"
}
],
"images": [
"https://example.com/ref.png"
],
"metadata": {
"output_config": {
"duration": 10,
"resolution": "720P",
"aspect_ratio": "9:16",
"audio_generation": "Enabled"
}
}
}{
"id": "task_uS28Df3npjkcVE8FfH9JQcvjWKxUgrsG",
"task_id": "task_uS28Df3npjkcVE8FfH9JQcvjWKxUgrsG",
"object": "video",
"model": "kling-2.5-motion-std-720p",
"status": "queued",
"progress": 0,
"created_at": 1780891541
}| 字段 | 说明 |
|---|---|
id | 任务 ID,后续查询与下载使用 |
task_id | 同 id 或兼容字段 |
model | 实际计费档位名称 |
status | 初始一般为 queued |
GET /v1/videos/{task_id}{
"id": "task_uS28Df3npjkcVE8FfH9JQcvjWKxUgrsG",
"task_id": "task_uS28Df3npjkcVE8FfH9JQcvjWKxUgrsG",
"object": "video",
"model": "kling-2.5-motion-std-720p",
"status": "queued",
"progress": 0,
"created_at": 1780891541
}{
"id": "task_uS28Df3npjkcVE8FfH9JQcvjWKxUgrsG",
"task_id": "task_xKFlPhfIcFR1dKWSr9akbE59umufNdju",
"object": "video",
"model": "kling-2.5-motion-std-720p",
"status": "in_progress",
"progress": 0,
"created_at": 1780891541,
"completed_at": 1780891544
}{
"id": "task_uS28Df3npjkcVE8FfH9JQcvjWKxUgrsG",
"task_id": "task_xKFlPhfIcFR1dKWSr9akbE59umufNdju",
"object": "video",
"model": "kling-3.0-omni-720p-noref-mute",
"status": "completed",
"progress": 100,
"seconds": "5",
"size": "720x1280",
"created_at": 1780891541,
"completed_at": 1780891600,
"video_url": "https://cdn.example.com/output/xxx.mp4"
}{
"id": "task_uS28Df3npjkcVE8FfH9JQcvjWKxUgrsG",
"task_id": "task_xKFlPhfIcFR1dKWSr9akbE59umufNdju",
"object": "video",
"model": "kling-2.5-motion-std-720p",
"status": "failed",
"progress": 100,
"created_at": 1780891541,
"completed_at": 1780891559,
"error": {
"code": "task_failed",
"message": "参数错误:参考视频 URL 无法访问"
}
}| 字段 | 说明 |
|---|---|
id | 网关任务 ID |
task_id | 任务标识(可能与 id 相同) |
object | 固定 video |
model | 实际计费档位 |
status | 任务状态 |
progress | 进度 0–100 |
created_at | 创建时间戳(秒) |
completed_at | 完成时间戳(秒) |
seconds | 视频时长 |
size | 输出尺寸描述 |
video_url | 视频地址(若返回) |
error | 失败时的错误对象 |
GET /v1/videos/{task_id}/contentstatus 为 completed 后调用。video/mp4)| 问题 | 说明 |
|---|---|
| 动作控制报错「视频 URL 无法访问」 | video_url 必须是公网 HTTPS 可下载地址 |
| 未传分辨率 / 有声 | 默认 720P + 无声 |
| 未传时长 | 默认按 5 秒 计费 |
| 对口型不足 5 秒 | 仍按 5 秒 计费 |
| 图片 URL 无效 | 仅支持 http(s) 链接,不支持 base64 data URI |
file_infos 超限 | 最多 3 项 |
| 参数 | 未传时默认 |
|---|---|
| 分辨率 | 720P |
| 有声 | 无声(Disabled) |
| 动作档位 | std |
| Omni 参考 | 无参考(noref) |
| 时长 | 5 秒 |
| 文生宽高比 | 16:9 |