curl --request POST \
--url https://api.modellix.ai/api/v1/kling/kling-4.0-video-edit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "Edit @video_1. Remove the person in the foreground. Keep everything else unchanged.",
"video": "https://example.com/source.mp4"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'Edit @video_1. Remove the person in the foreground. Keep everything else unchanged.',
video: 'https://example.com/source.mp4'
})
};
fetch('https://api.modellix.ai/api/v1/kling/kling-4.0-video-edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.modellix.ai/api/v1/kling/kling-4.0-video-edit"
payload = {
"prompt": "Edit @video_1. Remove the person in the foreground. Keep everything else unchanged.",
"video": "https://example.com/source.mp4"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.modellix.ai/api/v1/kling/kling-4.0-video-edit"
payload := strings.NewReader("{\n \"prompt\": \"Edit @video_1. Remove the person in the foreground. Keep everything else unchanged.\",\n \"video\": \"https://example.com/source.mp4\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.modellix.ai/api/v1/kling/kling-4.0-video-edit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"Edit @video_1. Remove the person in the foreground. Keep everything else unchanged.\",\n \"video\": \"https://example.com/source.mp4\"\n}")
.asString();const url = 'https://api.modellix.ai/api/v1/kling/kling-4.0-video-edit';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'Edit @video_1. Remove the person in the foreground. Keep everything else unchanged.',
video: 'https://example.com/source.mp4'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.modellix.ai/api/v1/kling/kling-4.0-video-edit",
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([
'prompt' => 'Edit @video_1. Remove the person in the foreground. Keep everything else unchanged.',
'video' => 'https://example.com/source.mp4'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.modellix.ai/api/v1/kling/kling-4.0-video-edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"Edit @video_1. Remove the person in the foreground. Keep everything else unchanged.\",\n \"video\": \"https://example.com/source.mp4\"\n}"
response = http.request(request)
puts response.read_bodyimport Foundation
let parameters = [
"prompt": "Edit @video_1. Remove the person in the foreground. Keep everything else unchanged.",
"video": "https://example.com/source.mp4"
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.modellix.ai/api/v1/kling/kling-4.0-video-edit")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))$headers=@{}
$headers.Add("Authorization", "Bearer <token>")
$headers.Add("Content-Type", "application/json")
$response = Invoke-WebRequest -Uri 'https://api.modellix.ai/api/v1/kling/kling-4.0-video-edit' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"prompt": "Edit @video_1. Remove the person in the foreground. Keep everything else unchanged.",
"video": "https://example.com/source.mp4"
}'{
"code": 0,
"message": "success",
"data": {
"status": "pending",
"task_id": "task-kling4-example",
"model_id": "model-123",
"get_result": {
"method": "GET",
"url": "https://api.modellix.ai/api/v1/tasks/task-kling4-example"
}
}
}{
"code": 400,
"message": "Invalid parameters: prompt is required when multi_shot is false"
}{
"code": 401,
"message": "Authentication failed: invalid API key"
}{
"code": 429,
"message": "Rate limit exceeded: 100 requests per minute, retry after 60 seconds"
}{
"code": 500,
"message": "Internal server error"
}Kling 4.0 Video Edit
Reference-guided video editing for removing objects, restyling scenes, and revising existing footage. Image, video, and subject references help guide changes while keeping the surrounding scene and recognizable subjects consistent.
curl --request POST \
--url https://api.modellix.ai/api/v1/kling/kling-4.0-video-edit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "Edit @video_1. Remove the person in the foreground. Keep everything else unchanged.",
"video": "https://example.com/source.mp4"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'Edit @video_1. Remove the person in the foreground. Keep everything else unchanged.',
video: 'https://example.com/source.mp4'
})
};
fetch('https://api.modellix.ai/api/v1/kling/kling-4.0-video-edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.modellix.ai/api/v1/kling/kling-4.0-video-edit"
payload = {
"prompt": "Edit @video_1. Remove the person in the foreground. Keep everything else unchanged.",
"video": "https://example.com/source.mp4"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.modellix.ai/api/v1/kling/kling-4.0-video-edit"
payload := strings.NewReader("{\n \"prompt\": \"Edit @video_1. Remove the person in the foreground. Keep everything else unchanged.\",\n \"video\": \"https://example.com/source.mp4\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.modellix.ai/api/v1/kling/kling-4.0-video-edit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"Edit @video_1. Remove the person in the foreground. Keep everything else unchanged.\",\n \"video\": \"https://example.com/source.mp4\"\n}")
.asString();const url = 'https://api.modellix.ai/api/v1/kling/kling-4.0-video-edit';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'Edit @video_1. Remove the person in the foreground. Keep everything else unchanged.',
video: 'https://example.com/source.mp4'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.modellix.ai/api/v1/kling/kling-4.0-video-edit",
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([
'prompt' => 'Edit @video_1. Remove the person in the foreground. Keep everything else unchanged.',
'video' => 'https://example.com/source.mp4'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.modellix.ai/api/v1/kling/kling-4.0-video-edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"Edit @video_1. Remove the person in the foreground. Keep everything else unchanged.\",\n \"video\": \"https://example.com/source.mp4\"\n}"
response = http.request(request)
puts response.read_bodyimport Foundation
let parameters = [
"prompt": "Edit @video_1. Remove the person in the foreground. Keep everything else unchanged.",
"video": "https://example.com/source.mp4"
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.modellix.ai/api/v1/kling/kling-4.0-video-edit")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))$headers=@{}
$headers.Add("Authorization", "Bearer <token>")
$headers.Add("Content-Type", "application/json")
$response = Invoke-WebRequest -Uri 'https://api.modellix.ai/api/v1/kling/kling-4.0-video-edit' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"prompt": "Edit @video_1. Remove the person in the foreground. Keep everything else unchanged.",
"video": "https://example.com/source.mp4"
}'{
"code": 0,
"message": "success",
"data": {
"status": "pending",
"task_id": "task-kling4-example",
"model_id": "model-123",
"get_result": {
"method": "GET",
"url": "https://api.modellix.ai/api/v1/tasks/task-kling4-example"
}
}
}{
"code": 400,
"message": "Invalid parameters: prompt is required when multi_shot is false"
}{
"code": 401,
"message": "Authentication failed: invalid API key"
}{
"code": 429,
"message": "Rate limit exceeded: 100 requests per minute, retry after 60 seconds"
}{
"code": 500,
"message": "Internal server error"
}Body
Kling 4.0 Video Edit request. Media inputs must be accessible HTTP(S) URLs; base64 and data URIs are not accepted. Images, videos, subjects and voices combined must not exceed 15 references. All keyframes and reference images combined must not exceed 10.
Required non-whitespace prompt. Up to 26,000 English characters or 11,000 non-English characters. Mixed prompts must satisfy English/26000 + non-English/11000 <= 1. Reference labels follow input order: @image_1, @video_1 and @element_1, with @voice_1 for voice references.
1 - 26000"Edit @video_1. Remove the person in the foreground. Keep everything else unchanged."
Required base video URL for editing (MP4/MOV). All supplied video inputs together must fit within 30 seconds, with a minimum video duration of 3 seconds. Media validity is checked by the upstream service.
1^[Hh][Tt][Tt][Pp][Ss]?://[^\s]+$"https://example.com/source.mp4"