HERMES + KLING

在 Hermes Agent 中使用 Kling。

Kling 3.0 由 Kuaishou 開發,可從文字或圖片生成最高 1080p 的影片,支援原生音訊、多鏡頭場景及 3–15 秒時長。Hermes Agent 透過 RunAPI 的 custom:runapi provider 呼叫 Kling — 使用與聊天相同的 key 和 base URL。

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

Requirements:
- Use the custom:runapi provider already configured in Hermes Agent
- Call POST https://runapi.ai/api/v1/kling/text_to_video
- Set model to "kling-3.0"
- The RUNAPI_API_KEY environment variable provides authorization
- 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
運作原理

三步驟在 Hermes Agent 中使用 Kling

1

設定 RunAPI

設定 RUNAPI_API_KEY 環境變數。如果你已在 Hermes Agent 中新增 RunAPI 為 custom:runapi provider 用於聊天,同一把 key 和 base_url 即可用於影片生成 — 無需額外設定。

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。

Hermes Agent 上的 Kling 是什麼?

Kuaishou 的 Kling 3.0 以角色一致性和強大的動態物理見長,能生成電影品質的片段——布料垂墜、流體動力學和逼真的攝影機運動。透過 Hermes Agent 的 custom:runapi provider,可獲得最高 1080p、支援原生音訊的文生影片和圖生影片,生成時長 3 至 15 秒(或透過多鏡頭模式最長達 3 分鐘)的片段。

Kling 使用情境

較長的敘事內容

使用 Kling 的多鏡頭模式,將建立鏡頭和角色序列串接成最長 3 分鐘的場景長度影片,各片段間保持一致的視覺效果。

旅遊與自然內容

以逼真的環境渲染生成旅遊 vlog B-roll 和自然影片。Kling 在處理戶外場景的水景、薄霧和大氣光線方面表現出色。

商品示範影片

將商品圖像轉化為帶有攝影機運動和自然光線轉換的短片——適用於電商商品列表和社群媒體廣告。

FAQ

Kling + Hermes Agent 常見問題

Hermes Agent 通用設定

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

Hermes Agent 設定指南 →

Kling 模型目錄

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

Kling 模型 →

立即在 Hermes Agent 中試用 Kling。

取得免費 RunAPI key,設定 custom:runapi provider,即可開始使用 Kling 3.0 生成影片。