videostringrequired
Video to edit (3-30s, min 700x700 px, up to 300 MB). The output keeps its length.
kwaivgi/kling-video/v4/video-editKling V4 Video Edit by Kuaishou edits a 3-30 second source video from a text instruction and optional reference images.
Try the model
Customize your input with more control.
PNG, JPEG, WebP, or GIF · 20 MiB maximum each · up to 10
What would you like to do next?
Select an example to load its inputs and result into the playground.
{
"prompt": "Change the time of day in @Video1 to a starry night with the boat glowing softly, keep the camera motion.",
"video": "https://static.sandbase.ai/examples/c5782511-455d-4642-aed4-aee4d9a68521/input/cc801f7f-f034-4822-99db-04c72e2b9743.mp4"
}{
"prompt": "Restyle @Video1 as a hand-drawn watercolor animation, keep the vendor's motion and the flames.",
"video": "https://static.sandbase.ai/examples/8bd56a37-82da-4689-bfeb-b3d6e6db43dd/input/0ff13888-7225-4b82-bbe3-0ddbcabe39d0.mp4"
}Kling V4 video edit changes a 3–30 second source video from a text instruction, with optional reference images. The output keeps the source length.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Edit instruction. Refer to the source as @Video1 and images as @Image1, … |
video | video URL, required | — | 3–30s, min 700×700 px, up to 300 MB. |
images | image URL[] | — | Up to 10 reference images. |
resolution | 720p / 1080p | 1080p | Output resolution. |
$0.094 (720p) or $0.141 (1080p) per second, counted on input plus output (2× the source length). Settlement uses the output length (it matches the source); the quote before submission assumes a 30 second source when the length cannot be read.
| Source | Price |
|---|---|
| 6s, 1080p | $1.692 |
| 10s, 720p | $1.88 |
| 30s, 1080p | $8.46 |
| Failed runs are not charged. |
Other Kling V4 endpoints: kwaivgi/kling-video/v4/text-to-video, kwaivgi/kling-video/v4/image-to-video, kwaivgi/kling-video/v4/reference-to-video, kwaivgi/kling-video/v4/video-edit.
Start building
Submit this model through the 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/v4/video-edit",
"prompt": "Change the background to a tropical island at sunset.",
"resolution": "1080p"
}
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"Create a SandBase API key and set it in your server environment. All requests use Bearer authentication.
export SANDBASE_API_KEY="YOUR_API_KEY"Keep the key on your server. Do not expose it in browser code or commit it to a repository.
POST to /v1/run with this model ID and its inputs. The request example above includes submission and polling.
Use the returned run ID to poll until the status is completed, failed or timeout. Read output only after completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Pass a publicly accessible file URL in the model’s image, video or audio field. Supported formats and limits are shown beside each Playground input.
Use the upload or replace control on supported image fields in the Playground. Video URL fields accept a hosted driving video; they do not imply video-upload support.
videostringrequiredVideo to edit (3-30s, min 700x700 px, up to 300 MB). The output keeps its length.
imagesarrayOptional reference images, referenced as @Image1, @Image2, ...
promptstringrequiredEdit instruction. Refer to the source video as @Video1 and reference images as @Image1, @Image2, ...
resolutionstringOutput resolution.
Default: "1080p"
Possible values: "720p", "1080p"
{
"model": "kwaivgi/kling-video/v4/video-edit",
"prompt": "Change the background to a tropical island at sunset.",
"resolution": "1080p"
}A completed run exposes its result in output. The following is the model’s saved example, not a new generation.
[
{
"url": "https://static.sandbase.ai/examples/c5782511-455d-4642-aed4-aee4d9a68521/output/e7edbd9a-0c29-4b45-8e1d-701fba8ef596.mp4"
}
]