可灵视频与生图 API
可灵在 Essevin 上的严格请求契约,覆盖视频、生图、动作控制、数字人和对口型。
Essevin 上的可灵是异步接口:先提交任务,再轮询 Essevin 任务 ID。请使用可灵分组的密钥,正式产生付费任务前先用 GET /v1/models 确认当前密钥实际返回的完整模型 ID。
接口
| 方法 | 路径 | 用途 |
|---|---|---|
| POST | /v1/images/generations | 提交可灵生图或扩图任务 |
| POST | /v1/kling/faces | 对口型前置人脸识别,按次计费 |
| POST / GET | /v1/kling/subjects | 创建 / 查询自定义主体 |
所有请求使用 Authorization: Bearer sk-你的密钥 和 Content-Type: application/json。请求体采用严格 JSON 契约:只接受下表列出的字段。任何未列出的字段——包括 OpenAI 习惯带的 size、response_format、user,视频请求里的 n,以及顶层 image_url / video_url——嵌套对象里的未知字段,或者跟在请求体后面的第二个 JSON 值,都会在任务创建前返回 400,不计费。视频画面请用 resolution 与 aspect_ratio 指定。
| 接口 | 可接受字段 |
|---|---|
↳ images[] 每项 | url、file_id、usage |
↳ videos[] 每项 | url、file_id、reference_type、keep_original_sound |
↳ subjects[] 每项 | id、name |
↳ shots | mode、segments(每段 index、prompt、duration) |
POST /v1/images/generations | model、prompt、quality、n、images(每项 url、file_id)、extra |
POST /v1/kling/faces | videos(每项 url、file_id) |
POST /v1/kling/subjects | name、description、reference_type、frontal_image_url、reference_image_urls、video_url、voice_id、tag_ids |
带了 size 时的原样报错(人脸识别接口相同):
{
"error": {
"message": "request body does not match the JSON contract: json: unknown field \"size\"",
"type": "invalid_request_error"
}
}模型矩阵
| 模型 ID | 时长 | 参考图 | 参考视频 | 主体 | 分镜 | 说明 |
|---|---|---|---|---|---|---|
kling-v3-turbo | 3-15 秒 | 不支持 | 不支持 | 支持 | 不支持 | 官方固定 Voice 价格档,调用方不能指定音色 |
kling-v3-omni | 3-15 秒 | 最多 7 张(还受主体/视频合计限制) | feature | 支持 | 支持 | base 未定价;4K 无声 feature 未定价 |
kling-v3 | 3-15 秒 | 最多 6 张 | 不支持 | 支持 | 支持 | 普通生成和参考图 |
kling-o1 | 3-10 秒 | 最多 4 张 | feature | 不支持 | 不支持 | 没有参考生输入时只支持 5 或 10 秒 |
kling-v2-6 | 仅 5 或 10 秒 | 最多 4 张 | 不支持 | 不支持 | 不支持 | 有声 720P 未定价 |
kling-v2-5-turbo | 5-10 秒 | 最多 3 张 | 不支持 | 不支持 | 不支持 | 只开放 720P / 1080P |
kling-v2-1、kling-v2-0 | 5-10 秒 | 不支持 | 不支持 | 不支持 | 不支持 | 普通文生视频 |
kling-v1-6 | 5-10 秒 | 不支持 | base | 不支持 | 不支持 | 待编辑视频使用 multi_elements 桶 |
kling-v3-motion-control | 输入素材时长 | 1 图 + 1 视频 | 场景确定 | 不支持 | 不支持 | 720P / 1080P / 2K / 4K |
kling-v2-6-motion-control | 输入素材时长 | 1 图 + 1 视频 | 场景确定 | 不支持 | 不支持 | 720P / 1080P |
kling-avatar | 输入音频时长 | 1-5 张 | 不支持 | 不支持 | 不支持 | sound_file 与 audio_id 二选一 |
kling-lip-sync | 输入素材时长 | 不支持 | 不支持 | 不支持 | 不支持 | session_id + 恰好一个 face_choose 项 |
模型矩阵里的“参考图”只统计 usage: reference,不包含首尾帧;不得把它当成所有 images[] 的总数。v3 Omni 的模型配置上限虽为 8,但接口同时要求无参考视频时“参考图 + 主体 ≤ 7”、有参考视频时 ≤ 4,所以只传参考图时实际最多 7 张;其他型号还要取各自更小的上限。
可灵生图模型 ID 包括 kling-image-v3、kling-image-v3-omni、kling-image-o1、kling-image-v2-1、kling-image-v2-1-i2i、kling-image-v2-1-multi-ref 和 kling-image-expand。生图走图片接口,n 支持 1-9,按实际产出张数计费;可用画质档以当前密钥的模型目录为准。
请求契约
素材定位
每个 images[] 或 videos[] 项必须且只能提供以下一个字段:
{ "url": "https://cdn.example.com/file.png" }或:
{ "file_id": "your-file-id" }url 必须是公网可访问的绝对 http:// 或 https:// 地址。空字符串、相对路径、file://、ftp://、指向内网 / 回环 / 链路本地的地址、带认证信息的 URL 以及同时提供两个字段都会被提交时同步拒绝。图片接口、人脸识别与数字人的 extra.sound_file 也遵循同一规则。
不合规素材会在提交数分钟后才失败
网关只做请求结构与数量校验,素材的分辨率、格式、大小、时长等内容限制由官方在任务执行时异步校验——不合规的素材会在提交数分钟后以任务失败告终。提交前请确认素材可被公网稳定下载,并符合可灵官方对图片 / 视频 / 音频的规格要求。
普通视频生成
普通视频使用 images[] 传首尾帧或参考图,使用 videos[] 传一个参考 / 编辑视频。不要在顶层使用 OpenAI 的 image_url 或 video_url 字段。
{
"model": "kling-v3-omni",
"prompt": "<<<element_1>>> 和 <<<element_2>>> 在干净的摄影棚桌面上缓慢旋转",
"duration": 5,
"resolution": "1080p",
"audio": false,
"images": [
{ "url": "https://cdn.example.com/first.png", "usage": "first_frame" },
{ "file_id": "last-frame-file-id", "usage": "last_frame" },
{ "url": "https://cdn.example.com/reference-a.png", "usage": "reference" },
{ "file_id": "reference-b-file-id", "usage": "reference" }
],
"videos": [
{
"url": "https://cdn.example.com/character-motion.mp4",
"reference_type": "feature",
"keep_original_sound": false
}
],
"subjects": [
{ "id": "subject-92951593344", "name": "猫" },
{ "id": "subject-92951593345", "name": "狗" }
]
}普通生成的 images[].usage 必填,可选 first_frame、last_frame、reference。首帧和尾帧各最多一张;指定尾帧必须同时提供首帧;参考图超过两张时不能再指定尾帧;kling-v2-1 同时提供首尾帧时 resolution 只能为 1080p。videos[] 最多一项,且 reference_type 必填。feature 仅 kling-v3-omni 和 kling-o1 开放;base 仅已实测且有价的 kling-v1-6 开放,必须是唯一素材,不能和图片或主体混用。
官方还有两条数量耦合限制:有参考视频时,reference 图数 + 主体数最多 4;无参考视频时最多 7。没有提示词时必须至少有一个素材。aspect_ratio 仅可为 16:9、9:16、1:1,省略时不由网关代填。省略 duration、resolution、audio 会统一归一化为 5 秒、720P、无声;但 kling-v2-6 只接受 5 或 10 秒。
普通视频模型(上表中除动作控制、数字人、对口型以外的型号)不接受任何 extra 键,传了就返回 400,请改用本页的结构化字段。
分辨率与声音
resolution 可选 720p、1080p、2k、4k(不区分大小写),audio 为布尔值。下表之外的组合在提交时返回 400:model "<模型 ID>" does not support billing bucket "<档位>" for this request。
| 模型 ID | 可选分辨率 | 声音 |
|---|---|---|
kling-v3-turbo | 720p / 1080p / 2k / 4k | 只有一个价格档,audio 不影响计价 |
kling-v3-omni | 720p / 1080p / 2k / 4k;带 feature 参考视频时为 720p / 1080p / 2k | 有声 / 无声;带参考视频时只能无声 |
kling-v3 | 720p / 1080p / 2k / 4k | 有声 / 无声 |
kling-o1 | 720p / 1080p / 2k / 4k | 只能无声 |
kling-v2-6 | 720p / 1080p / 2k / 4k;有声时 1080p 起 | 有声 / 无声 |
kling-v2-5-turbo | 720p / 1080p | 只能无声 |
kling-v2-1、kling-v2-0 | 720p / 1080p / 2k / 4k | 只能无声 |
kling-v1-6 | 720p / 1080p / 2k / 4k | 只能无声;base 视频编辑不看 audio |
kling-v3-motion-control | 720p / 1080p / 2k / 4k | 不生成声音 |
kling-v2-6-motion-control | 720p / 1080p | 不生成声音 |
kling-avatar | 720p / 1080p | 来自输入音频 |
kling-lip-sync | 不影响计价 | 来自输入音频 |
主体与分镜
subjects[] 使用官方固定主体 ID,每项必须有非空 id,name 可选。只有 kling-v3-turbo、kling-v3、kling-v3-omni 支持主体。对 kling-v3,只要提供主体,官方还要求 images[] 至少有一项且 usage: "reference"。主体按数组位置绑定:subjects[0] 对应 <<<element_1>>>,subjects[1] 对应 <<<element_2>>>,依此类推。每个已提供主体都必须在 Prompt 中被引用;Prompt 也不能引用不存在的 <<<element_N>>>。
分镜仅 kling-v3 和 kling-v3-omni 支持:
{
"model": "kling-v3-omni",
"prompt": "两段式产品展示短片",
"duration": 5,
"shots": {
"mode": "customize",
"segments": [
{ "index": 1, "prompt": "盒子打开", "duration": 2 },
{ "index": 2, "prompt": "产品出现", "duration": 3 }
]
}
}mode 可取 intelligence 或 customize。智能模式不能带 segments,自定义模式必须带分镜。自定义分镜最多 6 段,从 1 开始连续编号,提示词不能为空且不超过 512 字,每段至少 1 秒,时长之和必须严格等于总时长。请使用结构化 shots,extra.multi_shot、extra.shot_type、extra.multi_prompt 会被拒绝。
动作控制
动作控制必须提供恰好一个视频和一张人物图,场景决定两者含义,因此图片不能带 usage,视频不能带 reference_type。videos[].keep_original_sound 是布尔值,对应官方的 keep_original_sound 标记。目前唯一验证过的额外参数是 extra.character_orientation(image 或 video)。动作控制时长由输入视频决定,必须省略 duration,产物使用临时存储。
{
"model": "kling-v3-motion-control",
"prompt": "跟随舞者的动作",
"resolution": "1080p",
"images": [{ "file_id": "person-image-file-id" }],
"videos": [{ "url": "https://cdn.example.com/dance.mp4", "keep_original_sound": true }],
"extra": { "character_orientation": "video" }
}数字人与对口型
数字人(kling-avatar)需要 1-5 张人物图,不接受视频,并且必须在 extra.sound_file(HTTP(S) 音频地址)和 extra.audio_id 中二选一。时长由输入音频决定,省略 duration。
对口型(kling-lip-sync)不接受图片。先用一个或多个素材调用人脸识别:
curl https://api.essevin.com/v1/kling/faces \
-H "Authorization: Bearer sk-你的密钥" \
-H "Content-Type: application/json" \
-d '{"videos":[{"file_id":"source-video-file-id"}]}'人脸识别的请求体只接受 videos 数组,每项 url / file_id 二选一,规则与上文素材定位相同。JSON 不合法或带了其他字段返回 400 request body does not match the JSON contract: …;缺少 videos 或数组为空返回 400 videos is required and must contain at least one item。
再提交返回的 session 和一个 face_choose 项:
{
"model": "kling-lip-sync",
"extra": {
"session_id": "face-session-id",
"face_choose": [
{ "face_id": "face-1", "sound_file": "https://cdn.example.com/voice.mp3" }
]
}
}face_choose 必须恰好一项,且包含非空 face_id 与 sound_file。输入音频 / 视频决定时长。官方确认对应 SKU 前,voice_ids 和 extra.voice_list 均不可用。
对口型最低按 5 秒计费
对口型按秒计费并有 5 秒下限,4 秒成片按 5 秒收费。
自定义主体
| 字段 | 规则 |
|---|---|
name | 必填,最多 20 个字符 |
description | 选填,最多 100 个字符 |
reference_type | 必填,image_refer 或 video_refer |
frontal_image_url | image_refer 必填,正面图地址 |
reference_image_urls | image_refer 必填,1–3 个地址,不能与正面图重复,彼此也不能重复 |
video_url | video_refer 必填;image_refer 不能带 |
voice_id | 只能与 video_refer 一起使用 |
tag_ids | 选填,每项非空且不重复 |
video_refer 不能带任何图片字段。所有地址都必须是公网可访问的 http(s) 绝对地址,规则与素材定位相同。
提交与轮询
-H "Authorization: Bearer sk-你的密钥" \
-H "Content-Type: application/json" \
-d '{"model":"kling-v3","prompt":"红球在白桌面上滚动","duration":5,"resolution":"720p"}'提交成功返回 202,任务 ID 在 id 字段,形如 kt57x<task-id>。可灵生图(POST /v1/images/generations)同样是异步接口,也返回 202 与同样形态的 id。两者查询方式相同,不要在查询时传计费标头:
-H "Authorization: Bearer sk-你的密钥"status 依次经过 queued → processing → completed 或 failed,只有后两者是终态,其他任何值都按进行中处理。完成后从 outputs 取地址,地址在 console.essevin.com 域名下,是自任务完成起 6 小时有效的签名链接;再次查询返回同一地址、不会续期,过期访问返回 410,请在 6 小时内下载保存。只有成功完成的任务才计费,失败的任务不计费。
余额预留只作用于视频提交,生图没有
提交可灵视频任务时按「可用余额 − 进行中任务的预估费用 − 本次预估费用」判断,不足返回 402,code 为 insufficient_balance;任务结束后预估自动释放。对口型(kling-lip-sync)无法提前估算,不做预留。可灵生图同样不做预留,只在余额小于等于 0 时才会被拦截。可灵任务(含生图)创建 2 小时后仍未结束即判为失败、不计费;任务不支持取消,其余通用规则见视频生成。
可灵生图输入与输出
POST /v1/images/generations 只接收以下 JSON 字段;全部生图型号都走异步流程。表外字段(如 size、aspect_ratio、image、mask、response_format、style、user)一律返回 400,报错格式见上文。
| 字段 / 类型 | 规则 |
|---|---|
model · string | 必填,使用模型矩阵中的生图 ID |
prompt · string | 提示词;与非空 images 至少提供一个 |
quality · string | 默认 1k;可选 1k / 2k / 4k,须该模型在当前目录中支持 |
n · integer | 默认 1,范围 1–9 |
images · array | 每项 url / file_id 二选一,不能有 usage |
extra · object | 仅扩图可用,下述四个扩展比例 |
各型号可选的 quality 与参考图数量:
| 模型 ID | quality | 参考图 |
|---|---|---|
kling-image-v3 | 1k / 2k | 0–1 张 |
kling-image-v3-omni、kling-image-o1 | 1k / 2k / 4k | 0–10 张 |
kling-image-v2-1 | 1k / 2k | 不接受 |
kling-image-v2-1-i2i | 1k / 2k | 恰好 1 张 |
kling-image-v2-1-multi-ref | 1k / 2k | 2–4 张 |
kling-image-expand | 1k | 恰好 1 张 |
生图提交阶段的 400 报错如下,每条以 # 开头的行是触发条件,下一行是 error.message 原文:
# 出现表外字段
request body does not match the JSON contract: json: unknown field "<字段名>"
# prompt 与 images 都为空
prompt and input images cannot both be empty
# images[] 某项 url / file_id 都没有或都有
images[<序号>] must provide exactly one of url or file_id
# url 不是公网 http(s) 绝对地址
images[<序号>].url must be a publicly accessible absolute http(s) URL
# images[] 带了 usage
images[<序号>].usage is not part of the image generation API; remove this field
# kling-image-v2-1 带了图片
model "kling-image-v2-1" is a text-to-image model and does not accept input images
# kling-image-v2-1-i2i 不是 1 张图
model "kling-image-v2-1-i2i" requires exactly 1 input image
# kling-image-v2-1-multi-ref 不是 2–4 张图
model "kling-image-v2-1-multi-ref" requires 2 to 4 input images
# 扩图不是 1 张图
image expansion requires exactly 1 input image
# 扩图 extra 含四个比例以外的键
extra.<键> is not a verified parameter of the image expansion API
# 扩图比例不是 0–2 的数字
extra.<键> must be a number between 0 and 2
# 四个比例全为 0
the four expansion ratios cannot all be 0
# 扩图后面积超过原图 3 倍
expanded area cannot exceed 3x the original image
# 非扩图型号带了 extra
model "<模型 ID>" does not accept unverified extra parameters
# 该型号没有这个 quality 档
model "<模型 ID>" does not support quality tier "<值>"
# n 不在 1–9
n must be between 1 and 9, got <值>
# 参考图超过型号上限
model "<模型 ID>" accepts at most <上限> input images, got <张数>文生图请求体(其他型号替换 model,并按其限制传参):
{
"model": "kling-image-v3",
"prompt": "A ceramic teapot on a sunlit table",
"quality": "1k",
"n": 1
}扩图请求体;四个比例均为 0–2 的数字,省略为 0,不能全为 0,且 (1+左+右) × (1+上+下) ≤ 3:
{
"model": "kling-image-expand",
"images": [
{
"url": "https://example.com/input.png"
}
],
"extra": {
"left_expansion_ratio": 0.5,
"right_expansion_ratio": 0.5,
"up_expansion_ratio": 0,
"down_expansion_ratio": 0
}
}提交返回 HTTP 202,读取顶层 id:
{
"id": "ktEXAMPLE",
"object": "image.generation.task",
"status": "queued",
"model": "kling-image-v3",
"requested_images": 1
}{
"id": "ktEXAMPLE",
"status": "completed",
"outputs": [
"https://api.essevin.com/example-signed-image.png"
]
}{
"id": "ktEXAMPLE",
"status": "failed",
"error": {
"code": "timeout",
"message": "task did not reach a billable terminal state within 2 hours; polling stopped"
}
}失败情况
提交时
提交阶段出错不会创建任务,也不计费。所有错误都在 error.message 里说明原因。
| HTTP | 情况 | 处理 |
|---|---|---|
| 400 | 字段、取值或组合不合法,type 为 invalid_request_error | 按报错修改后重新提交 |
| 400 | 把生图模型发到视频接口:model "<模型 ID>" is an image model; use /v1/images/generations | 改用生图接口 |
| 402 | 视频余额预留不足,code 为 insufficient_balance | 充值,或等进行中的任务结束 |
| 404 | 模型 ID 不在目录:视频为 model "<模型 ID>" is not in the Kling catalog,生图为 model "<模型 ID>" is not an image model in this catalog | 用 GET /v1/models 核对 ID |
| 429 / 5xx | 服务繁忙或暂时不可用 | 稍后重试 |
视频提交的 400 报错如下,每条以 # 开头的行是触发条件,下一行是 error.message 原文;<模型 ID> 是模型 ID,例如 kling-v3:
# 没有 prompt 也没有任何素材(对口型除外)
prompt and input media cannot both be empty
# duration 为负数
duration cannot be negative
# 时长由素材决定的型号传了 duration(动作控制、数字人、对口型)
duration of model <模型 ID> is determined by the input media; do not pass duration
# duration 超出型号范围
model <模型 ID> supports <下限> to <上限> seconds, got <值>
# kling-o1 没有参考生输入时 duration 不是 5 或 10
Kling O1 without reference media only supports duration 5 or 10 seconds
# kling-v2-6 的 duration 不是 5 或 10
model kling-v2-6 only supports a duration of 5 or 10 seconds, got <值>
# aspect_ratio 不在 16:9 / 9:16 / 1:1 之内
aspect_ratio="<值>" is invalid; allowed values: 16:9 / 9:16 / 1:1
# voice_ids 非空(报错以此开头)
voice_ids is not available yet
# extra 含该型号不接受的键
extra.<键> is not in the verified parameter contract of model <模型 ID>
# extra 里写了分镜、主体、音色或原声参数(请改用结构化字段)
extra.<键> cannot be passed through; use the structured shots parameter
extra.element_list cannot be passed through; use the structured subjects parameter
extra.voice_list is reserved; use voice_ids instead (voice selection is not available yet)
extra.keep_original_sound cannot be passed through; use videos[].keep_original_sound
# 素材 url / file_id 都没有或都有;url 不是公网 http(s) 绝对地址
<images 或 videos>[<序号>] must provide exactly one of url or file_id
<images 或 videos>[<序号>].url must be a publicly accessible absolute http(s) URL
# usage / reference_type 取值不合法
images[<序号>].usage="<值>" is invalid; allowed values: first_frame / last_frame / reference
videos[<序号>].reference_type="<值>" is invalid; allowed values: feature / base
# 普通生成缺少 usage / reference_type,或视频多于 1 个
images[<序号>].usage is required for standard Kling video requests
videos[0].reference_type is required for standard Kling video requests; allowed values: feature / base
standard Kling video requests accept at most 1 videos input
# 首尾帧规则
at most 1 first-frame image is allowed
at most 1 last-frame image is allowed
a last frame requires a first frame with usage=first_frame
Kling 2.1 first/last-frame generation only supports 1080p
a last frame is not supported with more than 2 reference images (got <张数>)
# 参考视频类型不被该型号支持,或 base 与图片 / 主体混用
model <模型 ID> has no confirmed feature reference-video capability or price tier
model <模型 ID> has no confirmed base video-edit price tier
base video edit cannot be combined with images or subjects; only a single video to edit is accepted
# 参考图数量
with a reference video, reference images + subjects cannot exceed 4, got <总数> (<图数> images + <主体数> subjects)
without a reference video, reference images + subjects cannot exceed 7, got <总数> (<图数> images + <主体数> subjects)
model <模型 ID> supports at most <上限> reference images, got <张数>
model <模型 ID> does not support reference-based generation
# 主体
subjects[<序号>].id is required (Kling fixed subjects must carry an Id)
model <模型 ID> does not support subjects (fixed subjects)
model <模型 ID> requires at least 1 image with usage=reference when subjects are used
prompt references "<<<element_N>>>" but no subjects were provided
prompt references "<<<element_N>>>" but subjects only has <个数> items
subjects[<序号>] is not referenced in prompt as <<<element_<N>>>>
# 分镜
model <模型 ID> does not support shots (multi-shot storyboard)
shots.mode="<值>" is invalid; allowed values: intelligence / customize
shots.mode=customize requires segments
shots.mode=intelligence does not accept segments; shots are generated by the model
at most 6 shot segments are allowed, got <段数>
shots.segments[<序号>].index must be numbered consecutively from 1, got <值>
shots.segments[<序号>].prompt cannot be empty
shots.segments[<序号>].prompt exceeds 512 characters
shots.segments[<序号>].duration must be at least 1 seconds
sum of shot durations (<合计> s) must equal the total duration (<总时长> s)
# 动作控制
motion control requires exactly 1 motion video and 1 character image
motion control images[<序号>] does not accept usage; the character image role is fixed by the scene
motion control videos[<序号>] does not accept reference_type; the motion video role is fixed by the scene
extra.character_orientation must be image or video
# 数字人
Kling avatar requires at least 1 character image
model <模型 ID> supports at most 5 character images, got <张数>
Kling avatar does not accept videos input
Kling avatar requires exactly one of extra.sound_file or extra.audio_id
extra.sound_file must be a non-empty string
extra.audio_id must be a non-empty string
extra.sound_file must be a publicly accessible http(s) audio URL
# 对口型
Kling lip-sync does not accept images; use extra.session_id and extra.face_choose
Kling lip-sync requires a non-empty extra.session_id
Kling lip-sync requires an extra.face_choose array with exactly 1 item
extra.face_choose[0].<键> is not part of the lip-sync contract
extra.face_choose[0].face_id must be a non-empty string or a non-negative integer
extra.face_choose[0].sound_file must be a non-empty string
extra.face_choose[0].sound_file must be a publicly accessible http(s) audio URL
# 分辨率 / 声音 / 参考视频组合没有对应价格档
model "<模型 ID>" does not support billing bucket "<档位>" for this request任务失败
任务失败时,查询接口仍返回 HTTP 200,status 为 failed,error.code 为稳定错误码,error.message 是对应的说明;请按 error.code 分支处理、展示 error.message,并按 status 判断成败。较早失败的任务可能没有 error.code。结构节选:
{
"id": "ktEXAMPLE",
"object": "video.generation.task",
"model": "kling-v3",
"status": "failed",
"created": 1790000000,
"error": {
"code": "timeout",
"message": "task did not reach a billable terminal state within 2 hours; polling stopped"
}
}查询结果的 object 对视频和生图任务都是 video.generation.task,自定义主体任务是 kling.subject.task。error.message 一律是措辞固定的英文。常见原因是素材不符合官方规格(分辨率、格式、大小、时长)或内容审核未通过。下表为视频任务的措辞;生图任务写作 image generation、reference image,自定义主体写作 subject creation。文案本身已写明下一步;两种 2 小时超时请重新提交。
| 情况 | error.code | error.message |
|---|---|---|
| 提示词未通过审核 | input_sensitive | the prompt was rejected by content moderation; rephrase it and submit again |
| 参考素材未通过审核 | input_sensitive | the reference media was rejected by content moderation; replace it and submit again |
| 审核未通过(未说明是哪一项) | input_sensitive | the prompt or reference media was rejected by content moderation; revise it and submit again |
| 产出被审核拦下 | output_video_sensitive(生图为 safety_rejected) | the generated result was blocked by content moderation; adjust the prompt or reference media and submit again |
| 并发已满 | rate_limited | this model is at its concurrency limit right now; please retry shortly |
| 模型版本已下架 | unsupported_model | this model version is no longer available; switch to another model and submit again |
| 提示词过长 | invalid_request | the prompt is too long for this model (at most 2500 characters); shorten it and submit again |
| 参数或素材不合规 | invalid_request | the request was rejected as invalid by the model; check the parameters and media against the documented limits, then submit again |
| 参考素材读取失败 | reference_input_invalid | a reference image or video is missing or could not be read; make sure every URL is publicly reachable and points to a supported file, then submit again |
| 生成失败(其他原因) | generation_failed | video generation failed; please retry, and contact support with the task ID if it keeps failing |
| 生成中途被终止 | generation_failed | video generation was stopped before it finished; please retry, and contact support with the task ID if it keeps failing |
| 任务无法追踪 | generation_failed | 以 contact support with the task ID 结尾 |
| 创建 2 小时后仍未结束 | timeout | task did not reach a billable terminal state within 2 hours; polling stopped |
| 自定义主体 2 小时后仍未结束 | timeout | subject task did not reach a terminal state within 2 hours; polling stopped |
| 任务结束但没有产出 | no_output | video generation finished without a usable output; please retry, and contact support with the task ID if it keeps failing |
| 自定义主体结束但没有主体 ID | no_output | subject creation finished without returning a subject ID; check the media and create it again |
失败的任务一律不计费。
价格
可灵对视频生成「按秒收费」,单价看该模型的分辨率与无声 / 有声 / 有无参考视频档位,不按 video tokens 计量。官方牌价见价格页。你的实际单价以登录后的模型广场为准,每次请求的实际扣费见用量记录。