Text to Speech
curl --request POST \
--url https://audio.dubverse.ai/api/tts \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <x-api-key>' \
--data '
{
"text": "Welcome to Dubverse AI. Convert your text to lifelike speech with our advanced AI models.",
"speaker_no": 1190,
"config": {
"use_streaming_response": false,
"sample_rate": 22050,
"instructions": "<string>"
},
"callback_url": "<string>"
}
'import requests
url = "https://audio.dubverse.ai/api/tts"
payload = {
"text": "Welcome to Dubverse AI. Convert your text to lifelike speech with our advanced AI models.",
"speaker_no": 1190,
"config": {
"use_streaming_response": False,
"sample_rate": 22050,
"instructions": "<string>"
},
"callback_url": "<string>"
}
headers = {
"X-API-KEY": "<x-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': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: 'Welcome to Dubverse AI. Convert your text to lifelike speech with our advanced AI models.',
speaker_no: 1190,
config: {use_streaming_response: false, sample_rate: 22050, instructions: '<string>'},
callback_url: '<string>'
})
};
fetch('https://audio.dubverse.ai/api/tts', 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://audio.dubverse.ai/api/tts",
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([
'text' => 'Welcome to Dubverse AI. Convert your text to lifelike speech with our advanced AI models.',
'speaker_no' => 1190,
'config' => [
'use_streaming_response' => false,
'sample_rate' => 22050,
'instructions' => '<string>'
],
'callback_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <x-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://audio.dubverse.ai/api/tts"
payload := strings.NewReader("{\n \"text\": \"Welcome to Dubverse AI. Convert your text to lifelike speech with our advanced AI models.\",\n \"speaker_no\": 1190,\n \"config\": {\n \"use_streaming_response\": false,\n \"sample_rate\": 22050,\n \"instructions\": \"<string>\"\n },\n \"callback_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<x-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://audio.dubverse.ai/api/tts")
.header("X-API-KEY", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Welcome to Dubverse AI. Convert your text to lifelike speech with our advanced AI models.\",\n \"speaker_no\": 1190,\n \"config\": {\n \"use_streaming_response\": false,\n \"sample_rate\": 22050,\n \"instructions\": \"<string>\"\n },\n \"callback_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://audio.dubverse.ai/api/tts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"Welcome to Dubverse AI. Convert your text to lifelike speech with our advanced AI models.\",\n \"speaker_no\": 1190,\n \"config\": {\n \"use_streaming_response\": false,\n \"sample_rate\": 22050,\n \"instructions\": \"<string>\"\n },\n \"callback_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body"<string>"API References
Text to Speech API
Convert text to speech using our advanced AI models
POST
/
tts
Text to Speech
curl --request POST \
--url https://audio.dubverse.ai/api/tts \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <x-api-key>' \
--data '
{
"text": "Welcome to Dubverse AI. Convert your text to lifelike speech with our advanced AI models.",
"speaker_no": 1190,
"config": {
"use_streaming_response": false,
"sample_rate": 22050,
"instructions": "<string>"
},
"callback_url": "<string>"
}
'import requests
url = "https://audio.dubverse.ai/api/tts"
payload = {
"text": "Welcome to Dubverse AI. Convert your text to lifelike speech with our advanced AI models.",
"speaker_no": 1190,
"config": {
"use_streaming_response": False,
"sample_rate": 22050,
"instructions": "<string>"
},
"callback_url": "<string>"
}
headers = {
"X-API-KEY": "<x-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': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: 'Welcome to Dubverse AI. Convert your text to lifelike speech with our advanced AI models.',
speaker_no: 1190,
config: {use_streaming_response: false, sample_rate: 22050, instructions: '<string>'},
callback_url: '<string>'
})
};
fetch('https://audio.dubverse.ai/api/tts', 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://audio.dubverse.ai/api/tts",
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([
'text' => 'Welcome to Dubverse AI. Convert your text to lifelike speech with our advanced AI models.',
'speaker_no' => 1190,
'config' => [
'use_streaming_response' => false,
'sample_rate' => 22050,
'instructions' => '<string>'
],
'callback_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <x-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://audio.dubverse.ai/api/tts"
payload := strings.NewReader("{\n \"text\": \"Welcome to Dubverse AI. Convert your text to lifelike speech with our advanced AI models.\",\n \"speaker_no\": 1190,\n \"config\": {\n \"use_streaming_response\": false,\n \"sample_rate\": 22050,\n \"instructions\": \"<string>\"\n },\n \"callback_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<x-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://audio.dubverse.ai/api/tts")
.header("X-API-KEY", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Welcome to Dubverse AI. Convert your text to lifelike speech with our advanced AI models.\",\n \"speaker_no\": 1190,\n \"config\": {\n \"use_streaming_response\": false,\n \"sample_rate\": 22050,\n \"instructions\": \"<string>\"\n },\n \"callback_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://audio.dubverse.ai/api/tts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"Welcome to Dubverse AI. Convert your text to lifelike speech with our advanced AI models.\",\n \"speaker_no\": 1190,\n \"config\": {\n \"use_streaming_response\": false,\n \"sample_rate\": 22050,\n \"instructions\": \"<string>\"\n },\n \"callback_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body"<string>"Make an API call
Replace
YOUR_API_KEY with your actual Dubverse API key to make a real API call. (If you haven’t obtained one, visit the API Key page) The response will be an audio file that you can play directly in the browser.Headers
API key for authentication
Body
application/json
The input text you want to convert to speech.
Example:
"Welcome to Dubverse AI. Convert your text to lifelike speech with our advanced AI models."
The ID of the speaker voice.
Example:
1190
Show child attributes
Show child attributes
URL to receive the API response if different from the origin.
Response
200 - audio/wav
Successful response
The response is of type file.
⌘I
