灵活的参数配置
可配置文档中列出的 11 个参数,包括 aspect_ratio, duration_seconds, enable_sound, first_frame_image_url, last_frame_image_url。
curl -X POST https://runapi.ai/api/v1/kling/image_to_video \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-o1",
"image_url": "https://cdn.runapi.ai/public/samples/image.jpg",
"prompt": "创建一段 10 秒的秋日森林漫步视频,落叶飘落,电影级运镜。"
}'
import { KlingClient } from "@runapi.ai/kling";
const client = new KlingClient();
const result = await client.imageToVideo.run({
model: "kling-o1",
image_url: "https://cdn.runapi.ai/public/samples/image.jpg",
prompt: "创建一段 10 秒的秋日森林漫步视频,落叶飘落,电影级运镜。",
});
import os
import requests
response = requests.post(
"https://runapi.ai/api/v1/kling/image_to_video",
headers={"Authorization": f"Bearer {os.environ['RUNAPI_API_KEY']}"},
json={"model":"kling-o1","image_url":"https://cdn.runapi.ai/public/samples/image.jpg","prompt":"创建一段 10 秒的秋日森林漫步视频,落叶飘落,电影级运镜。"}
)
response.raise_for_status()
<?php
$client = curl_init("https://runapi.ai/api/v1/kling/image_to_video");
curl_setopt_array($client, [
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("RUNAPI_API_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
'model' => 'kling-o1',
'image_url' => 'https://cdn.runapi.ai/public/samples/image.jpg',
'prompt' => '创建一段 10 秒的秋日森林漫步视频,落叶飘落,电影级运镜。',
])
]);
$response = curl_exec($client);
RunApi client = new RunApi(System.getenv("RUNAPI_API_KEY"));
Task task = client.imageToVideo().run({"model":"kling-o1","image_url":"https://cdn.runapi.ai/public/samples/image.jpg","prompt":"创建一段 10 秒的秋日森林漫步视频,落叶飘落,电影级运镜。"});
task.waitForResult();
require "runapi/kling"
client = RunApi::Kling::Client.new
result = client.image_to_video.run(
model: "kling-o1",
image_url: "https://cdn.runapi.ai/public/samples/image.jpg",
prompt: "创建一段 10 秒的秋日森林漫步视频,落叶飘落,电影级运镜。"
)
client := runapi.NewClient(os.Getenv("RUNAPI_API_KEY"))
task, err := client.imageToVideo.Run({"model":"kling-o1","image_url":"https://cdn.runapi.ai/public/samples/image.jpg","prompt":"创建一段 10 秒的秋日森林漫步视频,落叶飘落,电影级运镜。"})
if err != nil { log.Fatal(err) }
task.Wait()
$ runapi generate \
--model kling-o1 \
--endpoint image_to_video \
--wait
18 个版本可用
选择任意模型,几秒内开始生成。
选择任意模型,几秒内开始生成。
| 提供商 | Kuaishou |
| 模型 ID | kling-o1 |
| 模态 | Video |
| 任务类型 | Asynchronous |
| API 端点 | /api/v1/kling/text_to_video, /api/v1/kling/image_to_video |
| 计费单位 | second |
| 输入参数 | aspect_ratio, callback_url, duration_seconds, enable_sound, first_frame_image_url, last_frame_image_url, mode, model, preserve_reference_video_audio, prompt, reference_image_urls, reference_video_type, reference_video_url |
| 最大时长 | 5s |
| 宽高比 | 16:9, 9:16, 1:1 |
| 目录状态 | 运行中 |
免费注册后,在控制台创建用于 kling-o1 的 API 密钥。
向 /api/v1/kling/image_to_video 发送 POST 请求,并传入 kling-o1 模型 ID 和参数。
轮询任务或按照回调获取已完成的 kling-o1 结果。
可配置文档中列出的 11 个参数,包括 aspect_ratio, duration_seconds, enable_sound, first_frame_image_url, last_frame_image_url。
提供 2 个公开 endpoint:text_to_video, image_to_video。
异步任务支持回调 URL,任务完成时发送通知。
按 second 计量,无需订阅。
modeGeneration mode. (std, pro)
promptVideo description; reference media with matching numbered markers.
aspect_ratioOutput aspect ratio. (16:9, 9:16, 1:1)
callback_urlWebhook URL for async notifications.
enable_soundSound generation must remain disabled.
duration_secondsDuration in seconds. (5)
reference_video_urlPublic HTTP(S) MP4 or MOV reference video URL; cannot be combined with last_frame_image_url.
last_frame_image_urlPublic HTTP(S) JPG, JPEG, or PNG final-frame image URL; cannot be combined with reference_image_urls or reference_video_url.
reference_image_urlsOrdered public HTTP(S) JPG, JPEG, or PNG reference image URLs; cannot be combined with last_frame_image_url.
reference_video_typeUse the video as a base edit or feature reference. (base, feature)
first_frame_image_urlPublic HTTP(S) JPG, JPEG, or PNG first-frame image URL.
preserve_reference_video_audioPreserve the reference video's original audio.
从文字简报生成产品发布短视频和广告片段,将制作周期从数周缩短到数小时。
将课程脚本批量转换为动画讲解视频,无需摄像设备和拍摄团队。
直接从提示词生成社交平台短视频内容。
传入 quickstart 中显示的模型 ID。
Key 级限流随使用层级伸缩。当前限制见定价页。
可以——变体只是参数,改 model 字段即可。
模型支持流式时,RunAPI 端到端流式。
在公共 GitHub 仓库提 issue 或邮件联系 support。