跳到內容
開放式卡斯塔利控制台

影片

kling-2.6 API

透過 Modelflare 非同步視訊路由使用準確的 kling-2.6 模型 ID。

使用準確的型號 ID kling-2.6。模型欄位必須與此頁面完全相符。

範例輸出kling-2.6POST /v1/videos5.0s

參數: duration=5resolution=1080pratio=16:9

提示詞: One continuous take, no cuts. An automatic car wash bay, brushes stopped mid-turn, foam sliding down the glass. A figure in a translucent PVC raincoat steps into the bay and the foam stops being foam: it sets into iridescent shells that peel off the car and the walls and drift up around the coat, each one catching a different colour. The camera pushes in slowly through the bay and rotates around the figure as the shells rise. One hard magenta wash light from the far end, cold blue daylight at the entrance. Real weight and inertia, soap and water still running, no text.

產生此樣本的請求
{
"model": "kling-2.6",
"prompt": "One continuous take, no cuts. An automatic car wash bay, brushes stopped mid-turn, foam sliding down the glass. A figure in a translucent PVC raincoat steps into the bay and the foam stops being foam: it sets into iridescent shells that peel off the car and the walls and drift up around the coat, each one catching a different colour. The camera pushes in slowly through the bay and rotates around the figure as the shells rise. One hard magenta wash light from the far end, cold blue daylight at the entrance. Real weight and inertia, soap and water still running, no text.",
"seconds": "5",
"duration": 5,
"resolution": "1080p",
"ratio": "16:9",
"aspect_ratio": "16:9"
}

將 Modelflare API 金鑰與 https://modelflare.dev/v1 結合使用。網關入口點是POST /v1/videos。

HTTP
Authorization: Bearer YOUR_MODELFLARE_API_KEY
終端機視窗bash
curl https://modelflare.dev/v1/videos \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model_name": "kling-2.6",
"prompt": "A white cat runs through a neon-lit street in the rain, cinematic tracking shot",
"duration": "5", "mode": "std"
}'

儲存任務ID。輪詢 GET /v1/videos/{task_id} 並使用 GET /v1/videos/{task_id}/content 下載。結果 URL 可能會過期,因此請立即傳輸檔案。

終端機視窗bash
curl https://modelflare.dev/v1/videos/TASK_ID \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY"

Kling 使用系列特定的 model_name、prompt、mode、duration、image_list 或 contents / settings 欄位;本機 JSON 保留並轉送。

Kling Legacy 使用 model_name 和 text2video / image2video 請求結構。查看此型號的官方頁面和定價頁面,以了解模式、解析度和音訊通道。

場 必填 註釋
model_name 是 kling-2.6
prompt 有條件 文字轉視頻所需;與影像結合以進行影像轉視頻
image 有條件 第一格圖片 URL 或 Base64
image_tail 否 可選的結束影格影像
video_url 有條件 Kling 3.0運動控制參考視頻
image_list 否 Omni/O1 與多模式工作流程的圖片列表
negative_prompt 否 負面提示
mode 否 std / pro / 4k(取決於型號)
duration 否 5 / 10(字符串)
multi_shot 否 啟用多鏡頭故事板
sound 否 在支援的情況下產生同步聲音
camera_control 否 支援的相機控制

Kling 2.6 使用具有固定 5/10 秒持續時間、720p/1080p、16:9/9:16/1:1、影像到視訊、本機音訊和動作控制的 Legacy API; sound 接受 on/off。

舊模型按工作流程選擇 model_name、第一幀/結束幀或運動控製欄位;固定的持續時間和音訊限制遵循本頁的表格。

終端機視窗bash
curl https://modelflare.dev/v1/videos \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model_name": "kling-2.6", "prompt": "一只狗在海边奔跑",
"duration": "5", "mode": "pro", "aspect_ratio": "16:9", "sound": "on"
}'

無效模型參數傳回帶有請求 ID 的 4xx。非同步任務建立成功後也可能進入失敗;使用輪詢回應中的 error_code 和 error_message 作為最終任務原因。不要使用不同的 JSON 形狀重試相同的請求。

此頁面涵蓋 Modelflare 模型產生和編輯呼叫。搜尋或地圖豐富、語音管理和元素庫管理是此公共模型呼叫表面之外的資源 API,並且不是必需的請求欄位。

此模型採用按秒視訊計費。請參閱 型號定價頁面 ,以了解當前客戶價格、參考標價和完整規格。

媒體合約 · v1

合約 ID: media.kling-2-6.v1適配器: video.kling.legacy.v1@v1指紋: b53fa35546d2b5028a69146a031a053d852003d673d1b7a334d8b124997101cc

官方來源: Kuaishou Kling

合約參數

意圖字段控制項選項
ratioselect16:9 / 9:16 / 1:1
resolutionselect720p / 1080p
durationselect5 / 10
audioswitch—

支援的功能

  • allowed_values · ratio · 16:9, 9:16, 1:1
  • allowed_values · resolution · 720p, 1080p
  • allowed_values · duration · 5, 10
  • max_assets · reference_asset_ids · 2

結構化請求範例

text

意圖

{
  "audio": false,
  "duration": 5,
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "ratio": "16:9",
  "resolution": "720p"
}

提供者請求

{
  "aspect_ratio": "16:9",
  "duration": "5",
  "mode": "std",
  "model_name": "kling-2.6",
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "sound": "off"
}

reference

意圖

{
  "audio": false,
  "duration": 5,
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "ratio": "16:9",
  "resolution": "720p"
}

提供者請求

{
  "aspect_ratio": "16:9",
  "duration": "5",
  "image": "https://example.com/reference.png",
  "mode": "std",
  "model_name": "kling-2.6",
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "sound": "off"
}