imagestringbắt buộc
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.
Thử model
PNG, JPEG, WebP hoặc GIF · tối đa 20 MiB
PNG, JPEG, WebP hoặc GIF · tối đa 20 MiB
Bạn muốn làm gì tiếp theo?
Chọn một ví dụ để nạp đầu vào và kết quả của nó vào 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.
Bắt đầu xây dựng
Gửi model này qua 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"Tạo một SandBase API key và đặt nó trong môi trường máy chủ của bạn. Tất cả request sử dụng xác thực Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Giữ key trên máy chủ. Không hiển thị trong mã trình duyệt hoặc commit vào repository.
POST tới /v1/run với model ID này và các đầu vào của nó. Ví dụ request ở trên bao gồm cả bước gửi và polling.
Dùng run ID được trả về để poll cho đến khi trạng thái là completed, failed hoặc timeout. Chỉ đọc đầu ra sau khi completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Cung cấp một URL tệp có thể truy cập công khai trong trường image, video hoặc audio của model. Các định dạng và giới hạn được hỗ trợ hiển thị bên cạnh từng input trong Playground.
Dùng điều khiển upload hoặc replace trên các trường image được hỗ trợ trong Playground. Trường URL video chấp nhận một video driving được host; điều này không đồng nghĩa hỗ trợ tải lên video.
imagestringbắt buộcURL of the image to be used for the video
promptstringbắt buộcText prompt for video generation. Either prompt or multi_prompt must be provided, but not both.
durationintegerThe duration of the generated video in seconds
Mặc định: 5
Giá trị có thể dùng: 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.
Mặc định: "customize"
Giá trị có thể dùng: "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.
Mặc định: 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
}Một run đã hoàn tất sẽ hiển thị kết quả trong output. Phần sau là ví dụ đã lưu của model, không phải một lần tạo mới.
[
{
"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"
}
]