promptstring必填
Text prompt for video generation. Required unless multi_prompt is provided.
kwaivgi/kling-video/o3/pro/text-to-videoKling O3 Pro Text to Video by Kuaishou turns a text prompt into a 3-15 second 1080p video with optional native audio.
试用该模型
下一步想做什么?
选择一个示例,将其输入和结果加载到 playground 中。
{
"prompt": "A mecha lands on the ground to save the city, and says \"I'm here\", in anime style"
}人类偏好
基于盲测两两对比投票的 Elo 评分,与其他图像和视频模型进行比较。
文生视频 arena(无声):在不看到模型名称的情况下,用户从同一提示词生成的两段视频中选出更优的一段;不评判音频。
Kling O3 Pro text-to-video, the quality-first O3 tier. Write a scene, optionally split into shots with multi_prompt, and get back a 3–15 second clip.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Up to 2,500 characters. |
aspect_ratio | 16:9 / 9:16 / 1:1 | 16:9 | Output frame shape. |
duration | 3–15 | 5 | Output length in seconds. |
generate_audio | boolean | false | Generate native audio with the clip. |
shot_type | customize / intelligent | customize | customize follows your multi_prompt shot list; intelligent lets the model plan the cuts. |
multi_prompt | object[] | — | Optional list of shots, each with its own prompt and duration. |
You pay for output seconds: $0.112 without audio and $0.14 with generate_audio.
| Output | Without audio | With audio |
|---|---|---|
| 3s | $0.336 | $0.42 |
| 5s (default) | $0.56 | $0.70 |
| 10s | $1.12 | $1.40 |
| 15s | $1.68 | $2.10 |
Failed runs are not charged.
multi_prompt with one entry per shot.Other Kling O3 Pro endpoints and tiers: kwaivgi/kling-video/o3/pro/image-to-video, kwaivgi/kling-video/o3/pro/reference-to-video, kwaivgi/kling-video/o3/pro/edit, kwaivgi/kling-video/o3/pro/video-to-video, kwaivgi/kling-video/o3/standard/text-to-video, kwaivgi/kling-video/o3/4k/text-to-video.
开始构建
通过 SandBase Unified Run API 提交此模型。
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "kwaivgi/kling-video/o3/pro/text-to-video",
"prompt": "A mecha lands on the ground to save the city, and says \"I'm here\", in anime style",
"duration": 5,
"shot_type": "customize",
"aspect_ratio": "16:9",
"generate_audio": false
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"创建一个 SandBase API 密钥,并将其设置到服务器环境中。所有请求都使用 Bearer 身份验证。
export SANDBASE_API_KEY="YOUR_API_KEY"请将密钥保存在服务器端。不要在浏览器代码中暴露它,也不要提交到仓库。
使用此模型 ID 及其输入向 /v1/run 发送 POST 请求。上方的请求示例包含提交和轮询。
使用返回的运行 ID 轮询,直到状态为 completed、failed 或 timeout。仅在 completed 后读取输出。
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"在模型的 image、video 或 audio 字段中传入一个可公开访问的文件 URL。支持的格式和限制显示在每个 Playground 输入项旁边。
在 Playground 中支持的图片字段上使用上传或替换控件。视频 URL 字段接受托管的 driving video;这并不表示支持视频上传。
promptstring必填Text prompt for video generation. Required unless multi_prompt is provided.
durationintegerVideo duration in seconds (3-15s).
默认值:5
可选值:3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
shot_typestringThe type of multi-shot video generation. 'intelligent' lets the model automatically determine shot structure.
默认值:"customize"
可选值:"customize", "intelligent"
aspect_ratiostringThe aspect ratio of the generated image.
默认值:"16:9"
可选值:"16:9", "9:16", "1:1"
multi_promptarrayList of prompts for multi-shot video generation.
generate_audiobooleanWhether to generate native audio for the video.
默认值:false
{
"model": "kwaivgi/kling-video/o3/pro/text-to-video",
"prompt": "A mecha lands on the ground to save the city, and says \"I'm here\", in anime style",
"duration": 5,
"shot_type": "customize",
"aspect_ratio": "16:9",
"generate_audio": false
}已完成的运行会在输出中展示结果。以下内容是该模型保存的示例,而不是新的生成结果。
[
{
"poster": "https://static.sandbase.ai/examples/posters/07e592c54be05ebaf28e.jpg",
"source": "Kling AI official schema mirror",
"source_url": "https://kling.ai/document-api/guides/get-started/overview",
"url": "https://static.sandbase.ai/examples/bc3450c4-d1db-4ec3-9ebb-3e05d5092c95/output/123f51f6-c974-4393-b299-6b4ba375297c.mp4"
}
]