可靈:影片生成 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 秒收費。
官方牌價見價格頁。你的實際單價以登錄後的模型廣場為準,每次請求的實際扣費見用量記錄。