OPENCLAW + KLING

在 OpenClaw 中使用 Kling。

Kling 3.0 由 Kuaishou 開發,可從文字或圖片生成最高 1080p 的影片,支援原生音訊、多鏡頭場景及 3–15 秒時長。OpenClaw agent 透過 RunAPI 呼叫 Kling,使用與聊天相同的 API key — 發送 prompt、輪詢任務,即可取得影片 URL。

一個 API key · 文生影片 + 圖生影片 · 按秒計費
Use RunAPI to generate a video with Kling 3.0.

Requirements:
- Call POST https://runapi.ai/api/v1/kling/text_to_video
- Set model to "kling-3.0"
- Read the API key from RUNAPI_API_KEY environment variable
- Set duration_seconds to control length (3–15 seconds)
- Set aspect_ratio to "16:9" for landscape video
- Enable sound with enable_sound: true for native audio
- The response is async — poll the task status endpoint until the task completes, then retrieve the video URL
curl -X POST https://runapi.ai/api/v1/kling/text_to_video \
  -H "Authorization: Bearer $RUNAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kling-3.0",
    "prompt": "A drone shot pulling back from a mountain lake at sunrise, mist rising off the water, cinematic lighting",
    "duration_seconds": 5,
    "aspect_ratio": "16:9",
    "enable_sound": true,
    "output_resolution": "1080p"
  }'
{
  "task_id": "tsk_abc123",
  "status": "pending",
  "model": "kling-3.0"
}
複製 curl 指令進行測試 kling
運作原理

三步驟在 OpenClaw 中使用 Kling

1

設定 RunAPI

設定 RUNAPI_API_KEY 環境變數。如果你已將 RunAPI 設定為 OpenClaw 的聊天 provider,同一把 key 即可用於影片生成 — 無需額外設定。

export RUNAPI_API_KEY=runapi_xxx
2

呼叫 Kling text_to_video

發送 POST 請求至 /api/v1/kling/text_to_video,將 model 設為 kling-3.0。加入 prompt、duration_seconds(3–15)、aspect_ratio,並可選擇啟用 enable_sound 取得原生音訊。若要以圖片驅動生成,改用 /api/v1/kling/image_to_video 並提供 first_frame_image_url。

POST /api/v1/kling/text_to_video
3

輪詢取得結果

端點會立即回傳 task_id。輪詢任務狀態端點,直到 status 變為 completed,然後從回應中取得影片 URL。生成時間通常為 30–120 秒,取決於時長和解析度。

GET /api/v1/kling/text_to_video/tsk_abc123
參數

Kling text_to_video API 參數

參數 類型 說明
model string 必填。kling-3.0 為最新版本。
prompt string 影片描述。除非啟用 multi_shots,否則為必填。
duration_seconds integer 影片長度。Kling 3.0 支援 3–15 秒。舊版本僅接受 5 或 10 秒。
aspect_ratio string 輸出長寬比:16:9、9:16 或 1:1。
output_resolution string 解析度:720p、1080p 或 4k。解析度越高,每秒費用越高。
enable_sound boolean 與影片同時生成原生音訊。會增加每秒費用。
negative_prompt string 要從生成結果中排除的元素。
first_frame_image_url string 用作開頭畫面的圖片 URL(單鏡頭模式)。
cfg_scale number 引導係數(0–1)。數值越高,生成結果越貼近 prompt。
multi_shots boolean 啟用多鏡頭場景生成,每個片段可使用不同 prompt。

OpenClaw 上的 Kling 是什麼?

Kuaishou 的 Kling 3.0 以強大的布料模擬、流體動力學和動態物理著稱,能生成電影品質的影片。它能從文字或圖像生成最長 3 分鐘、最高 1080p 的片段,支援原生音訊和多鏡頭場景。OpenClaw 代理透過 RunAPI 端點,使用與聊天相同的 API key 呼叫它。

Kling 使用情境

B-roll 與場景建立鏡頭

在緊迫的截止期限內生成場景長度的 B-roll 素材——Kling 的動態物理和電影光線效果讓自然風光、旅遊內容和環境影像格外突出。

商品生活風格內容

從單張圖像或文字提示詞,為食品、時尚或生活風格品牌製作商品影片,具備自然的攝影機動作和逼真的材質渲染。

社群媒體短片

製作適合 TikTok、Reels 或 YouTube Shorts 的電影風格短片。將 duration_seconds 設為 5 或 10,即可輸出符合平台長度的影片。

FAQ

Kling + OpenClaw 常見問題

OpenClaw 通用設定

尚未設定?請從 OpenClaw 的 RunAPI 設定指南開始。

OpenClaw 設定指南 →

Kling 模型目錄

查看所有 Kling 版本、定價方案及 API 文件。

Kling 模型 →

立即在 OpenClaw 中試用 Kling。

取得免費 RunAPI key,將 prompt 貼入 OpenClaw,即可開始使用 Kling 3.0 生成影片。