Skip to main content
POST
/
v1
/
video_translate
Translates a video into one or more supported languages
curl --request POST \
  --url https://api.keevx.com/v1/video_translate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "target_languages": [
    "English",
    "Chinese"
  ],
  "video_url": "https://example.com/test-video.mp4",
  "speaker_num": 1,
  "translate_audio_only": true,
  "enable_dynamic_duration": true,
  "enable_caption": false,
  "name": "English-videoTranslation-2020120123001",
  "callback_url": "https://your-server.com/callback"
}
'
import requests

url = "https://api.keevx.com/v1/video_translate"

payload = {
"target_languages": ["English", "Chinese"],
"video_url": "https://example.com/test-video.mp4",
"speaker_num": 1,
"translate_audio_only": True,
"enable_dynamic_duration": True,
"enable_caption": False,
"name": "English-videoTranslation-2020120123001",
"callback_url": "https://your-server.com/callback"
}
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({
target_languages: ['English', 'Chinese'],
video_url: 'https://example.com/test-video.mp4',
speaker_num: 1,
translate_audio_only: true,
enable_dynamic_duration: true,
enable_caption: false,
name: 'English-videoTranslation-2020120123001',
callback_url: 'https://your-server.com/callback'
})
};

fetch('https://api.keevx.com/v1/video_translate', 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.keevx.com/v1/video_translate",
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([
'target_languages' => [
'English',
'Chinese'
],
'video_url' => 'https://example.com/test-video.mp4',
'speaker_num' => 1,
'translate_audio_only' => true,
'enable_dynamic_duration' => true,
'enable_caption' => false,
'name' => 'English-videoTranslation-2020120123001',
'callback_url' => 'https://your-server.com/callback'
]),
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.keevx.com/v1/video_translate"

payload := strings.NewReader("{\n \"target_languages\": [\n \"English\",\n \"Chinese\"\n ],\n \"video_url\": \"https://example.com/test-video.mp4\",\n \"speaker_num\": 1,\n \"translate_audio_only\": true,\n \"enable_dynamic_duration\": true,\n \"enable_caption\": false,\n \"name\": \"English-videoTranslation-2020120123001\",\n \"callback_url\": \"https://your-server.com/callback\"\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.keevx.com/v1/video_translate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target_languages\": [\n \"English\",\n \"Chinese\"\n ],\n \"video_url\": \"https://example.com/test-video.mp4\",\n \"speaker_num\": 1,\n \"translate_audio_only\": true,\n \"enable_dynamic_duration\": true,\n \"enable_caption\": false,\n \"name\": \"English-videoTranslation-2020120123001\",\n \"callback_url\": \"https://your-server.com/callback\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.keevx.com/v1/video_translate")

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 \"target_languages\": [\n \"English\",\n \"Chinese\"\n ],\n \"video_url\": \"https://example.com/test-video.mp4\",\n \"speaker_num\": 1,\n \"translate_audio_only\": true,\n \"enable_dynamic_duration\": true,\n \"enable_caption\": false,\n \"name\": \"English-videoTranslation-2020120123001\",\n \"callback_url\": \"https://your-server.com/callback\"\n}"

response = http.request(request)
puts response.read_body
{
  "code": 0,
  "msg": "ok",
  "data": [
    {
      "task_id": "vt-d6b6472bcf724d0399e06d1390cb964e",
      "language": "English"
    }
  ]
}
{
"code": 100001,
"msg": "<string>"
}

Callback Notification

After the video generation task is processed, the service will send a POST request to the callback_url provided in the initiation request.

Structure

code
integer
Response status code. 0 indicates a successful callback transmission.
msg
string
Response message, usually “ok”.
task_type
string
The type of the task. Enum: video_translate.
data
object
The payload containing the generation results.

Callback Example

{
    "code": 0,
    "msg": "ok",
    "task_type": "video_translate",
    "data": {
        "task_id": "vt-d6b6472bcf724d0399e06d1390cb964e",
        "name": "video-translate-1",
        "language": "English",
        "status": "SUCCEEDED",
        "video_url": "https://storage.googleapis.com/xiling_us_central1_bucket/backend-saas-cdn/video-translate/9966750584897124421/sample_0.mp4",
        "caption_url": "https://storage.googleapis.com/xiling_us_central1_bucket/backend-saas-cdn/video-translate/9966750584897124421/sample_0.ass",
        "error_message": ""
    }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Create an video translation task. Supports models V, KL, and S.

target_languages
string[]
required

supported language codes

Example:
["English", "Chinese"]
video_url
string<uri>
required

URL of the video file to be translated.

Example:

"https://example.com/test-video.mp4"

speaker_num
integer
default:0

Number of speakers in the video.

Required range: x >= 0
Example:

1

translate_audio_only
boolean
default:false

Translate only the audio, ignore the faces and only translate the voice track in this video.

Example:

true

enable_dynamic_duration
boolean
default:true

Stretch or shrink portions of your video to enhance conversational fluidity and translation quality between languages with different speaking rates

Example:

true

enable_caption
boolean
default:false

Generate subtitles

Example:

false

name
string

Video name, with a character length of less than 100, the name after video translation is: target language+"-"+name, such as English_myTestVideo; If the value is passed empty or not, the name of the ending name for video translation is: target language+"-"+videoTranslate+"-" second level timestamp, for example: English-videoTranslation-2020120123001

Example:

"English-videoTranslation-2020120123001"

callback_url
string<uri>

Callback URL for task completion notification.

Example:

"https://your-server.com/callback"

Response

Task created successfully

Task creation response wrapper

code
integer
required

Status code (0 indicates success)

Example:

0

msg
string
required

Response message

Example:

"ok"

data
object[]
required

Payload containing the generated task IDs and languages