可灵:视频生成 API
用可灵生成视频:文生与图生视频、主体参考、动作控制、数字人与对口型的型号、参数、返回结果与报错。
可灵从文本、图片、视频和主体生成视频,也支持动作控制、数字人与对口型:提交任务后用 HopBase 任务 ID 轮询结果。
| 项目 | 值 |
|---|---|
| Base URL | https://api.hop-base.com/v1 |
| 提交视频任务 | POST /v1/video/generate |
| 查询任务 | GET /v1/video/tasks/{task_id} |
| 任务列表 | GET /v1/video/tasks |
| 自定义主体 | POST / GET /v1/kling/subjects |
| 对口型人脸识别 | POST /v1/kling/faces(按次计费) |
| 密钥分组 | 「可灵模型分组(官方)」 |
可灵生图与扩图也是异步任务:用 POST /v1/images/generations 提交,用 GET /v1/video/tasks/{task_id} 查询。型号、参数、返回与报错见可灵生图。
可用型号
正式产生付费任务前,先用 GET /v1/models 确认当前密钥实际返回的完整模型 ID。
| 模型 ID | 时长 | 分辨率 | 声音 | 官方价 |
|---|---|---|---|---|
kling-v3-turbo | 3–15 秒 | 720p / 1080p / 2k / 4k | 单一价格档 | $0.1176起/ 秒 |
kling-v3-omni | 3–15 秒 | 720p / 1080p / 2k / 4k | 有声 / 无声 | $0.0882起/ 秒 |
kling-v3 | 3–15 秒 | 720p / 1080p / 2k / 4k | 有声 / 无声 | $0.0882起/ 秒 |
kling-o1 | 3–10 秒 | 720p / 1080p / 2k / 4k | 只能无声 | $0.0882起/ 秒 |
kling-v2-6 | 5 / 10 秒 | 720p / 1080p / 2k / 4k | 有声 / 无声 | $0.0441起/ 秒 |
kling-v2-5-turbo | 5–10 秒 | 720p / 1080p | 只能无声 | $0.0441起/ 秒 |
kling-v2-1、kling-v2-0 | 5–10 秒 | 720p / 1080p / 2k / 4k | 只能无声 | $0.0588起/ 秒 |
kling-v1-6 | 5–10 秒 | 720p / 1080p / 2k / 4k | 只能无声 | $0.0588起/ 秒 |
kling-v3-motion-control | 输入素材时长 | 720p / 1080p / 2k / 4k | 不生成声音 | $0.1324起/ 秒 |
kling-v2-6-motion-control | 输入素材时长 | 720p / 1080p | 不生成声音 | $0.0735起/ 秒 |
kling-avatar | 输入音频时长 | 720p / 1080p | 来自输入音频 | $0.0588起/ 秒 |
kling-lip-sync | 输入素材时长 | 不影响计价 | 来自输入音频 | $0.0147/ 秒 |
表外的分辨率 / 声音组合在提交时返回 400。每个型号的分档价与完整规格见模型卡,例如 kling-v3、kling-v3-omni、kling-lip-sync。
kling-v3-turbo是官方固定 Voice 价格档,audio不影响计价,调用方不能指定音色。kling-v3-omni带feature参考视频时只能无声,分辨率为 720p / 1080p / 2k。kling-o1没有参考生输入时只支持 5 或 10 秒。kling-v2-6有声时 1080p 起,有声 720P 未定价。kling-v1-6的base视频编辑不看audio。
模型矩阵
各视频模型支持的素材:
| 模型 ID | 参考图 | 参考视频 | 主体 | 分镜 |
|---|---|---|---|---|
kling-v3-turbo | 不支持 | 不支持 | 支持 | 不支持 |
kling-v3-omni | 最多 7 张 | feature | 支持 | 支持 |
kling-v3 | 最多 6 张 | 不支持 | 支持 | 支持 |
kling-o1 | 最多 4 张 | feature | 不支持 | 不支持 |
kling-v2-6 | 最多 4 张 | 不支持 | 不支持 | 不支持 |
kling-v2-5-turbo | 最多 3 张 | 不支持 | 不支持 | 不支持 |
kling-v2-1、kling-v2-0 | 不支持 | 不支持 | 不支持 | 不支持 |
kling-v1-6 | 不支持 | base | 不支持 | 不支持 |
kling-v3-motion-control、kling-v2-6-motion-control | 1 图 + 1 视频 | 场景确定 | 不支持 | 不支持 |
kling-avatar | 1-5 张 | 不支持 | 不支持 | 不支持 |
kling-lip-sync | 不支持 | 不支持 | 不支持 | 不支持 |
- “参考图”只统计
usage: reference,不包含首尾帧,不是所有images[]的总数。 kling-v3-omni的base未定价,4K 无声feature未定价。kling-v1-6的待编辑视频使用multi_elements桶。
v3 Omni 的模型配置上限虽为 8,但接口还有合计上限。
接口要求:无参考视频时“参考图 + 主体 ≤ 7”,有参考视频时 ≤ 4。
所以只传参考图时实际最多 7 张;其他型号还要取各自更小的上限。
请求参数
所有请求都带 Authorization: Bearer sk-你的密钥 和 Content-Type: application/json。请求体只接受本页列出的字段:表外字段、嵌套对象里的未知字段、请求体后面跟着的第二个 JSON 值,都会在任务创建前返回 400,不计费。
| 参数 | 必填 | 类型与限制 | 默认值 | 说明 |
|---|---|---|---|---|
model | 必填 | 上方型号表中的 ID | — | 决定时长、分辨率与素材限制 |
prompt | 无素材时必填 | ≤ 2,500 字符 | — | 仅在有 images / videos 时可为空 |
duration | 可选 | 整数秒,范围见型号表 | 5 | 动作控制、数字人、对口型必须省略 |
resolution | 可选 | 720p / 1080p / 2k / 4k | 720p | 不区分大小写,须为该模型支持的值 |
aspect_ratio | 可选 | 16:9 / 9:16 / 1:1 | — | 省略时网关不代填 |
audio | 可选 | 布尔值 | false | 随视频生成音轨,仅型号表标注支持声音的模型可用 |
images | 可选 | 数组,每项 url / file_id 二选一 | — | 首尾帧、参考图、人物图 |
videos | 可选 | 数组,最多一项 | — | 参考视频、待编辑视频、动作视频 |
subjects | 可选 | 数组,每项非空 id | — | 仅 kling-v3-turbo、kling-v3、kling-v3-omni |
shots | 可选 | 对象 | — | 分镜,仅 kling-v3 和 kling-v3-omni |
extra | 可选 | 对象 | — | 仅动作控制、数字人、对口型使用 |
voice_ids | — | 暂不可用 | — | 非空即返回 400 |
prompt的长度由可灵在任务执行中校验。- 普通视频模型传任何
extra键都返回 400。 - 视频画面请用
resolution与aspect_ratio指定,不要带 OpenAI 习惯的size、response_format、user,视频请求里的n,或顶层的image_url/video_url。
视频请求的全部字段见 API 参考提交视频任务(选「可灵」)。
素材定位
每个 images[] 或 videos[] 项必须且只能提供 url 或 file_id 其中之一:
{ "url": "https://cdn.example.com/file.png" }{ "file_id": "your-file-id" }url 必须是公网可访问的绝对 http:// 或 https:// 地址。图片接口、人脸识别与数字人的 extra.sound_file 也遵循同一规则。下列写法会在提交时同步拒绝:
- 空字符串或相对路径。
file://、ftp://等非 HTTP(S) 协议。- 指向内网、回环或链路本地的地址。
- 带认证信息的 URL。
- 同时提供
url和file_id。
文生与图生视频
普通视频模型支持文生视频、首尾帧、参考图、参考视频和视频编辑。图片放进 images[],视频放进 videos[];只传 prompt 就是文生视频。
每张图用 usage 标明角色:first_frame、last_frame 或 reference。
{
"model": "kling-v3-omni",
"prompt": "<<<element_1>>> 和 <<<element_2>>> 在干净的摄影棚桌面上缓慢旋转",
"duration": 5,
"resolution": "1080p",
"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" }
]
}- 首帧和尾帧各最多一张。
- 指定尾帧必须同时提供首帧。
- 参考图超过两张时不能再指定尾帧。
kling-v2-1同时提供首尾帧时,resolution只能为1080p。- 参考图上限见型号表,只统计
usage: reference。
videos[] 最多一项,且必须带 reference_type:
{
"videos": [
{
"url": "https://cdn.example.com/character-motion.mp4",
"reference_type": "feature",
"keep_original_sound": false
}
]
}feature是参考视频,仅kling-v3-omni和kling-o1开放。base是视频编辑,仅已实测且有价的kling-v1-6开放。base必须是唯一素材,不能和图片或主体混用。keep_original_sound是布尔值,保留源视频的原声。
主体与分镜
subjects[] 使用官方固定主体 ID,只有 kling-v3-turbo、kling-v3、kling-v3-omni 支持主体。
{
"subjects": [
{ "id": "subject-92951593344", "name": "猫" },
{ "id": "subject-92951593345", "name": "狗" }
]
}- 每项必须有非空
id,name可选。 - 主体按数组位置绑定:
subjects[0]对应<<<element_1>>>,依此类推。 - 每个已提供的主体都必须在 Prompt 中被引用。
- Prompt 不能引用不存在的
<<<element_N>>>。 - 对
kling-v3,提供主体时images[]至少要有一项usage: "reference"。
分镜仅 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会被拒绝。
创建自定义主体
POST /v1/kling/subjects 创建自定义主体,得到的主体 ID 可填入 subjects[].id。GET 同一路径查询已有主体。
| 字段 | 必填 | 取值 |
|---|---|---|
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 必填 | 视频地址 |
voice_id | 可选,仅 video_refer | 绑定到主体的音色 |
tag_ids | 可选 | 字符串数组 |
image_refer用图片创建主体,video_refer用一段视频创建。- 所有地址都必须是公网 HTTP(S) 地址,规则与「素材定位」相同。
reference_image_urls不能与正面图重复,彼此也不能重复。video_refer不能带任何图片字段,image_refer不能带video_url。tag_ids用于归类主体,每项非空且不重复。
创建是异步任务:提交返回 202 与 id(object 为 kling.subject.task),用 GET /v1/video/tasks/{task_id} 轮询。完成后结果里带 element_ids 与 elements。
动作控制
动作控制让人物图跟随一段视频的动作,需要恰好一个视频和一张人物图。这类任务的时长由输入素材决定,必须省略 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" }
}- 场景决定两者含义,所以图片不能带
usage,视频不能带reference_type。 videos[].keep_original_sound是布尔值,对应官方的keep_original_sound标记。- 目前唯一验证过的额外参数是
extra.character_orientation(image或video)。 - 产物使用临时存储。
数字人
数字人(kling-avatar)让人物图按一段音频说话,时长由输入音频决定,必须省略 duration。
- 需要 1-5 张人物图,不接受视频。
- 必须在
extra.sound_file(HTTP(S) 音频地址)和extra.audio_id中二选一。
对口型
对口型(kling-lip-sync)替视频里的人脸换上新的口型,不接受图片或视频。分两步:先识别人脸,再提交任务。
第一步,用一个或多个素材调用人脸识别。请求体只接受 videos 数组,每项 url / file_id 二选一,规则与「素材定位」相同。
curl https://api.hop-base.com/v1/kling/faces \
-H "Authorization: Bearer sk-你的密钥" \
-H "Content-Type: application/json" \
-d '{"videos":[{"file_id":"source-video-file-id"}]}'第二步,提交返回的 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。- 时长由输入音频 / 视频决定,必须省略
duration。 - 官方确认对应 SKU 前,
voice_ids和extra.voice_list均不可用。
返回结果
可灵的任务字段在响应顶层,不像 Seedance 那样包在 task 里。
提交响应
提交成功返回 202,任务 ID 在 id 字段,形如 kt57x<task-id>。可灵生图同样返回 202 与同样形态的 id,两者查询方式相同。
{
"id": "ktEXAMPLE",
"object": "video.generation.task",
"model": "kling-v3",
"status": "queued",
"created": 1790000000,
"billing_bucket": "720p_silent_noref"
}任务查询字段
| 字段 | 说明 |
|---|---|
id | HopBase 任务 ID,kt… |
object | 视频与生图任务为 video.generation.task,自定义主体为 kling.subject.task |
status | queued → processing → completed 或 failed;只有后两者是终态 |
progress | 进度 |
outputs | 完成后的成片地址,URL 字符串数组 |
usage | 完成后的计量:bucket,加上视频的 billed_seconds 或生图的 billed_images |
usage.cost / usage.cost_usd / usage.currency | 本任务扣费:cost_usd 为从余额实际扣除的美元金额,cost 为同一笔的人民币金额,currency 恒为 CNY |
element_ids / elements | 自定义主体任务完成后的主体 |
error.code | 失败时的稳定错误码,见下方「任务失败」 |
error.message | 失败时措辞固定的英文说明 |
除 completed 与 failed 之外的任何值都按进行中处理。查询时不要传计费标头。
任务结束后,查询响应根对象的 usage 还会带 cost_usd(本任务从余额实际扣除的美元金额,未扣费的失败为 0)、cost(同一笔的人民币金额)与 currency(恒为 CNY),详见视频总览。任务列表(GET /v1/video/tasks)里每个终态任务的 usage 也带同样的 cost、cost_usd 与 currency。
进行中
{
"id": "ktEXAMPLE",
"object": "video.generation.task",
"model": "kling-v3",
"status": "processing",
"created": 1790000000
}成功
完成后从 outputs 取地址:
{
"id": "ktEXAMPLE",
"status": "completed",
"outputs": [
"https://api.hop-base.com/example-signed-image.png"
],
"usage": { "bucket": "720p_silent_noref", "billed_seconds": 5, "cost": 2.55, "cost_usd": 0.375, "currency": "CNY" }
}地址在 api.hop-base.com 域名下,是自任务完成起 24 小时有效的签名链接。再次查询返回同一地址、不会续期,过期访问返回 410,请在 24 小时内下载保存。
失败
任务失败时,查询接口仍返回 HTTP 200,status 为 failed。error.code 是稳定错误码,error.message 是措辞固定的英文说明。
{
"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"
}
}请按 status 判断成败,按 error.code 分支处理,并展示 error.message。较早失败的任务可能没有 error.code。
| 情况 | error.code |
|---|---|
| 提示词或参考素材未通过审核 | input_sensitive |
| 产出被审核拦下 | output_video_sensitive(生图为 safety_rejected) |
| 并发已满 | rate_limited |
| 模型版本已下架 | unsupported_model |
| 提示词过长,或参数、素材不合规 | invalid_request |
| 参考素材读取失败 | reference_input_invalid |
| 生成失败或中途被终止 | generation_failed |
| 创建 2 小时后仍未结束 | timeout |
| 任务结束但没有产出 | no_output |
最小示例
下面提交一个 5 秒 720p 的文生视频任务,再轮询到结束。
# 1. 提交
curl https://api.hop-base.com/v1/video/generate \
-H "Authorization: Bearer sk-你的密钥" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-v3",
"prompt": "红球在白桌面上滚动",
"duration": 5,
"resolution": "720p"
}'
# 2. 用返回的 id 轮询
curl https://api.hop-base.com/v1/video/tasks/kt57xYOUR_TASK_ID \
-H "Authorization: Bearer sk-你的密钥"注意事项
网关只校验请求结构与数量,素材的分辨率、格式、大小、时长由官方在任务执行时异步校验。提交前请确认素材可被公网稳定下载,并符合可灵官方的规格要求。
- 可灵任务(含生图)创建 2 小时后仍未结束即判为失败、不计费。
- 任务不支持取消,其余通用规则见视频总览。
- 结果链接自任务完成起 24 小时有效,不会续期。
- 动作控制、数字人与对口型的时长由输入素材决定,必须省略
duration。
余额预留
提交可灵视频任务时按「可用余额 − 进行中任务的预估费用 − 本次预估费用」判断,不足返回 402。可灵生图不做预留,只在余额小于等于 0 时才会被拦截。
余额不足时 code 为 insufficient_balance,任务结束后预估自动释放。对口型(kling-lip-sync)无法提前估算,不做预留。
常见报错 → 改法
提交阶段出错不会创建任务,也不计费,原因写在 error.message 里。400 的 type 为 invalid_request_error,402 的 code 为 insufficient_balance。
| HTTP | 情况 | 处理 |
|---|---|---|
| 400 | 字段、取值或组合不合法 | 按报错修改后重新提交 |
| 400 | 把生图模型发到视频接口 | 改用生图接口 |
| 402 | 视频余额预留不足 | 充值,或等进行中的任务结束 |
| 404 | 模型 ID 不在目录 | 用 GET /v1/models 核对 ID |
| 429 / 5xx | 服务繁忙或暂时不可用 | 稍后重试 |
带了 size 等表外字段时的原样报错(人脸识别接口相同):
{
"error": {
"message": "request body does not match the JSON contract: json: unknown field \"size\"",
"type": "invalid_request_error"
}
}其余几种的 error.message 原文:
# 把生图模型发到视频接口(400)
model "<模型 ID>" is an image model; use /v1/images/generations
# 视频模型 ID 不在目录(404)
model "<模型 ID>" is not in the Kling catalog
# 生图模型 ID 不在目录(404)
model "<模型 ID>" is not an image model in this catalog素材与通用参数
# 素材 url / file_id 都没有或都有
<images 或 videos>[<序号>] must provide exactly one of url or file_id
# url 不是公网 http(s) 绝对地址
<images 或 videos>[<序号>].url must be a publicly accessible absolute http(s) URL
# 没有 prompt 也没有任何素材(对口型除外)
prompt and input media cannot both be empty
# duration 为负数
duration cannot be negative
# 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
# 分辨率 / 声音 / 参考视频组合没有对应价格档
model "<模型 ID>" does not support billing bucket "<档位>" for this request
# voice_ids 非空(报错以此开头)
voice_ids is not available yet
# extra 含该型号不接受的键
extra.<键> is not in the verified parameter contract of model <模型 ID>
# 时长由素材决定的型号传了 duration
duration of model <模型 ID> is determined by the input media; do not pass duration首尾帧、参考图与参考视频
# usage 缺失或取值不合法
images[<序号>].usage is required for standard Kling video requests
images[<序号>].usage="<值>" is invalid; allowed values: first_frame / last_frame / reference
# 首尾帧规则
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 <张数>)
# 参考图数量
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
# reference_type 缺失或取值不合法,或视频多于 1 个
videos[0].reference_type is required for standard Kling video requests; allowed values: feature / base
videos[<序号>].reference_type="<值>" is invalid; allowed values: feature / base
standard Kling video requests accept at most 1 videos input
# 参考视频类型不被该型号支持,或 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
# 原声参数写进了 extra
extra.keep_original_sound cannot be passed through; use videos[].keep_original_sound# 主体
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)
# 分镜、主体写进了 extra
extra.<键> cannot be passed through; use the structured shots parameter
extra.element_list cannot be passed through; use the structured subjects parameter动作控制、数字人与对口型
# 动作控制
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
# 人脸识别:JSON 不合法或带了其他字段
request body does not match the JSON contract: …
# 人脸识别:缺少 videos 或数组为空
videos is required and must contain at least one item
# 对口型
Kling lip-sync does not accept images or videos; 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
extra.voice_list is reserved; use voice_ids instead (voice selection is not available yet)任务失败
常见原因是素材不符合官方规格(分辨率、格式、大小、时长)或内容审核未通过。文案本身已写明下一步;两种 2 小时超时请重新提交。失败的任务一律不计费。
下面是视频任务的 error.message 原文。生图任务写作 image generation、reference image,自定义主体写作 subject creation。
# 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
# timeout:创建 2 小时后仍未结束
task did not reach a billable terminal state within 2 hours; polling stopped
# timeout:自定义主体 2 小时后仍未结束
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
# no_output:自定义主体结束但没有主体 ID
subject creation finished without returning a subject ID; check the media and create it again计费
可灵对视频生成「按秒收费」,单价看该模型的分辨率与无声 / 有声 / 有无参考视频档位,不按 video tokens 计量。只有成功完成的任务才计费,失败的任务不计费。
- 人脸识别(
POST /v1/kling/faces)按次计费。 - 创建自定义主体目前不计费。
- 生图计费见可灵生图。
对口型按秒计费并有 5 秒下限,4 秒成片按 5 秒收费。
官方牌价见价格页。你的实际单价以登录后的模型广场为准,每次请求的实际扣费见用量记录。