imagestring必填
URL of the image to be used for the video
kwaivgi/kling-video/v3/4k/image-to-videoKling V3 4K Image to Video by Kuaishou animates a start image, optionally toward an end image, into a 3-15 second native 4K video with optional native audio.
试用该模型
PNG、JPEG、WebP 或 GIF · 最大 20 MiB
PNG、JPEG、WebP 或 GIF · 最大 20 MiB
下一步想做什么?
选择一个示例,将其输入和结果加载到 playground 中。
{
"image": "https://static.sandbase.ai/examples/edc32b1c-48f4-4712-aaf8-521e0bea4c85/input/ffa610b5-e951-42dd-9649-fb6c1183c9c6.png",
"prompt": "The craftsman slowly examines the bowl, turning it gently in his weathered hands. His eyes reflect years of wisdom. Subtle smile forms on his face. Dust particles drift in warm light. Breathing motion, blinking eyes."
}Kling V3 4K image-to-video: image anchors the first frame, end_image optionally the last, with native audio and multi-shot control. Output is native 4K.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Up to 2,500 characters. |
image | image URL, required | — | First frame. JPEG, PNG, or WebP URL. |
end_image | image URL | — | Optional last frame. |
duration | 3–15 | 5 | Output length in seconds. |
generate_audio | boolean | true | 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 $0.42 per output second, with or without audio.
| Output | Price |
|---|---|
| 3s | $1.26 |
| 5s (default) | $2.10 |
| 10s | $4.20 |
| 15s | $6.30 |
Failed runs are not charged.
multi_prompt with one entry per shot.Other Kling V3 4K endpoints and tiers: kwaivgi/kling-video/v3/4k/text-to-video, kwaivgi/kling-video/v3/standard/image-to-video, kwaivgi/kling-video/v3/pro/image-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/v3/4k/image-to-video",
"image": "https://static.sandbase.ai/examples/kwaivgi/mirrored/example_inputs/kling-v3/pro-i2v/start_image.png",
"prompt": "The craftsman slowly examines the bowl, turning it gently in his weathered hands. His eyes reflect years of wisdom. Subtle smile forms on his face. Dust particles drift in warm light. Breathing motion, blinking eyes.",
"duration": 12,
"shot_type": "customize",
"generate_audio": true
}
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;这并不表示支持视频上传。
imagestring必填URL of the image to be used for the video
promptstring必填Text prompt for video generation. Either prompt or multi_prompt must be provided, but not both.
durationintegerThe duration of the generated video in seconds
默认值:5
可选值:3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
end_imagestringURL of the image to be used for the end of the video
shot_typestringThe type of multi-shot video generation. 'intelligent' lets the model automatically determine shot structure.
默认值:"customize"
可选值:"customize", "intelligent"
multi_promptarrayList of prompts for multi-shot video generation. If provided, divides the video into multiple shots.
generate_audiobooleanWhether to generate native audio for the video. Supports Chinese and English voice output. Other languages are automatically translated to English. For English speech, use lowercase letters; for acronyms or proper nouns, use uppercase.
默认值:true
{
"model": "kwaivgi/kling-video/v3/4k/image-to-video",
"image": "https://static.sandbase.ai/examples/kwaivgi/mirrored/example_inputs/kling-v3/pro-i2v/start_image.png",
"prompt": "The craftsman slowly examines the bowl, turning it gently in his weathered hands. His eyes reflect years of wisdom. Subtle smile forms on his face. Dust particles drift in warm light. Breathing motion, blinking eyes.",
"duration": 12,
"shot_type": "customize",
"generate_audio": true
}已完成的运行会在输出中展示结果。以下内容是该模型保存的示例,而不是新的生成结果。
[
{
"poster": "https://static.sandbase.ai/examples/posters/d10e897bd0cdf909b44d.jpg",
"source": "Kling AI official schema mirror",
"source_url": "https://kling.ai/document-api/guides/get-started/overview",
"url": "https://static.sandbase.ai/examples/edc32b1c-48f4-4712-aaf8-521e0bea4c85/output/91ce0d60-daf0-4df4-9752-8e2977c519c0.mp4"
}
]