跳轉到主要內容
POST
使用此端點,根據角色圖片和一段 參考影片建立 Motion Control 任務。
本頁說明相容的 Motion Control 路由。Kling Video 3.0 Motion Control 使用獨立的 API 合約。

必要媒體

image_url 接受公開 URL 或原始 Base64 字串。
  • 請使用 10 MB 以下的 JPG、JPEG 或 PNG 圖片。
  • 每個圖片維度須介於 300 至 65,536 像素之間。
  • 請使用介於 1:2.5 至 2.5:1 的長寬比。
  • 請將 Base64 以不含 data:image/...;base64, 前綴的原始編碼字串傳送。
  • 僅顯示一名未受遮擋的人物,且身體取景須與動作 參考素材相符。
video_url 接受公開的 MP4 或 MOV URL。
  • 請使用 100 MB 以下的影片。
  • 短邊至少須為 340 像素。
  • 長邊不得超過 3850 像素。
  • 請使用僅有一名可見人物的連續鏡頭。
  • 避免剪接、鏡頭變換及過快的動作。
請遵守時長限制,並檢查巢狀的終態 task_status。外層 HTTP 200 或回應 code: 0 僅確認查詢回應,而非 生成成功結果。

設定 orientation 值

character_orientation 為必填欄位,並接受 image 或 video。 若使用 element_list,請將 character_orientation 設為 video。

選擇模型和模式

相容路由接受 kling-v2-6 和 kling-v3。兩個模型值 皆接受兩個模式值: 若省略 model_name,請求會使用 kling-v2-6。若省略 mode, 請求會使用 std。kling-v3 值會保留本頁所述的相容請求結構; 不會選取獨立的 Kling 3.0 路徑版本 合約。 相容合約不保證固定的輸出解析度。若您的應用程式需要特定尺寸,請檢查 每個傳回的影片。 keep_original_sound 接受 yes 或 no。若省略此欄位, 請求會使用 yes。

任務流程

1

提交 Motion Control 請求

傳送來源圖片、參考影片和 orientation 值。選擇一個 模型、模式和聲音值,或使用其文件中記載的預設值。儲存 傳回的 task_id。
2

輪詢任務

使用 取得 Kling 任務 搭配傳回的 task_id。 持續查詢,直到狀態為 succeed 或 failed。
3

儲存結果

請盡快下載並儲存結果。Kling 的相容 API 文件指出,生成的影片會在 30 天後清除。請勿 假設傳回的 URL 在完整 30 天期間內都可存取。

選用欄位

回呼結構

Legacy 回呼結構描述具有下列結構:
回呼狀態可以是 submitted、processing、succeed 或 failed。 終態結果欄位僅會在終態回傳時出現。

結果欄位

任務狀態為 submitted、processing、succeed 或 failed。
請參閱 Kling Motion Control API 參考資料 以及 Kling 回呼通訊協定 以瞭解 API 詳細資料。

授權

Authorization
string
header
必填

Bearer authentication. Use your CometAPI API key.

主體

application/json
image_url
string
必填

Character image as a public URL or a raw Base64 string. Send raw Base64 without a data:image/...;base64, prefix; data-URI input is outside the compatible contract. Supported formats are JPG, JPEG, and PNG. The image must be 10 MB or smaller. Its width and height must each be from 300 through 65,536 pixels, and its aspect ratio must be between 1:2.5 and 2.5:1.

video_url
string<uri>
必填

Public reference motion video URL. Use an MP4 or MOV file that is 100 MB or smaller. The short edge must be at least 340 pixels, and the long edge must not exceed 3850 pixels. The video must be at least 3 seconds long. The maximum duration depends on character_orientation.

character_orientation
enum<string>
必填

Required compatible string enum. With image, the reference video can be 3 to 10 seconds long. With video, the reference video can be 3 to 30 seconds long.

可用選項:
image,
video
model_name
enum<string>
預設值:kling-v2-6

Model ID for this compatible Motion Control request. Omit this field to use kling-v2-6. The kling-v3 value keeps this compatible request shape; it does not select the separate Kling 3.0 path-version contract.

可用選項:
kling-v2-6,
kling-v3
prompt
string

Optional text field in the compatible request structure. Maximum 2500 characters.

Maximum string length: 2500
keep_original_sound
enum<string>
預設值:yes

Compatible string enum. Accepted values are yes and no. Omitted requests use yes.

可用選項:
yes,
no
mode
enum<string>
預設值:std

Both compatible models accept std and pro. Omitted requests use std.

可用選項:
std,
pro
callback_url

Optional callback field in the compatible structure. Provide a URI, or omit the field or send an empty string when no callback URI is configured.

external_task_id
string

Optional ID for correlation in your application. The value must be unique for your account. Store the returned task_id for CometAPI status queries.

element_list
object[]

Optional compatible Element structure. Provide at most one object, and combine this field only with character_orientation: video.

Maximum array length: 1
watermark_info
object

Optional compatible watermark structure.

回應

200 - application/json

Task accepted.

code
integer
必填

Response code. A value of 0 indicates that the request was accepted.

message
string
必填

Response message.

data
object
必填
最後修改於 2026年7月31日