可靈影片與生圖 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-your-key" \
-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-your-key"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 計量。官方牌價見價格頁。你的實際單價以登入後的模型廣場為準,每次請求的實際扣費見用量記錄。