Submit Video Background Remove Task
curl --request POST \
--url https://api.weryai.com/v1/generation/video-background-remove \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"video_url": "https://example.com/video.mp4",
"background_color": "BLACK",
"output_container_and_codec": "MP4_H264"
}
'import requests
url = "https://api.weryai.com/v1/generation/video-background-remove"
payload = {
"video_url": "https://example.com/video.mp4",
"background_color": "BLACK",
"output_container_and_codec": "MP4_H264"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
video_url: 'https://example.com/video.mp4',
background_color: 'BLACK',
output_container_and_codec: 'MP4_H264'
})
};
fetch('https://api.weryai.com/v1/generation/video-background-remove', 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.weryai.com/v1/generation/video-background-remove",
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([
'video_url' => 'https://example.com/video.mp4',
'background_color' => 'BLACK',
'output_container_and_codec' => 'MP4_H264'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.weryai.com/v1/generation/video-background-remove"
payload := strings.NewReader("{\n \"video_url\": \"https://example.com/video.mp4\",\n \"background_color\": \"BLACK\",\n \"output_container_and_codec\": \"MP4_H264\"\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.weryai.com/v1/generation/video-background-remove")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"video_url\": \"https://example.com/video.mp4\",\n \"background_color\": \"BLACK\",\n \"output_container_and_codec\": \"MP4_H264\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.weryai.com/v1/generation/video-background-remove")
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 \"video_url\": \"https://example.com/video.mp4\",\n \"background_color\": \"BLACK\",\n \"output_container_and_codec\": \"MP4_H264\"\n}"
response = http.request(request)
puts response.read_body{
"status": 0,
"desc": "success",
"message": "success",
"data": {
"task_id": "task_abc123",
"task_status": "waiting"
}
}{
"status": 1001,
"desc": "Parameter error",
"message": "Prompt cannot be empty"
}{
"status": 1002,
"desc": "Authentication failed",
"message": "Invalid API Key"
}Video Tools
Submit Video Background Remove Task
Remove or replace the background of a video with a solid color
POST
/
v1
/
generation
/
video-background-remove
Submit Video Background Remove Task
curl --request POST \
--url https://api.weryai.com/v1/generation/video-background-remove \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"video_url": "https://example.com/video.mp4",
"background_color": "BLACK",
"output_container_and_codec": "MP4_H264"
}
'import requests
url = "https://api.weryai.com/v1/generation/video-background-remove"
payload = {
"video_url": "https://example.com/video.mp4",
"background_color": "BLACK",
"output_container_and_codec": "MP4_H264"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
video_url: 'https://example.com/video.mp4',
background_color: 'BLACK',
output_container_and_codec: 'MP4_H264'
})
};
fetch('https://api.weryai.com/v1/generation/video-background-remove', 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.weryai.com/v1/generation/video-background-remove",
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([
'video_url' => 'https://example.com/video.mp4',
'background_color' => 'BLACK',
'output_container_and_codec' => 'MP4_H264'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.weryai.com/v1/generation/video-background-remove"
payload := strings.NewReader("{\n \"video_url\": \"https://example.com/video.mp4\",\n \"background_color\": \"BLACK\",\n \"output_container_and_codec\": \"MP4_H264\"\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.weryai.com/v1/generation/video-background-remove")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"video_url\": \"https://example.com/video.mp4\",\n \"background_color\": \"BLACK\",\n \"output_container_and_codec\": \"MP4_H264\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.weryai.com/v1/generation/video-background-remove")
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 \"video_url\": \"https://example.com/video.mp4\",\n \"background_color\": \"BLACK\",\n \"output_container_and_codec\": \"MP4_H264\"\n}"
response = http.request(request)
puts response.read_body{
"status": 0,
"desc": "success",
"message": "success",
"data": {
"task_id": "task_abc123",
"task_status": "waiting"
}
}{
"status": 1001,
"desc": "Parameter error",
"message": "Prompt cannot be empty"
}{
"status": 1002,
"desc": "Authentication failed",
"message": "Invalid API Key"
}Authorizations
Authenticate using Bearer token. Get your API Key from the WeryAI Console.
Example: Authorization: Bearer sk-xxxxxxxxxxxxxxxx
Body
application/json
Source video URL
Example:
"https://example.com/video.mp4"
Background color to fill after removal. Supported values: TRANSPARENT, BLACK, WHITE, GRAY, RED, GREEN, BLUE, YELLOW, CYAN, MAGENTA, ORANGE.
Example:
"BLACK"
Output container and codec. Supported values: MP4_H265, MP4_H264, WEBM_VP9, MOV_H265, MOV_PRORESKS, MKV_H265, MKV_H264, MKV_VP9, GIF.
Example:
"MP4_H264"
Caller ID (for business association)
⌘I
