Kwaivgi Kling Video O3 4k Video Edit API Documentation
Playground
Try it on WaveSpeedAI!Kling O3 Omni 4K Video Edit edits input videos in 4K with natural-language instructions and optional image references, supporting prompt-guided video modification, visual style updates, scene refinements, motion control, and high-quality cinematic editing. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.
Features
Kling O3 Omni 4K Video Edit edits an existing video in 4K using natural-language instructions. Provide an input video and describe the changes you want to apply, then optionally add image references or Kling element IDs to guide subject, object, scene, or style edits.
Why Choose This?
-
Prompt-guided video editing
Describe the desired changes in natural language instead of building a manual editing pipeline. -
Context-aware video edits
Use the input video as the base context while applying subject, object, scene, or style changes. -
4K video output
Generate high-resolution edited videos for polished delivery workflows. -
Image reference support
Add optional image references to guide replacement objects, scene details, or visual style. -
Element reference support
Useelement_listto reference reusable Kling elements byelement_id. -
Original sound preservation
Keep the original input audio withkeep_original_sound.
Parameters
| Parameter | Required | Description |
|---|---|---|
| prompt | Yes | Describe the changes to apply to the input video. |
| video | Yes | Input video to edit. |
| images | No | Optional images that guide an element, scene, or style edit. Supports up to 4 image URLs. |
| keep_original_sound | No | Keep the original audio from the input video. Default: true. |
| element_list | No | Element reference list. Supports up to 3 items. Each item uses an element_id returned by kwaivgi/kling-elements or kwaivgi/kling-elements-advanced. |
How to Use
- Upload the input video — Provide the video you want to edit.
- Write your edit prompt — Describe what should change and what should remain consistent.
- Add image references optional — Use
imageswhen replacement objects, scene details, or style references are needed. - Add element references optional — Use
element_listwhen you want to guide the edit with existing Kling element IDs. - Configure sound optional — Keep
keep_original_soundenabled when the original video audio should be preserved. - Submit — Generate the final 4K edited video.
Pricing
Pricing is based on input video duration.
Input duration is rounded up to the next whole second, with a minimum billed duration of 3 seconds and a maximum billed duration of 16 seconds.
| Billing Unit | Price |
|---|---|
| Per second | $0.462 |
| Per 5 seconds | $2.31 |
Example Costs
| Billed Duration | Cost |
|---|---|
| 3 seconds | $1.386 |
| 5 seconds | $2.31 |
| 10 seconds | $4.62 |
| 16 seconds | $7.392 |
images, element_list, prompt, and keep_original_sound do not add separate charges in the current pricing formula.
Best Use Cases
- Video restyling — Change the visual style, tone, lighting, or atmosphere of an existing clip.
- Subject and object edits — Modify characters, products, props, or scene elements while preserving video context.
- Element-guided editing — Use existing Kling element IDs for stronger subject or object guidance.
- Commercial video edits — Refine product clips, ads, campaign assets, and social media videos.
- 4K creative delivery — Produce high-resolution edited videos for polished output.
- Reference-guided transformations — Combine prompt instructions, image references, and element IDs for more controlled edits.
Pro Tips
- Keep edit prompts focused on the specific change you want.
- Describe what should remain unchanged, especially subject motion, camera movement, background, or lighting.
- Use image references when subject, object, or style consistency matters.
- Use
element_listwhen you already have reusable Kling element IDs. - Keep
element_listfocused; too many unrelated elements can reduce edit control. - Enable
keep_original_soundwhen the input video’s audio should be retained. - Use clean source videos with clear subjects and stable motion for better edit results.
Notes
promptandvideoare required.imagessupports up to4reference images.element_listsupports up to3element references.- Each
element_listitem must include anelement_id. element_idshould come fromkwaivgi/kling-elementsorkwaivgi/kling-elements-advanced.- Input duration is billed from
3to16seconds. - Edit mode uses the input video as the base context, and output duration follows the input video.
- Native generated audio is unavailable with a base video, but original input audio can be retained.
Related Models
- Kling O3 Omni 4K Video Reference — Generate 4K videos using an input video as a reference.
- Kling O3 Omni 4K Video Edit — Edit an existing 4K video with prompt instructions.
- Kling Elements Advanced — Generate reusable Kling elements that can be used as
element_idreferences.
Authentication
For authentication details, please refer to the Authentication Guide.
API Endpoints
Submit Task & Query Result
set -euo pipefail
export WAVESPEED_API_KEY="your-api-key"
REQUEST_BODY=$(cat <<'JSON'
{
"prompt": "A cinematic ocean wave at sunrise, highly detailed",
"video": "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4",
"keep_original_sound": true
}
JSON
)
# 1. Submit the prediction.
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
-X POST "https://api.wavespeed.ai/api/v3/kwaivgi/kling-video-o3-4k/video-edit" \
-H "Authorization: Bearer ${WAVESPEED_API_KEY}" \
-H "Content-Type: application/json" \
-d "${REQUEST_BODY}")
TASK=$(printf '%s' "${SUBMIT_RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
PREDICTION_ID=$(printf '%s' "${TASK}" | jq -r '.id // empty')
if [ -z "${PREDICTION_ID}" ]; then
printf 'Submission response did not contain a prediction id
' >&2
exit 1
fi
RESULT_URL="https://api.wavespeed.ai/api/v3/predictions/${PREDICTION_ID}/result"
# 2. Poll until the prediction finishes.
while true; do
RESPONSE=$(curl --silent --show-error --fail-with-body \
"${RESULT_URL}" \
-H "Authorization: Bearer ${WAVESPEED_API_KEY}")
RESULT=$(printf '%s' "${RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
STATUS=$(printf '%s' "${RESULT}" | jq -r '.status // empty')
case "${STATUS}" in
completed) printf '%s\n' "${RESULT}" | jq '.outputs'; break ;;
failed|cancelled|timeout|deleted) printf '%s\n' "${RESULT}" | jq . >&2; exit 1 ;;
*) sleep 2 ;;
esac
doneParameters
Task Submission Parameters
Request Parameters
| Parameter | Type | Required | Default | Range | Description |
|---|---|---|---|---|---|
| prompt | string | Yes | - | Describe the changes to apply to the input video. | |
| video | string | Yes | - | Input video to edit. | |
| images | array<string> | No | - | 0 ~ 4 items | Optional images that guide an element, scene, or style edit. |
| keep_original_sound | boolean | No | true | - | Keep the original audio from the input video. |
| element_list | array<object> | No | - | 0 ~ 3 items | Element reference list. |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | integer | HTTP status code (e.g., 200 for success) |
| message | string | Status message (e.g., “success”) |
| data.id | string | Unique identifier for the prediction, Task Id |
| data.model | string | Model ID used for the prediction |
| data.outputs | array | Output values, usually URL strings; some models return text strings or structured result objects (empty when status is not completed) |
| data.urls | object | Object containing related API endpoints |
| data.status | string | Task status. completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses. |
| data.created_at | string | ISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”) |
| data.error | string | Error message (empty if no error occurred) |
| data.timings | object | Object containing timing details |
| data.timings.inference | integer | Inference time in milliseconds |
Result Request Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| id | string | Yes | - | Task ID |
Result Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | integer | HTTP status code (e.g., 200 for success) |
| message | string | Status message (e.g., “success”) |
| data | object | The prediction data object containing all details |
| data.id | string | Unique identifier for the prediction |
| data.model | string | Model ID used for the prediction |
| data.outputs | array<string | object> | Array of generated outputs (empty when status is not completed). Items are usually URL strings, but may be text strings or structured result objects, depending on the model. |
| data.urls | object | Object containing related API endpoints |
| data.status | string | Status: completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses |
| data.created_at | string | ISO timestamp of when the request was created |
| data.error | string | Error message (empty if no error occurred) |
| data.timings | object | Object containing timing details |
| data.timings.inference | integer | Inference time in milliseconds |