Kling:動画生成 API
Kling の動画生成:テキスト・画像から動画、サブジェクト、モーションコントロール、アバター、リップシンクのモデル、パラメータ、レスポンス、エラー。
Kling はテキスト、画像、動画、サブジェクトから動画を生成し、モーションコントロール、アバター、リップシンクにも対応します。タスクを送信し、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(呼び出し回数ごとに課金) |
| キーのグループ | 「Kling 公式」 |
Kling の画像生成と画像拡張も非同期タスクで、POST /v1/images/generations で送信し、GET /v1/video/tasks/{task_id} で照会します。モデル、パラメータ、レスポンス、エラーは Kling の画像生成を参照してください。
利用できるモデル
課金対象の処理を送信する前に、GET /v1/models でキーが返す正確なモデル ID を確認してください。
| モデル ID | 長さ | 解像度 | 音声 | 公式価格 |
|---|---|---|---|---|
kling-v4 | 3〜30 秒 | 720p / 1080p | 常に音声付き。audio は料金に影響しません | $0.1471〜/ 秒 |
kling-v3-turbo | 3〜15 秒 | 720p / 1080p / 2k / 4k | 価格ティアは 1 つのみ | $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-v4はテキストから動画と先頭フレーム画像からの動画のみ対応します。audio=falseでも音声付きで出力され、料金は同じです。先頭フレーム指定時は入力画像のアスペクト比に従い、aspect_ratioは無効です。kling-v3-turboは Kling の固定 Voice 価格ティアを使用します。audioは料金に影響せず、呼び出し側はボイスを選択できません。feature参照動画ありのkling-v3-omniは無音のみで、720p / 1080p / 2k です。- 参照入力のない
kling-o1は 5 秒または 10 秒のみです。 - 音声ありの
kling-v2-6は 1080p 以上です。音声付き 720P は価格未設定です。 kling-v1-6のbase動画編集はaudioを参照しません。
モデル一覧
動画モデルごとの対応入力:
| モデル ID | 参照画像 | 参照動画 | サブジェクト | ショット |
|---|---|---|---|---|
kling-v4 | 不可(先頭フレームのみ) | 不可 | 不可 | 不可 |
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 枚ですが、API では合計の上限も適用されます。
参照画像 + サブジェクトは、参照動画なしで ≤7、ありで ≤4 である必要があります。
そのため、参照画像だけのリクエストでは上限は 7 枚です。他のバリエーションには、さらに小さい個別の上限が適用されます。
リクエストパラメータ
すべてのリクエストは Authorization: Bearer sk-your-key と Content-Type: application/json を使用します。ボディは厳格にデコードされ、受け付けるのは本ページに記載されたフィールドのみです。それ以外のフィールド、ネストされたオブジェクト内の未知のフィールド、ボディの後ろに続く 2 つ目の 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 | — | 省略時にゲートウェイは補完しません。kling-v4 は 16:9 / 9:16 / 1:1 / 21:9 に対応 |
audio | 任意 | ブール値 | false | 音声トラックを生成します。モデル一覧で音声対応のモデルのみ |
images | 任意 | 配列。各要素は url / file_id のどちらか一方 | — | 先頭・末尾フレーム、参照画像、人物画像 |
videos | 任意 | 配列。最大 1 件 | — | 参照動画、編集する動画、モーション動画 |
subjects | 任意 | 配列。各要素に空でない id | — | kling-v3-turbo、kling-v3、kling-v3-omni のみ |
shots | 任意 | オブジェクト | — | 分割ショット。kling-v3 と kling-v3-omni のみ |
extra | 任意 | オブジェクト | — | モーションコントロール、アバター、リップシンクのみで使用 |
voice_ids | — | まだ提供されていません | — | 空でない値は 400 になります |
promptの長さはタスク実行中に Kling が検査します。- 通常の動画モデルでは、
extraのどのキーも 400 になります。 - 動画のフレームは
resolutionとaspect_ratioで指定してください。OpenAI の慣習によるsize、response_format、user、動画リクエストのn、トップレベルのimage_url/video_urlは送らないでください。
動画のすべてのフィールドは、API リファレンスの動画タスクの送信(Kling を選択)に掲載されています。
メディアの指定方法
images[] または videos[] の各要素は、url と file_id のいずれか一方のみを含む必要があります。
{ "url": "https://cdn.example.com/file.png" }{ "file_id": "your-file-id" }url は絶対パスで、パブリックにアクセス可能な http:// または https:// の URL である必要があります。同じルールが画像用エンドポイント、顔検出、アバターの 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>>> and <<<element_2>>> rotate slowly on a clean studio table",
"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" }
]
}- 先頭フレームと末尾フレームはそれぞれ最大 1 枚です。
- 末尾フレームを指定する場合は先頭フレームも必要です。
reference画像が 2 枚を超える場合、末尾フレームは指定できません。kling-v2-1で先頭フレームと末尾フレームの両方を指定すると、resolutionは1080pに限定されます。- 参照画像の上限はモデル一覧を参照してください。数えるのは
usage: referenceのみです。
videos[] は最大 1 件で、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": "cat" },
{ "id": "subject-92951593345", "name": "dog" }
]
}- 各要素には空でない
idが必須で、nameは任意です。 - 要素は位置で対応し、
subjects[0]が<<<element_1>>>というように続きます。 - 指定したすべてのサブジェクトはプロンプト内で参照される必要があります。
- 存在しない
<<<element_N>>>をプロンプトで参照することはできません。 shotsを使う場合、サブジェクト参照はトップレベルのpromptに書く必要があります。shots.segments[].promptにだけ書いた参照は拒否されます。すべてのセグメントで参照を繰り返すと同じキャラクターが 2 人映ることがあるため、トップレベルで 1 回だけ参照し、セグメントではキャラクターを言葉で描写してください。kling-v3では、サブジェクトを使う場合、images[]にusage: "reference"の要素が少なくとも 1 つ必要です。
ショットは kling-v3 と kling-v3-omni のみでサポートされます。
{
"model": "kling-v3-omni",
"prompt": "A short product story in two shots",
"duration": 5,
"shots": {
"mode": "customize",
"segments": [
{ "index": 1, "prompt": "The box opens", "duration": 2 },
{ "index": 2, "prompt": "The product is revealed", "duration": 3 }
]
}
}modeはintelligenceまたはcustomizeです。- intelligence モードでは
segmentsを省略する必要があり、customize モードでは必須です。 - カスタムセグメントは最大 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 では必須 | 正面画像の URL |
reference_image_urls | image_refer では必須 | URL を 1〜3 件 |
video_url | video_refer では必須 | 動画の URL |
voice_id | 任意、video_refer のみ | サブジェクトに紐づける音声 |
tag_ids | 任意 | 文字列の配列 |
image_referは画像から、video_referは 1 本の動画からサブジェクトを作成します。- すべての URL は「メディアの指定方法」のルールに従う公開 HTTP(S) URL である必要があります。
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 が入ります。
モーションコントロール
モーションコントロールは、人物画像に動画内の動きをなぞらせます。動画 1 本と人物画像 1 枚がちょうど必要で、長さは入力素材で決まるため duration は省略します。
{
"model": "kling-v3-motion-control",
"prompt": "Follow the dancer's movement",
"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はブール値で、Kling のkeep_original_soundフラグに対応します。- 現時点で検証済みの追加パラメータは
extra.character_orientation(imageまたはvideo)のみです。 - 動作動画の長さの上限は、
character_orientationがimageのとき 10 秒、video(既定)のとき 30 秒です。これを超える動画は送信後まもなくreference_input_invalidで失敗します。 - 出力は一時的なものです。
アバター
アバター(kling-avatar)は、人物画像に音声トラックを話させます。長さは入力音声で決まるため、duration は省略します。
- 人物画像 1-5 枚が必要で、動画は受け付けません。
extra.sound_file(HTTP(S) の音声 URL)とextra.audio_idのどちらか一方がちょうど必要です。
リップシンク
リップシンク(kling-lip-sync)は動画内の顔に新しい口の動きを付けるもので、画像も動画も受け付けません。顔検出とタスク送信の 2 段階で行います。
まず、1 つ以上のメディアロケーターを指定して顔検出を呼び出します。ボディは videos 配列のみを受け付け、各項目は「メディアの指定方法」のルールに従って url / file_id のどちらか一方を含みます。
curl https://api.hop-base.com/v1/kling/faces \
-H "Authorization: Bearer sk-your-key" \
-H "Content-Type: application/json" \
-d '{"videos":[{"file_id":"source-video-file-id"}]}'続いて、返された session に対して face_choose を 1 件だけ指定して送信します。
{
"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を持つ要素をちょうど 1 件含む必要があります。- 長さは入力の音声 / 動画によって決まるため、
durationは省略します。 - 対応する Kling の機能が確認できるまで、
voice_idsと生のextra.voice_listは利用できません。
レスポンス
Kling のタスクフィールドはレスポンスのトップレベルにあり、Seedance のように task で包まれていません。
送信レスポンス
送信に成功すると 202 が返り、タスク ID は id に kt57x<task-id> のような形式で入っています。Kling の画像タスクも同じ形式の id とともに 202 を返し、どちらも同じ方法でポーリングします。
{
"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。終了状態は最後の 2 つのみ |
progress | 進捗 |
outputs | 完了後の出力 URL。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
}成功
完了したタスクでは、出力 URL が 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" }
}URL は api.hop-base.com から配信される署名付きリンクで、タスク完了時点から 24 時間有効です。再度照会しても同じ URL が返るだけで有効期限は延長されず、期限切れのリンクは 410 を返すため、この時間内に結果をダウンロードしてください。
失敗
タスクが失敗しても、照会は 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 |
|---|---|
| prompt または参照素材が審査で拒否 | input_sensitive |
| 出力が審査でブロック | output_video_sensitive(画像は safety_rejected) |
| 同時実行数の上限 | rate_limited |
| モデルのバージョンが提供終了 | unsupported_model |
| prompt が長すぎる、またはパラメータや素材が不正 | 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-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-v3",
"prompt": "A red ball rolls across a white table",
"duration": 5,
"resolution": "720p"
}'
# 2. 返された id でポーリング
curl https://api.hop-base.com/v1/video/tasks/kt57xYOUR_TASK_ID \
-H "Authorization: Bearer sk-your-key"注意事項
ゲートウェイはリクエストの構造と件数のみを検証します。解像度、フォーマット、サイズ、長さは、Kling がタスク実行中に非同期で検証します。送信前に、素材が公開インターネットから安定してダウンロードでき、Kling 公式の仕様を満たしていることを確認してください。
- Kling のタスク(画像タスクを含む)は、作成から 2 時間経っても終わらない場合は失敗扱いとなり、課金されません。
- タスクは取り消せません。すべての動画ファミリーに共通するその他のルールについては、動画生成の概要を参照してください。
- 結果のリンクは完了から 24 時間有効で、延長されません。
- モーションコントロール、アバター、リップシンクは長さが入力素材で決まるため、
durationは省略します。
残高の予約
Kling の動画タスクを送信する際は、「利用可能残高 − 実行中タスクの見積もり額 − 今回のリクエストの見積もり額」で判定され、不足している場合は 402 が返ります。Kling の画像生成は予約を行わず、残高が 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 がない、値が不正、または動画が 2 件以上
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)
subject reference <<<element_<N>>>> appears only in shots.segments[<番号>].prompt; subject references must appear in the top-level prompt for multi-shot requests (tip: repeating the reference in every shot prompt can make the same character appear twice; reference it once in the top-level prompt and describe the character in words in shot prompts)
subjects[<番号>] is not referenced in the top-level prompt as <<<element_<N>>>>; for multi-shot requests, subject references must appear in the top-level prompt, not only in shot prompts (tip: repeating the reference in every shot prompt can make the same character appear twice; reference it once in the top-level prompt and describe the character in words in shot prompts)
shots.segments[<番号>].prompt references <<<element_<N>>>> but no subjects were provided; pass the subject in subjects and reference it as <<<element_<N>>>> in the top-level prompt
shots.segments[<番号>].prompt references <<<element_<N>>>> but subjects only has <件数> items
# 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)失敗したタスク
よくある原因は、素材が Kling 公式の仕様(解像度、形式、サイズ、長さ)に合っていないことか、コンテンツ審査で拒否されたことです。各メッセージに次の対処が書かれています。2 時間のタイムアウトはどちらも再送信してください。失敗したタスクは課金されません。
動画タスクの error.message の原文は次のとおりです。画像タスクでは image generation・reference image、カスタムサブジェクトでは subject creation になります。
# input_sensitive: prompt が審査で拒否
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: prompt が長すぎる
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
# reference_input_invalid: 動作動画に人物の上半身全体が映っていない
the motion reference video was rejected: no complete human upper body was detected in it; use a video in which a real person's upper body (head to waist) is clearly visible, then submit again
# reference_input_invalid: 動作動画が長すぎる
the motion reference video is too long: max 10s when character_orientation=image, 30s when character_orientation=video; trim the video (or use character_orientation=video for clips up to 30s), then submit again
# reference_input_invalid: 入力動画が長すぎる(その他のモデル)
the input video is too long for this model; trim it to the documented maximum duration, 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課金
Kling は動画生成について、video token ではなく、モデルの解像度と無音 / 音声あり / 参照動画のバリエーションに応じたレートで、出力動画の秒数単位で課金します。正常に完了したタスクのみが課金され、失敗したタスクは課金されません。
- 顔検出(
POST /v1/kling/faces)は呼び出し回数ごとに課金されます。 - カスタムサブジェクトの作成は現在課金されません。
- 画像の課金は Kling の画像生成を参照してください。
リップシンクの課金は秒単位で、最低 5 秒分が適用されます。4 秒の成果物でも 5 秒分として課金されます。
公式のリスト価格は料金ページに掲載されています。実際の適用レートはログイン後のモデルカタログに表示され、各リクエストの実際の課金額は利用量レコードで確認できます。
次のステップ
- 動画生成の概要: 動画ファミリーの比較と共通のタスクの流れ
- Kling の画像生成: Kling の画像生成と画像拡張
- クリエイティブスタジオ: コードを書かずに画像と動画を生成する
- 利用可能なモデル: キーで使えるモデル ID を確認する
- トラブルシューティング: エラーメッセージから対処法を探す