Remove Video Background
curl --request POST \
--url https://api.developer.pixelcut.ai/v1/video/remove-background \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"video_url": "https://example.com/video.mp4",
"background_color": "#000000",
"output_format": "mp4_h264"
}
'import requests
url = "https://api.developer.pixelcut.ai/v1/video/remove-background"
payload = {
"video_url": "https://example.com/video.mp4",
"background_color": "#000000",
"output_format": "mp4_h264"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
video_url: 'https://example.com/video.mp4',
background_color: '#000000',
output_format: 'mp4_h264'
})
};
fetch('https://api.developer.pixelcut.ai/v1/video/remove-background', 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.developer.pixelcut.ai/v1/video/remove-background",
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' => '#000000',
'output_format' => 'mp4_h264'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.developer.pixelcut.ai/v1/video/remove-background"
payload := strings.NewReader("{\n \"video_url\": \"https://example.com/video.mp4\",\n \"background_color\": \"#000000\",\n \"output_format\": \"mp4_h264\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.developer.pixelcut.ai/v1/video/remove-background")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"video_url\": \"https://example.com/video.mp4\",\n \"background_color\": \"#000000\",\n \"output_format\": \"mp4_h264\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.developer.pixelcut.ai/v1/video/remove-background")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"video_url\": \"https://example.com/video.mp4\",\n \"background_color\": \"#000000\",\n \"output_format\": \"mp4_h264\"\n}"
response = http.request(request)
puts response.read_body{
"job_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}{
"error": "File size too large",
"error_code": "file_size_too_large"
}{
"error": "API Token not found",
"error_code": "invalid_auth_token"
}{
"error": "Insufficient credits available",
"error_code": "insufficient_api_credits"
}{
"error": "Too many requests",
"error_code": "rate_limit_exceeded"
}Video Background Removal
Remove Video Background
Removes the background from a video and optionally replaces it with a solid color or makes it transparent.
Input Video Limits:
- Max size: 100MB
- Max duration: 60 seconds
- Supported formats: MP4, MOV, WebM, MKV, GIF
- Supported codecs: H.264, H.265/HEVC, VP8, VP9, AV1, ProRes
- Resolution: 64x64 to 4096x4096 pixels
POST
/
v1
/
video
/
remove-background
Remove Video Background
curl --request POST \
--url https://api.developer.pixelcut.ai/v1/video/remove-background \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"video_url": "https://example.com/video.mp4",
"background_color": "#000000",
"output_format": "mp4_h264"
}
'import requests
url = "https://api.developer.pixelcut.ai/v1/video/remove-background"
payload = {
"video_url": "https://example.com/video.mp4",
"background_color": "#000000",
"output_format": "mp4_h264"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
video_url: 'https://example.com/video.mp4',
background_color: '#000000',
output_format: 'mp4_h264'
})
};
fetch('https://api.developer.pixelcut.ai/v1/video/remove-background', 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.developer.pixelcut.ai/v1/video/remove-background",
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' => '#000000',
'output_format' => 'mp4_h264'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.developer.pixelcut.ai/v1/video/remove-background"
payload := strings.NewReader("{\n \"video_url\": \"https://example.com/video.mp4\",\n \"background_color\": \"#000000\",\n \"output_format\": \"mp4_h264\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.developer.pixelcut.ai/v1/video/remove-background")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"video_url\": \"https://example.com/video.mp4\",\n \"background_color\": \"#000000\",\n \"output_format\": \"mp4_h264\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.developer.pixelcut.ai/v1/video/remove-background")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"video_url\": \"https://example.com/video.mp4\",\n \"background_color\": \"#000000\",\n \"output_format\": \"mp4_h264\"\n}"
response = http.request(request)
puts response.read_body{
"job_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}{
"error": "File size too large",
"error_code": "file_size_too_large"
}{
"error": "API Token not found",
"error_code": "invalid_auth_token"
}{
"error": "Insufficient credits available",
"error_code": "insufficient_api_credits"
}{
"error": "Too many requests",
"error_code": "rate_limit_exceeded"
}Authorizations
All API requests require a valid api key. Include your token as a HTTP request header in the following format: X-API-Key: skXXXXXXXXXXXXXXXX. You can obtain an api key by signing up for developer access in your Pixelcut account.
Body
application/json
URL of the video to be processed. Must be a publicly accessible URL.
Example:
"https://example.com/video.mp4"
The background color to use after removal.
- Use "transparent" for transparent background (requires webm_vp9, mov_proresks, or gif output format)
- Use hex code (e.g., "#000000", "#FF5733") for solid color
Pattern:
^(transparent|#[0-9A-Fa-f]{3}|#[0-9A-Fa-f]{6})$Output video format with codec specification. Defaults to mp4_h264 if not specified.
Formats:
- mp4_h264: MP4 with H.264 codec
- mp4_h265: MP4 with H.265/HEVC codec
- webm_vp9: WebM with VP9 codec (supports transparency)
- mov_h265: QuickTime with H.265 codec
- mov_proresks: QuickTime with ProRes 4444 codec (supports transparency)
- mkv_h264: Matroska with H.264 codec
- mkv_h265: Matroska with H.265 codec
- mkv_vp9: Matroska with VP9 codec
- gif: Animated GIF (supports transparency)
Available options:
mp4_h264, mp4_h265, webm_vp9, mov_h265, mov_proresks, mkv_h264, mkv_h265, mkv_vp9, gif Response
Accepted - processing has started
A unique identifier for this job that can be used to check status.
Example:
"6ba7b810-9dad-11d1-80b4-00c04fd430c8"