Kling 4.0 video editing changes expressions, motion, style or backgrounds of a 3–30 second clip from an instruction, keeping the rest of the scene stable. It is part of Kling AI's new-generation Kling 4.0 video model family and is available on AI/ML API through the video generation endpoint.
Background and style changes
Swap locations, lighting or visual style without reshooting.
Performance tweaks
Adjust expressions or motion while keeping the rest of the shot intact.
Object and character insertion
Add products or characters from reference images into existing footage.
Kling 4.0 Video Editing changes an existing 3–30 second clip from a text instruction, while keeping the rest of the scene stable.
It fits background swaps, restyling and lighting changes without reshooting footage.
Expressions and motion can be adjusted, which suits fixing or refining a performance in post-production.
Reference images and elements let you insert specific products or characters into the source video.
import requests, time headers = {"Authorization": "Bearer " + AIMLAPI_KEY} job = requests.post( "https://api.aimlapi.com/v2/video/generations", headers=headers, json={ "model": "klingai/video-v4-video-to-video-edit", "prompt": "Change the background of @Video1 to a snowy forest", "video_url": "https://example.com/input.mp4", "resolution": "1080p" }, ).json() gid = job["id"] while True: res = requests.get(f"https://api.aimlapi.com/v2/video/generations?generation_id={gid}", headers=headers).json() if res.get("status") in ("completed", "error"): break time.sleep(15) print(res["video"]["url"])
const headers = { Authorization: `Bearer ${process.env.AIMLAPI_KEY}`, "Content-Type": "application/json", }; const job = await (await fetch("https://api.aimlapi.com/v2/video/generations", { method: "POST", headers, body: JSON.stringify({ "model": "klingai/video-v4-video-to-video-edit", "prompt": "Change the background of @Video1 to a snowy forest", "video_url": "https://example.com/input.mp4", "resolution": "1080p" }), })).json(); let res; do { await new Promise((r) => setTimeout(r, 15000)); res = await (await fetch(`https://api.aimlapi.com/v2/video/generations?generation_id=${job.id}`, { headers })).json(); } while (!["completed", "error"].includes(res.status)); console.log(res.video.url);
# submit the generation — the response contains the job "id" curl -X POST https://api.aimlapi.com/v2/video/generations \ -H "Authorization: Bearer $AIMLAPI_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "klingai/video-v4-video-to-video-edit", "prompt": "Change the background of @Video1 to a snowy forest", "video_url": "https://example.com/input.mp4", "resolution": "1080p"}' # then poll until status is "completed" — video.url holds the result curl "https://api.aimlapi.com/v2/video/generations?generation_id={id}" -H "Authorization: Bearer $AIMLAPI_KEY"
OpenAI-compatible — swap the base URL and it works with your existing SDK.
| Type | Price |
|---|---|
| Output | |
Billed per second of video: 720p — $0.188 / sec, 1080p — $0.282 / sec. Clips from 3 to 30 seconds.
| Model | Input | Output | Context | Best for |
|---|---|---|---|---|
Kling 4.0 Video Editing This page | Video generation |
Kling 4.0 Video Editing changes the expressions, motion, style or background of an existing 3–30 second clip from a text instruction, while keeping the rest of the scene stable.
It takes a source video (video_url) and an edit instruction, plus optional reference images and elements, and returns the edited video. The edited video keeps the length of the source.
Source videos must be 3–30 seconds long, up to 300MB, 700–4553px per side, with an aspect ratio between 0.4 and 2.5 and 24–60 fps.
Kling 4.0 Video Editing is billed per second of video: $0.188 per second at 720p and $0.282 per second at 1080p.
Refer to the source video as @Video1, to reference images as @Image1, @Image2 and to elements as @Element1, @Element2. For example: Change the background of @Video1 to a snowy forest.
Submit a POST request to https://api.aimlapi.com/v2/video/generations with the model ID klingai/video-v4-video-to-video-edit, a video_url and a prompt, then poll with the returned generation_id until the status is completed.