Generate Speech
curl --request POST \
--url https://api.tts.timepay.ai/api/v1/get_speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "Hello, welcome to Vox.",
"voice_id": "Ogbs15oBevLzXsUuTtA1",
"language": "en",
"add_wav_header": true,
"sample_rate": 24000,
"speed": 1.5
}
'import requests
url = "https://api.tts.timepay.ai/api/v1/get_speech"
payload = {
"text": "Hello, welcome to Vox.",
"voice_id": "Ogbs15oBevLzXsUuTtA1",
"language": "en",
"add_wav_header": True,
"sample_rate": 24000,
"speed": 1.5
}
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({
text: 'Hello, welcome to Vox.',
voice_id: 'Ogbs15oBevLzXsUuTtA1',
language: 'en',
add_wav_header: true,
sample_rate: 24000,
speed: 1.5
})
};
fetch('https://api.tts.timepay.ai/api/v1/get_speech', 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.tts.timepay.ai/api/v1/get_speech",
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' => 'Hello, welcome to Vox.',
'voice_id' => 'Ogbs15oBevLzXsUuTtA1',
'language' => 'en',
'add_wav_header' => true,
'sample_rate' => 24000,
'speed' => 1.5
]),
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.tts.timepay.ai/api/v1/get_speech"
payload := strings.NewReader("{\n \"text\": \"Hello, welcome to Vox.\",\n \"voice_id\": \"Ogbs15oBevLzXsUuTtA1\",\n \"language\": \"en\",\n \"add_wav_header\": true,\n \"sample_rate\": 24000,\n \"speed\": 1.5\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.tts.timepay.ai/api/v1/get_speech")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Hello, welcome to Vox.\",\n \"voice_id\": \"Ogbs15oBevLzXsUuTtA1\",\n \"language\": \"en\",\n \"add_wav_header\": true,\n \"sample_rate\": 24000,\n \"speed\": 1.5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tts.timepay.ai/api/v1/get_speech")
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 \"text\": \"Hello, welcome to Vox.\",\n \"voice_id\": \"Ogbs15oBevLzXsUuTtA1\",\n \"language\": \"en\",\n \"add_wav_header\": true,\n \"sample_rate\": 24000,\n \"speed\": 1.5\n}"
response = http.request(request)
puts response.read_body"UklGRiQAAABXQVZFZm10IBAAAAABAAEAIlYA..."Endpoint examples
Text to Speech
Converts text to audio and streams the result.
POST
/
api
/
v1
/
get_speech
Generate Speech
curl --request POST \
--url https://api.tts.timepay.ai/api/v1/get_speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "Hello, welcome to Vox.",
"voice_id": "Ogbs15oBevLzXsUuTtA1",
"language": "en",
"add_wav_header": true,
"sample_rate": 24000,
"speed": 1.5
}
'import requests
url = "https://api.tts.timepay.ai/api/v1/get_speech"
payload = {
"text": "Hello, welcome to Vox.",
"voice_id": "Ogbs15oBevLzXsUuTtA1",
"language": "en",
"add_wav_header": True,
"sample_rate": 24000,
"speed": 1.5
}
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({
text: 'Hello, welcome to Vox.',
voice_id: 'Ogbs15oBevLzXsUuTtA1',
language: 'en',
add_wav_header: true,
sample_rate: 24000,
speed: 1.5
})
};
fetch('https://api.tts.timepay.ai/api/v1/get_speech', 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.tts.timepay.ai/api/v1/get_speech",
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' => 'Hello, welcome to Vox.',
'voice_id' => 'Ogbs15oBevLzXsUuTtA1',
'language' => 'en',
'add_wav_header' => true,
'sample_rate' => 24000,
'speed' => 1.5
]),
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.tts.timepay.ai/api/v1/get_speech"
payload := strings.NewReader("{\n \"text\": \"Hello, welcome to Vox.\",\n \"voice_id\": \"Ogbs15oBevLzXsUuTtA1\",\n \"language\": \"en\",\n \"add_wav_header\": true,\n \"sample_rate\": 24000,\n \"speed\": 1.5\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.tts.timepay.ai/api/v1/get_speech")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Hello, welcome to Vox.\",\n \"voice_id\": \"Ogbs15oBevLzXsUuTtA1\",\n \"language\": \"en\",\n \"add_wav_header\": true,\n \"sample_rate\": 24000,\n \"speed\": 1.5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tts.timepay.ai/api/v1/get_speech")
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 \"text\": \"Hello, welcome to Vox.\",\n \"voice_id\": \"Ogbs15oBevLzXsUuTtA1\",\n \"language\": \"en\",\n \"add_wav_header\": true,\n \"sample_rate\": 24000,\n \"speed\": 1.5\n}"
response = http.request(request)
puts response.read_body"UklGRiQAAABXQVZFZm10IBAAAAABAAEAIlYA..."Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The text to convert to speech.
Example:
"Hello, welcome to Vox."
The specific voice_id to use for synthesis.
Available options:
Kartik -> Ogbs15oBevLzXsUuTtA1, Rahul -> Owbs15oBevLzXsUurdA_, Nisha -> PAbs15oBevLzXsUu4dCi, Tulsi -> PQbt15oBevLzXsUuNtD3, Seema -> Pgbt15oBevLzXsUubdA6 Example:
"Ogbs15oBevLzXsUuTtA1"
ISO language code.
Available options:
en, hi, mr, ta, te, gu, kn, ml, bn, pa, od, as Example:
"en"
If true, adds a WAV header to the stream for immediate playback.
Audio sample rate. The supported sample rates are 8000, 16000 and 24000 Hz.
Example:
24000
The speed is a float varies from 0.5 to 2.0, where 1.0 is the normal speed.
Example:
1.5
Response
200 - audio/wav
Streams audio/wav data. Headers include X-Request-ID.
The response is of type file.

