1. 快手可灵
星光API
  • 所有对话模型均兼容 OpenAI 格式
  • 聊天对话
    • ChatGPT(Chat)
      • 创建聊天函数调用
      • 创建视频, 带图片
      • 连续修改生成视频
      • 创建结构化输出
      • 控制推理模型努力程度
    • ChatGPT(Responses)
      • 创建模型响应
      • 创建函数调用
      • 创建模型响应(流式返回)
      • 创建模型响应 (控制思考长度)
      • 创建网络搜索
      • 创建模型响应 gpt-5启用思考
    • Gemini官方格式
      • 创建视频
      • GemIni原生接口格式
      • 图片生成
      • 文档理解
      • 视频理解
      • 音频理解
      • TTS 文本转语音
    • Claude官方格式
      • Chat兼容格式
      • 联网搜索
      • 创建格式化输出
      • 创建函数调用 (流式)
      • 创建思考聊天
      • PDF支持
      • PDF支持 base64格式
      • 创建聊天补全 (流式)
  • 绘画模型
    • 通用生图(推荐)
      • Generations通用文生图
      • Edits通用图像编辑&图生图
    • Gemini绘图
      • Generations
      • Gemini原生格式
      • 文生图text-to-image
      • 图生图image-to-image
    • 即梦绘画
      • 通用聊天格式
      • Gemini格式
    • GPT-Image
      • gpt-image-2 创建图像
      • gpt-image-2 图像编辑
    • Midjourney
      • 上传图片
      • 提交Imagine任务
      • 根据任务ID 查询任务状态
      • 根据ID列表查询任务
      • 获取任务图片的seed
      • 执行Action动作
      • 提交Blend任务
      • 提交Describe任务
      • 提交Modal
    • Flux绘图
      • 文生图
      • 图生图
  • 视频模型
    • 统一接口
      • 创建视频
      • 查询结果
    • Grok视频
      • 创建视频任务
      • 查询任务状态
    • 即梦Seedance2.0
      • 标准接口
        • 文生视频
        • 单图生视频
        • 首尾帧生视频
        • 多图参考模式
        • 全能参考模式
        • 视频编辑
        • 视频延长
        • 查询结果
        • 创建虚拟资源库
        • 查询素材结果
      • SD2特价
        • 创建视频任务
        • 查询结果
    • Veo视频
      • 计费说明
      • 使用说明和示例
      • 状态码说明和注意事项
      • 文生视频
      • 图生视频
      • 查询任务状态
      • 查询任务状态和结果地址
      • 下载视频
    • RunWay视频
      • [推荐]统一任务格式
        • 文生视频
        • 图生视频
        • 视频生视频
        • 查询任务结果
      • 官方格式
        • 图生视频
        • 视频生视频
        • 查询任务结果
    • 快手可灵
      • 使用说明,必看!!
      • 文生视频
        POST
      • 单图生视频
        POST
      • 多图生视频
        POST
      • 首尾帧
        POST
      • 动作控制(Kling-2.6 专用)
        POST
      • 数字人
        POST
      • 对口型
        POST
      • 参考视频高级透传(file_infos)
        POST
      • 动作控制 + file_infos
        POST
      • ExtInfo 多镜头(Kling-3.0 高级)
        POST
      • 查询结果
        GET
  • 音频模型
    • Suno音乐
      • 生成音乐
      • 生成歌词
      • 查询单个任务[歌曲]
      • 查询单个任务[歌词]
      • 批量查询任务
    • MiniMax音频
      • 音乐生成
        • 音乐生成
        • 歌词生成
      • 语音合成
        • 语音接口说明
        • 音频复刻注意事项
        • 同步语音合成
        • 上传复刻音频
        • 音色快速复刻
        • 查询可用音色
    • 谷歌Lyria3
      • Google原生格式
  • 热门应用对接
    • Claude Code 安装使用教程
    • CodeX安装配置教程(Linux)
  • 平台API
    • 文件上传
  1. 快手可灵

使用说明,必看!!

Kling 视频生成 API#

通过网关调用 Kling 系列视频能力,协议兼容 OpenAI Video 风格。

1. 接口一览#

说明方法路径
创建视频任务POST{站点根}/v1/videos
查询任务状态GET{站点根}/v1/videos/{task_id}
获取视频内容GET{站点根}/v1/videos/{task_id}/content

2. 可用模型#

请求时 model 使用以下模型名(大小写不敏感):

2.1 生成模型(8 个)#

模型名说明
kling-1.01.0 普通文生/图生
kling-1.51.5 普通文生/图生
kling-2.02.0 普通文生/图生
kling-2.12.1 普通文生/图生
kling-2.52.5 普通文生/图生、无声/有声、动作控制
kling-3.03.0 无声/有声
kling-3.0-omni3.0 Omni,支持有/无参考
kling-o1O1 普通文生/图生

