curl --request POST \
--url https://api.goenhance.ai/api/v1/videos/generations \
--header 'Content-Type: application/json' \
--data '
{
"model": "kling-4-0-flash-edit",
"prompt": "Replace the coat worn by the person in <<<video_1>>> with the style in <<<image_1>>>",
"video_urls": [
"https://your-cdn.com/original.mp4"
],
"image_urls": [
"https://your-cdn.com/coat-style.jpg"
]
}
'import requests
url = "https://api.goenhance.ai/api/v1/videos/generations"
payload = {
"model": "kling-4-0-flash-edit",
"prompt": "Replace the coat worn by the person in <<<video_1>>> with the style in <<<image_1>>>",
"video_urls": ["https://your-cdn.com/original.mp4"],
"image_urls": ["https://your-cdn.com/coat-style.jpg"]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'kling-4-0-flash-edit',
prompt: 'Replace the coat worn by the person in <<<video_1>>> with the style in <<<image_1>>>',
video_urls: ['https://your-cdn.com/original.mp4'],
image_urls: ['https://your-cdn.com/coat-style.jpg']
})
};
fetch('https://api.goenhance.ai/api/v1/videos/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.goenhance.ai/api/v1/videos/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'kling-4-0-flash-edit',
'prompt' => 'Replace the coat worn by the person in <<<video_1>>> with the style in <<<image_1>>>',
'video_urls' => [
'https://your-cdn.com/original.mp4'
],
'image_urls' => [
'https://your-cdn.com/coat-style.jpg'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.goenhance.ai/api/v1/videos/generations"
payload := strings.NewReader("{\n \"model\": \"kling-4-0-flash-edit\",\n \"prompt\": \"Replace the coat worn by the person in <<<video_1>>> with the style in <<<image_1>>>\",\n \"video_urls\": [\n \"https://your-cdn.com/original.mp4\"\n ],\n \"image_urls\": [\n \"https://your-cdn.com/coat-style.jpg\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.goenhance.ai/api/v1/videos/generations")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"kling-4-0-flash-edit\",\n \"prompt\": \"Replace the coat worn by the person in <<<video_1>>> with the style in <<<image_1>>>\",\n \"video_urls\": [\n \"https://your-cdn.com/original.mp4\"\n ],\n \"image_urls\": [\n \"https://your-cdn.com/coat-style.jpg\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goenhance.ai/api/v1/videos/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"kling-4-0-flash-edit\",\n \"prompt\": \"Replace the coat worn by the person in <<<video_1>>> with the style in <<<image_1>>>\",\n \"video_urls\": [\n \"https://your-cdn.com/original.mp4\"\n ],\n \"image_urls\": [\n \"https://your-cdn.com/coat-style.jpg\"\n ]\n}"
response = http.request(request)
puts response.read_bodyKling 4.0 Flash Video Edit
Kling 4.0 Flash video edit. Change an existing clip of 3 to 20 seconds with a prompt — swap outfits, restyle the scene, regrade the colors — optionally guided by up to 10 style reference images. 720p only. The output keeps the aspect ratio and the original audio of your video.
Refer to the source video in prompt as <<<video_1>>> and to reference images as <<<image_1>>>, <<<image_2>>> … in the order of image_urls.
Pricing — in tokens (USD at $0.02/token), billed on output seconds + max(source video seconds, output seconds):
| resolution | tokens/s | USD/s |
|---|---|---|
| 720p | 3.7143 | $0.074286 |
The source video length is measured from your file before any tokens are charged, and rounded up to a whole second. With the default duration: "auto" the output is as long as the source, so a request is billed for twice the source length. Reference images are not charged.
Examples:
- 5-second source,
durationauto: 10 billed seconds, 37.14 tokens (= $0.7428) - 10-second source,
duration20: 40 billed seconds, 148.57 tokens (= $2.9714)
Returns an img_uuid; poll GET /api/v1/jobs/detail (or use custom_callback_url) to get the edited video.
Not accepted by this model (rejected before any tokens are charged): source videos longer than 20 seconds (they are not trimmed), ratio / aspect_ratio (the output follows the source video), sound / generate_audio (the output always keeps the audio of your video), negative_prompt, seed, image_url / image_end_url / keyframes, and 1080p / 4K.
curl --request POST \
--url https://api.goenhance.ai/api/v1/videos/generations \
--header 'Content-Type: application/json' \
--data '
{
"model": "kling-4-0-flash-edit",
"prompt": "Replace the coat worn by the person in <<<video_1>>> with the style in <<<image_1>>>",
"video_urls": [
"https://your-cdn.com/original.mp4"
],
"image_urls": [
"https://your-cdn.com/coat-style.jpg"
]
}
'import requests
url = "https://api.goenhance.ai/api/v1/videos/generations"
payload = {
"model": "kling-4-0-flash-edit",
"prompt": "Replace the coat worn by the person in <<<video_1>>> with the style in <<<image_1>>>",
"video_urls": ["https://your-cdn.com/original.mp4"],
"image_urls": ["https://your-cdn.com/coat-style.jpg"]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'kling-4-0-flash-edit',
prompt: 'Replace the coat worn by the person in <<<video_1>>> with the style in <<<image_1>>>',
video_urls: ['https://your-cdn.com/original.mp4'],
image_urls: ['https://your-cdn.com/coat-style.jpg']
})
};
fetch('https://api.goenhance.ai/api/v1/videos/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.goenhance.ai/api/v1/videos/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'kling-4-0-flash-edit',
'prompt' => 'Replace the coat worn by the person in <<<video_1>>> with the style in <<<image_1>>>',
'video_urls' => [
'https://your-cdn.com/original.mp4'
],
'image_urls' => [
'https://your-cdn.com/coat-style.jpg'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.goenhance.ai/api/v1/videos/generations"
payload := strings.NewReader("{\n \"model\": \"kling-4-0-flash-edit\",\n \"prompt\": \"Replace the coat worn by the person in <<<video_1>>> with the style in <<<image_1>>>\",\n \"video_urls\": [\n \"https://your-cdn.com/original.mp4\"\n ],\n \"image_urls\": [\n \"https://your-cdn.com/coat-style.jpg\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.goenhance.ai/api/v1/videos/generations")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"kling-4-0-flash-edit\",\n \"prompt\": \"Replace the coat worn by the person in <<<video_1>>> with the style in <<<image_1>>>\",\n \"video_urls\": [\n \"https://your-cdn.com/original.mp4\"\n ],\n \"image_urls\": [\n \"https://your-cdn.com/coat-style.jpg\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goenhance.ai/api/v1/videos/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"kling-4-0-flash-edit\",\n \"prompt\": \"Replace the coat worn by the person in <<<video_1>>> with the style in <<<image_1>>>\",\n \"video_urls\": [\n \"https://your-cdn.com/original.mp4\"\n ],\n \"image_urls\": [\n \"https://your-cdn.com/coat-style.jpg\"\n ]\n}"
response = http.request(request)
puts response.read_bodyHeaders
Body
Kling 4.0 Flash video edit (one source video, optional style reference images).
Pricing — per billed second (output + max(source, output)):
- 720p — 3.7143 tokens ($0.074286)
Model name. Must be kling-4-0-flash-edit on this page.
kling-4-0-flash-edit Editing instructions. Required, up to 2500 characters. Refer to the source video as <<<video_1>>> and to reference images as <<<image_1>>> …; a number with no matching asset is rejected.
2500The video to edit — exactly one URL. 3 to 20 seconds (longer videos are rejected, not trimmed). MP4 or MOV, up to 200MB, height 700-4553px.
1 elementOptional style reference image URLs (up to 10). <<<image_1>>> is the first item.
Up to 10MB each, width and height at least 300px, aspect ratio between 2:5 and 5:2. Smaller images are upscaled automatically.
10Output duration: "auto" (default) matches the source video, or any integer from 3 to 20 seconds. Billing uses output + max(source, output) seconds.
3 <= x <= 20Output resolution. Kling 4.0 Flash only supports 720p. quality is accepted as a compatible alias.
720p Optional. A publicly accessible HTTPS URL. When the task status changes (processing / success / failed), GoEnhance sends a POST request to this URL. The request body is identical to the response of GET /api/v1/jobs/detail. If your server does not respond with HTTP 200, the notification is retried up to 3 times, with a 3-second timeout per attempt.
"https://your-server.com/goenhance/callback"
