在 Hermes Agent 中使用 Kling。
Kuaishou 推出的 Kling 3.0 可从文本或图像生成最高 1080p 的视频,支持原生音频、多镜头场景以及 3–15 秒时长。Hermes Agent 通过 custom:runapi 提供方使用 RunAPI 调用它——与你为聊天配置的密钥和基础 URL 相同。
通过 Hermes Agent 使用 RunAPI 借助 Kling 3.0 生成视频。
要求:
- 使用 Hermes Agent 中已配置的 custom:runapi 提供方
- 调用 POST https://runapi.ai/api/v1/kling/text_to_video
- 将 model 设置为 "kling-3.0"
- RUNAPI_API_KEY 环境变量提供授权
- 设置 duration_seconds 控制时长(3–15 秒)
- 将 aspect_ratio 设置为 "16:9" 以生成横向视频
- 使用 enable_sound: true 启用原生音频
- 响应是异步的——轮询任务状态端点直到任务完成,然后获取视频 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"
}
三步在 Hermes Agent 中使用 Kling
Configure RunAPI
Set the RUNAPI_API_KEY environment variable. If you already added RunAPI as a custom:runapi provider in Hermes Agent for chat, the same key and base_url work for video generation — no extra configuration needed.
export RUNAPI_API_KEY=runapi_xxx
Call Kling text_to_video
Send a POST to /api/v1/kling/text_to_video with model set to kling-3.0. Include a prompt, duration_seconds (3–15), aspect_ratio, and optionally enable_sound for native audio. For image-driven generation, use /api/v1/kling/image_to_video with a first_frame_image_url instead.
POST /api/v1/kling/text_to_video
Poll for the result
The endpoint returns a task_id immediately. Poll the task status endpoint until the status changes to completed, then retrieve the video URL from the response. Generation typically takes 30–120 seconds depending on duration and resolution.
GET /api/v1/kling/text_to_video/tsk_abc123
Kling text_to_video API 参数
| 参数 | 类型 | 说明 |
|---|---|---|
model |
string |
Required. kling-3.0 for the latest version. |
prompt |
string |
Video description. Required unless multi_shots is enabled. |
duration_seconds |
integer |
Video length. Kling 3.0 supports 3–15 seconds. Older versions accept 5 or 10. |
aspect_ratio |
string |
Output aspect ratio: 16:9, 9:16, or 1:1. |
output_resolution |
string |
Resolution: 720p, 1080p, or 4k. Higher resolution costs more per second. |
enable_sound |
boolean |
Generate native audio alongside video. Increases per-second cost. |
negative_prompt |
string |
Elements to exclude from generation. |
first_frame_image_url |
string |
Image URL to use as the opening frame (single-shot mode). |
cfg_scale |
number |
Guidance scale (0–1). Higher values follow the prompt more closely. |
multi_shots |
boolean |
Enable multi-shot scene generation with separate prompts per segment. |
Hermes Agent 上的 Kling 是什么?
快手的 Kling 3.0 能生成角色一致、运动物理出色的电影级短片——布料垂感、流体动力学和写实镜头运动。通过 Hermes Agent 的 custom:runapi provider,可实现最高 1080p、带原生音频的文生视频和图生视频,单次生成时长 3 至 15 秒(多镜头模式最长 3 分钟)。
Kling 使用场景
长叙事内容
使用 Kling 的多镜头模式构建最长 3 分钟的场景级素材,在各段落间保持一致的视觉效果,串联空镜和角色序列。
旅游与自然内容
生成旅游 vlog B-roll 和自然素材,写实环境渲染效果出色。Kling 在处理水面、薄雾和大气光效等户外场景时表现尤为突出。
产品演示视频
将产品图像动画化为带镜头运动和自然光线过渡的短视频——适用于电商列表和社交广告。
Kling + Hermes Agent 常见问题
Kling charges per second of generated video. The rate depends on output_resolution and whether enable_sound is on. A 5-second 720p clip without sound is the cheapest option; 1080p with sound costs roughly twice as much per second. Check the RunAPI pricing page for exact rates.
Kling supports 3 to 15 seconds per clip (and multi-shot sequences up to 3 minutes), while Runway caps at 5 or 10 seconds. For scene-length footage, Kling gives you more flexibility. Runway tends to produce cleaner cinematic framing on shorter clips.
Yes. RunAPI also hosts kling-v2.5-turbo-text-to-video-pro and kling-v2.5-turbo-image-to-video-pro for faster, lower-cost generation at 5 or 10 seconds. Set the model parameter to the version slug you want.
No. If you already configured the custom:runapi provider in Hermes Agent for chat or image generation, the same base_url and API key work for Kling video endpoints. Just change the request path and model parameter.
No. RunAPI only bills for completed generations. If the task fails or times out, the reserved credits are rolled back to your account balance.
Hermes Agent calls the Kling endpoint with scene descriptions and camera control parameters through the custom:runapi provider. For multi-shot sequences, the agent can chain multiple generation calls and manage continuity between shots.
Yes. Hermes Agent can orchestrate Kling for video and then call ElevenLabs or Suno through RunAPI to add voiceover or background music, assembling the complete package in one workflow.