2.2 专用模型(3 个)#

可直接作为 model 传入,用于特定场景:
模型名说明
kling-identify-face对口型(也可通过 scene_type: lip_sync 自动映射)
kling-avatar-720p数字人 720P(也可通过 scene_type: avatar_i2v 自动映射)
kling-avatar-1080p数字人 1080P

3. 创建任务 POST /v1/videos#

3.1 请求体字段#

顶层字段#

字段类型必填说明
modelstring是模型别名,见上表
promptstring多数场景必填文本提示词
secondsstring否视频时长(秒),如 "5"、"10"
durationnumber / string否时长(秒);与 seconds 同时存在时 seconds 优先
sizestring否尺寸快捷写法,如 720x1280、720P、1080P
imagestring否单张参考图 URL
imagesstring[]否多张参考图 URL,最多 3 张
input_referencestring否参考图 URL(与 image 类似)
modestring否动作控制时可传 pro 表示 Pro 档位
contentarray否OpenAI 风格多模态内容,见 3.3
metadataobject否扩展参数,见 3.2
时长优先级:
seconds(顶层) > duration(顶层) > metadata.seconds / metadata.duration / metadata.video_duration > 默认 5 秒
文生 / 图生判定:
存在 image / images / input_reference / metadata.last_frame_* / 参考视频等 → 图生
否则 → 文生

metadata 字段#

字段类型说明
scene_typestring场景类型,见 4.1 scene_type
motion_levelstring动作控制档位:std / pro,见 4.2 motion_level
video_urlstring参考视频 URL(动作控制必填;Omni 参考也可使用)
last_frame_urlstring尾帧图片 URL(首尾帧场景)
last_frame_file_idstring尾帧文件 ID
file_infosarray结构化文件输入,见 3.4
ext_infostring高级扩展 JSON 字符串(如多镜头),见 3.5
output_configobject输出配置,见 3.6
resolutionstring分辨率快捷字段(等价于 output_config.resolution)
audio_generationstring顶层有声开关(等价于 output_config.audio_generation)
audiobooleantrue 表示开启有声

metadata.output_config 字段#

字段类型说明
durationnumber输出时长(秒),建议与顶层 seconds 保持一致
resolutionstring分辨率:720P / 1080P,见 4.3 resolution
aspect_ratiostring宽高比,见 4.4 aspect_ratio
audio_generationstring有声开关:Enabled / Disabled,见 4.5 audio_generation
storage_modestringPermanent / Temporary
media_namestring输出媒体名称,最长 64 字符
class_idinteger分类 ID
expire_timestring过期时间,ISO 8601
person_generationstringAllowAdult / Disallowed
input_compliance_checkstringEnabled / Disabled
output_compliance_checkstringEnabled / Disabled
enhance_switchstringEnabled / Disabled

Kling 模型约束(建议)#

参数Kling 支持
duration5 / 10 秒(默认 5)
resolution720P / 1080P(默认 720P)
aspect_ratio(文生)16:9 / 9:16 / 1:1(默认 16:9)

3.2 分辨率判定优先级#

1.
metadata.output_config.resolution
2.
metadata.resolution
3.
顶层 size(如 720x1280 → 720P + 9:16)
4.
均未传 → 默认 720P

3.3 content 数组(可选写法)#

与 prompt 二选一或同时使用;网关会从 type=text 条目提取文本。
字段说明
typetext / image_url / video_url 等
text文本内容(type=text 时)
image_url{ "url": "https://..." }

3.4 metadata.file_infos 条目#

最多 3 项。type=Url 时必须带 url;type=File 时必须带 file_id。
字段类型说明
typestringFile / Url
categorystringImage / Video
urlstring公网 URL(type=Url)
file_idstring文件 ID(type=File)
usagestring如 FirstFrame / Reference
reference_typestring视频参考类型:feature / base

3.5 metadata.ext_info(高级)#

类型必须为 string(JSON 字符串),不能传 object。
用于多镜头等扩展能力;与 kling-3.0 / kling-3.0-omni 配合使用。

4. 枚举说明#

4.1 scene_type#

值说明适用模型
(不传)普通文生/图生全部别名
motion_control动作控制(必须提供参考视频 metadata.video_url)kling-2.5
avatar_i2v数字人kling-1.0 ~ kling-2.5
lip_sync对口型(不足 5 秒按 5 秒计费)全部别名

4.2 motion_level#

值说明默认
std标准动作控制是
pro专业动作控制否
也可通过顶层 mode: "pro" 或 metadata.mode: "pro" 指定 Pro。

4.3 resolution#

值说明
720P720P 档位
1080P1080P 档位

4.4 aspect_ratio#

值典型用途
16:9横屏(文生默认)
9:16竖屏
1:1方形

4.5 audio_generation#

