videostringbắt buộc
Reference video URL. Only .mp4/.mov formats, 3-10s duration, 720-2160px resolution, max 200MB.
kwaivgi/kling-video/o3/pro/editKling O3 Pro Video Edit by Kuaishou edits an input video from a text instruction, optionally guided by reference images, at 1080p.
Thử model
PNG, JPEG, WebP, or GIF · 20 MiB maximum each
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.
{
"prompt": "Change environment to be fully snow as @Image1. Replace animal with @Element1",
"video": "https://static.sandbase.ai/examples/f2a6296e-188b-460a-9d91-c0a68096ad4d/input/6cbd685e-53b2-47f5-8076-57ab4e2684e4.mp4"
}Kling O3 Pro video edit: change an existing clip with an instruction, such as restyling it or swapping objects or people, while motion and camera are kept. Reference images can supply the new look.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Up to 2,500 characters. |
images | image URL[] | — | Optional reference images, @Image1, @Image2, … |
video | video URL, required | — | Source clip, @Video1 in the prompt. |
shot_type | string | customize | customize follows your multi_prompt shot list; intelligent lets the model plan the cuts. |
keep_audio | boolean | true | Keep the source video's audio track. |
You pay $0.168 per second of the source video. The quote before submission assumes 15 seconds; the final charge uses the measured length.
| Source clip | Price |
|---|---|
| 3s source | $0.504 |
| 5s source | $0.84 |
| 10s source | $1.68 |
| 15s source | $2.52 |
Failed runs are not charged.
Other Kling O3 Pro endpoints and tiers: kwaivgi/kling-video/o3/pro/text-to-video, kwaivgi/kling-video/o3/pro/image-to-video, kwaivgi/kling-video/o3/pro/reference-to-video, kwaivgi/kling-video/o3/pro/video-to-video, kwaivgi/kling-video/o3/standard/edit, kwaivgi/kling-video/o3/4k/edit.
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/o3/pro/edit",
"video": "https://static.sandbase.ai/examples/kwaivgi/mirrored/example_inputs/kling-o3/pro-v2v-edit/video_reference.mp4",
"images": [
"https://static.sandbase.ai/examples/kwaivgi/mirrored/example_inputs/kling-o3/pro-v2v-edit/image_url1.jpg"
],
"prompt": "Change environment to be fully snow as @Image1. Replace animal with @Element1",
"shot_type": "customize",
"keep_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.
videostringbắt buộcReference video URL. Only .mp4/.mov formats, 3-10s duration, 720-2160px resolution, max 200MB.
imagesarrayReference images for style/appearance. Reference in prompt as @Image1, @Image2, etc. Maximum 4 total (elements + reference images) when using video.
promptstringbắt buộcText prompt for video generation. Reference video as @Video1.
shot_typestringThe type of multi-shot video generation.
Mặc định: "customize"
keep_audiobooleanWhether to keep the original audio from the reference video.
Mặc định: true
{
"model": "kwaivgi/kling-video/o3/pro/edit",
"video": "https://static.sandbase.ai/examples/kwaivgi/mirrored/example_inputs/kling-o3/pro-v2v-edit/video_reference.mp4",
"images": [
"https://static.sandbase.ai/examples/kwaivgi/mirrored/example_inputs/kling-o3/pro-v2v-edit/image_url1.jpg"
],
"prompt": "Change environment to be fully snow as @Image1. Replace animal with @Element1",
"shot_type": "customize",
"keep_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/85513ed0d7d10db979c7.jpg",
"source": "Kling AI official schema mirror",
"source_url": "https://kling.ai/document-api/guides/get-started/overview",
"url": "https://static.sandbase.ai/examples/f2a6296e-188b-460a-9d91-c0a68096ad4d/output/e9b82d31-82ed-4540-8cd0-86f4eb168d63.mp4"
}
]