Create Dubbing Endpoint
Overview
The endpoint enables automatic voice translation of videos from one language to another. It accepts a video file link and various parameters to control the dubbing process.
Request
--request POST 'https://modelslab.com/api/v6/voice/create_dubbing' \
Make a POST
request to https://modelslab.com/api/v6/voice/create_dubbing endpoint and pass the required parameters as a request body.
Body Attributes
Parameter | Description | Values |
---|---|---|
key | The API key used for authenticating your request. | String |
init_video | URL to the video file to be dubbed | Text |
source_lang | Source language code of the video, default is "en". | en , ar , es ,pt-BR ,de ,cs ,zh ,nl ,fr ,hi ,hu , it ,ja ,ko ,pl ,ru , tr |
output_lang | Target language code for dubbing | en , ar , es ,pt-BR ,de ,cs ,zh ,nl ,fr ,hi ,hu , it ,ja ,ko ,pl ,ru , tr |
file_prefix | Prefix for the output file name Defaults to 10 . | string/number |
base64 | Indicates whether the input audio file is provided in base64 format. Defaults to false . | TRUE or FALSE |
seed | Random seed for reproducibility (if 0, a random seed is generated) | Int (random number ) |
webhook | A URL where the API will send a POST request once the audio generation is complete. | URL |
track_id | An ID returned in the API response, used to identify webhook requests | Integral value |
Example
Body
Body
{
"key": "",
"init_video": "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/ykl9xK5huFozCS1lDIhlqSbzhTgsuw-metaRnVsbCBzcGVlY2hfIFB1dGluIGRlZmlhbnQgaW4gYWRkcmVzcyB0byBuYXRpb24gYWZ0ZXIgYXR0ZW1wdGVkIGFybWVkIHJlYmVsbGlvbi5tcDQ=-.mp4",
"source_lang": "ru",
"output_lang": "en",
"speed": 1.2,
"file_prefix": "spanish_dub",
"base64": false
"webhook": null,
"track_id": null
}
Request
- JS
- PHP
- NODE
- PYTHON
- JAVA
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"key":"",
"init_video": "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/ykl9xK5huFozCS1lDIhlqSbzhTgsuw-metaRnVsbCBzcGVlY2hfIFB1dGluIGRlZmlhbnQgaW4gYWRkcmVzcyB0byBuYXRpb24gYWZ0ZXIgYXR0ZW1wdGVkIGFybWVkIHJlYmVsbGlvbi5tcDQ=-.mp4",
"source_lang": "ru",
"output_lang": "en",
"speed": 1.2,
"file_prefix": "spanish_dub",
"base64": false
"webhook": null,
"track_id": null
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://modelslab.com/api/v6/voice/create_dubbing", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
<?php
$payload = [
"key" => "",
"init_video" => "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/ykl9xK5huFozCS1lDIhlqSbzhTgsuw-metaRnVsbCBzcGVlY2hfIFB1dGluIGRlZmlhbnQgaW4gYWRkcmVzcyB0byBuYXRpb24gYWZ0ZXIgYXR0ZW1wdGVkIGFybWVkIHJlYmVsbGlvbi5tcDQ=-.mp4",
"source_lang": =>"ru",
"output_lang" => "en",
"speed" => 1.2,
"file_prefix" => "spanish_dub",
"base64" => false
"webhook" => null,
"track_id" => null
];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://modelslab.com/api/v6/voice/create_dubbing',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://modelslab.com/api/v6/voice/create_dubbing',
'headers': {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"key":"",
"init_video": "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/ykl9xK5huFozCS1lDIhlqSbzhTgsuw-metaRnVsbCBzcGVlY2hfIFB1dGluIGRlZmlhbnQgaW4gYWRkcmVzcyB0byBuYXRpb24gYWZ0ZXIgYXR0ZW1wdGVkIGFybWVkIHJlYmVsbGlvbi5tcDQ=-.mp4",
"source_lang": "ru",
"output_lang": "en",
"speed": 1.2,
"file_prefix": "spanish_dub",
"base64": false
"webhook": null,
"track_id": null
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
import json
url = "https://modelslab.com/api/v6/voice/create_dubbing"
payload = json.dumps({
"key":"",
"init_video": "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/ykl9xK5huFozCS1lDIhlqSbzhTgsuw-metaRnVsbCBzcGVlY2hfIFB1dGluIGRlZmlhbnQgaW4gYWRkcmVzcyB0byBuYXRpb24gYWZ0ZXIgYXR0ZW1wdGVkIGFybWVkIHJlYmVsbGlvbi5tcDQ=-.mp4",
"source_lang": "ru",
"output_lang": "en",
"speed": 1.2,
"file_prefix": "spanish_dub",
"base64": False,
"webhook": None,
"track_id": None
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\"key\":\"\",\n \"init_video\": \"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/ykl9xK5huFozCS1lDIhlqSbzhTgsuw-metaRnVsbCBzcGVlY2hfIFB1dGluIGRlZmlhbnQgaW4gYWRkcmVzcyB0byBuYXRpb24gYWZ0ZXIgYXR0ZW1wdGVkIGFybWVkIHJlYmVsbGlvbi5tcDQ=-.mp4\",\n \"source_lang\": \"ru\",\n \"output_lang\": \"en\",\n \"speed\": 1.2,\n \"file_prefix\": \"spanish_dub\",\n \"base64\": false\n}");
Request request = new Request.Builder()
.url("https://modelslab.com/api/v6/voice/create_dubbing")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "{{token}}")
.build();
Response response = client.newCall(request).execute();
Response
{
"status": "success",
"generationTime": 1.904285192489624,
"id": 334166,
"output": [
"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/audio_generations/dubbed_video_d0c1da80-40a0-4981-84bb-f52a44a560e5_10.mp4",
"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/audio_generations/dubbed_video_d0c1da80-40a0-4981-84bb-f52a44a560e5_10.mp4"
],
"proxy_links": [
"https://cdn2.stablediffusionapi.com/audio_generations/dubbed_video_d0c1da80-40a0-4981-84bb-f52a44a560e5_10.mp4",
"https://cdn2.stablediffusionapi.com/audio_generations/dubbed_video_d0c1da80-40a0-4981-84bb-f52a44a560e5_10.mp4"
],
"meta": {
"uuid": "d0c1da80-40a0-4981-84bb-f52a44a560e5",
"video_link": "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/ykl9xK5huFozCS1lDIhlqSbzhTgsuw-metaRnVsbCBzcGVlY2hfIFB1dGluIGRlZmlhbnQgaW4gYWRkcmVzcyB0byBuYXRpb24gYWZ0ZXIgYXR0ZW1wdGVkIGFybWVkIHJlYmVsbGlvbi5tcDQ=-.mp4",
"source_lang": "ru",
"output_lang": "en",
"speed": "1.2",
"file_prefix": 10,
"is_base64": false
}
}