值说明默认
Enabled生成有声视频否
Disabled无声视频是
等价写法:metadata.audio: true 也表示有声。

4.6 任务状态 status(查询响应)#

值说明
queued / pending排队中
processing / in_progress生成中
completed成功
failed / cancelled失败

6. 请求示例#

6.1 文生视频(kling-2.5,720P)#

{
  "model": "kling-2.5",
  "prompt": "赛博朋克城市夜景,镜头缓慢推进,电影感",
  "seconds": "5",
  "metadata": {
    "output_config": {
      "duration": 5,
      "resolution": "720P",
      "aspect_ratio": "16:9"
    }
  }
}

6.2 文生视频 1080P(kling-3.0,无声)#

{
  "model": "kling-3.0",
  "prompt": "雪山之巅,雄鹰盘旋",
  "seconds": "10",
  "metadata": {
    "output_config": {
      "duration": 10,
      "resolution": "1080P",
      "aspect_ratio": "16:9",
      "audio_generation": "Disabled"
    }
  }
}

6.3 有声视频(kling-2.5)#

{
  "model": "kling-2.5",
  "prompt": "街头乐队演奏爵士乐,人群围观",
  "seconds": "10",
  "metadata": {
    "output_config": {
      "duration": 10,
      "resolution": "1080P",
      "aspect_ratio": "16:9",
      "audio_generation": "Enabled"
    }
  }
}

6.4 图生视频(单图)#

{
  "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"
    }
  }
}

6.5 多图参考(kling-3.0-omni)#

有参考计费需使用 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"
    }
  }
}

6.6 竖屏 9:16(size 写法)#

{
  "model": "kling-3.0-omni",
  "prompt": "角色在蓝色面板前缓慢转身",
  "seconds": "15",
  "size": "720x1280",
  "metadata": {
    "output_config": {
      "duration": 15,
      "resolution": "720P",
      "aspect_ratio": "9:16",
      "audio_generation": "Enabled"
    }
  }
}

6.7 首尾帧#

{
  "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"
    }
  }
}

6.8 动作控制 std(kling-2.5)#

必须提供公网可访问的参考视频 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"
    }
  }
}

6.9 动作控制 pro(kling-2.5)#

{
  "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"
    }
  }
}

6.10 数字人(avatar_i2v)#

{
  "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"
    }
  }
}

6.11 对口型(lip_sync)#

{
  "model": "kling-2.5",
  "prompt": "人物口型与音频同步",
  "image": "https://example.com/face.png",
  "seconds": "4",
  "metadata": {
    "scene_type": "lip_sync",
    "output_config": {
      "duration": 4
    }
  }
}

6.12 参考视频(file_infos)#

{
  "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"
    }
  }
}

6.13 多镜头扩展(kling-3.0 + ext_info)#

{
  "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}\"}"
  }
}

6.14 content 数组写法#

{
  "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"
    }
  }
}

7. 创建任务响应#

HTTP 200
{
  "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

8. 查询任务 GET /v1/videos/{task_id}#

8.1 排队中#

{
  "id": "task_uS28Df3npjkcVE8FfH9JQcvjWKxUgrsG",
  "task_id": "task_uS28Df3npjkcVE8FfH9JQcvjWKxUgrsG",
  "object": "video",
  "model": "kling-2.5-motion-std-720p",
  "status": "queued",
  "progress": 0,
  "created_at": 1780891541
}

8.2 生成中#

{
  "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
}

8.3 成功#

{
  "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"
}

8.4 失败#

{
  "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 无法访问"
  }
}

8.5 查询响应字段#

字段说明
id网关任务 ID
task_id任务标识(可能与 id 相同)
object固定 video
model实际计费档位
status任务状态
progress进度 0–100
created_at创建时间戳(秒)
completed_at完成时间戳(秒)
seconds视频时长
size输出尺寸描述
video_url视频地址(若返回)
error失败时的错误对象

9. 获取视频 GET /v1/videos/{task_id}/content#

任务 status 为 completed 后调用。
成功:返回视频二进制流(如 video/mp4)
失败:返回 JSON 错误信息

11. 调用示例(cURL)#

创建#

查询#

下载#


12. 常见问题#

问题说明
动作控制报错「视频 URL 无法访问」video_url 必须是公网 HTTPS 可下载地址
未传分辨率 / 有声默认 720P + 无声
未传时长默认按 5 秒 计费
对口型不足 5 秒仍按 5 秒 计费
图片 URL 无效仅支持 http(s) 链接,不支持 base64 data URI
file_infos 超限最多 3 项

13. 默认值速查#

参数未传时默认
分辨率720P
有声无声(Disabled)
动作档位std
Omni 参考无参考(noref)
时长5 秒
文生宽高比16:9
修改于 2026-06-08 06:52:49
上一页
查询任务结果
下一页
文生视频
Built with