Synthesise speech
curl --request POST \
--url https://app.voho.ai/v1/speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "أهلاً بك في فوهو",
"voice": "layla",
"model": "sada-1",
"format": "mp3",
"sample_rate": 123,
"speed": 1,
"pitch": 123
}
'import requests
url = "https://app.voho.ai/v1/speech"
payload = {
"text": "أهلاً بك في فوهو",
"voice": "layla",
"model": "sada-1",
"format": "mp3",
"sample_rate": 123,
"speed": 1,
"pitch": 123
}
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: 'أهلاً بك في فوهو',
voice: 'layla',
model: 'sada-1',
format: 'mp3',
sample_rate: 123,
speed: 1,
pitch: 123
})
};
fetch('https://app.voho.ai/v1/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://app.voho.ai/v1/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' => 'أهلاً بك في فوهو',
'voice' => 'layla',
'model' => 'sada-1',
'format' => 'mp3',
'sample_rate' => 123,
'speed' => 1,
'pitch' => 123
]),
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://app.voho.ai/v1/speech"
payload := strings.NewReader("{\n \"text\": \"أهلاً بك في فوهو\",\n \"voice\": \"layla\",\n \"model\": \"sada-1\",\n \"format\": \"mp3\",\n \"sample_rate\": 123,\n \"speed\": 1,\n \"pitch\": 123\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://app.voho.ai/v1/speech")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"أهلاً بك في فوهو\",\n \"voice\": \"layla\",\n \"model\": \"sada-1\",\n \"format\": \"mp3\",\n \"sample_rate\": 123,\n \"speed\": 1,\n \"pitch\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.voho.ai/v1/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\": \"أهلاً بك في فوهو\",\n \"voice\": \"layla\",\n \"model\": \"sada-1\",\n \"format\": \"mp3\",\n \"sample_rate\": 123,\n \"speed\": 1,\n \"pitch\": 123\n}"
response = http.request(request)
puts response.read_body"<string>"{
"error": {
"code": "text_too_long",
"message": "Text exceeds the 5,000 character limit."
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API token."
}
}{
"error": {
"code": "insufficient_credit",
"message": "Your credit balance is exhausted. Top up to continue."
}
}{
"error": {
"code": "unknown_voice",
"message": "Unknown voice \"laila\"."
}
}{
"error": {
"code": "synthesis_failed",
"message": "Synthesis failed. Please try again."
}
}{
"error": {
"code": "unavailable",
"message": "The voice engine is briefly at capacity. Retry shortly."
}
}Synthesise speech
Returns finished audio as raw bytes. Details of what was produced are in the X-Voho-* response headers.
POST
/
v1
/
speech
Synthesise speech
curl --request POST \
--url https://app.voho.ai/v1/speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "أهلاً بك في فوهو",
"voice": "layla",
"model": "sada-1",
"format": "mp3",
"sample_rate": 123,
"speed": 1,
"pitch": 123
}
'import requests
url = "https://app.voho.ai/v1/speech"
payload = {
"text": "أهلاً بك في فوهو",
"voice": "layla",
"model": "sada-1",
"format": "mp3",
"sample_rate": 123,
"speed": 1,
"pitch": 123
}
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: 'أهلاً بك في فوهو',
voice: 'layla',
model: 'sada-1',
format: 'mp3',
sample_rate: 123,
speed: 1,
pitch: 123
})
};
fetch('https://app.voho.ai/v1/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://app.voho.ai/v1/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' => 'أهلاً بك في فوهو',
'voice' => 'layla',
'model' => 'sada-1',
'format' => 'mp3',
'sample_rate' => 123,
'speed' => 1,
'pitch' => 123
]),
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://app.voho.ai/v1/speech"
payload := strings.NewReader("{\n \"text\": \"أهلاً بك في فوهو\",\n \"voice\": \"layla\",\n \"model\": \"sada-1\",\n \"format\": \"mp3\",\n \"sample_rate\": 123,\n \"speed\": 1,\n \"pitch\": 123\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://app.voho.ai/v1/speech")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"أهلاً بك في فوهو\",\n \"voice\": \"layla\",\n \"model\": \"sada-1\",\n \"format\": \"mp3\",\n \"sample_rate\": 123,\n \"speed\": 1,\n \"pitch\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.voho.ai/v1/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\": \"أهلاً بك في فوهو\",\n \"voice\": \"layla\",\n \"model\": \"sada-1\",\n \"format\": \"mp3\",\n \"sample_rate\": 123,\n \"speed\": 1,\n \"pitch\": 123\n}"
response = http.request(request)
puts response.read_body"<string>"{
"error": {
"code": "text_too_long",
"message": "Text exceeds the 5,000 character limit."
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API token."
}
}{
"error": {
"code": "insufficient_credit",
"message": "Your credit balance is exhausted. Top up to continue."
}
}{
"error": {
"code": "unknown_voice",
"message": "Unknown voice \"laila\"."
}
}{
"error": {
"code": "synthesis_failed",
"message": "Synthesis failed. Please try again."
}
}{
"error": {
"code": "unavailable",
"message": "The voice engine is briefly at capacity. Retry shortly."
}
}Authorizations
API token from the Voho console. Begins with voho_sk_live_.
Body
application/json
Text to speak. Maximum 5,000 characters.
Maximum string length:
5000Example:
"أهلاً بك في فوهو"
Voice ID from the catalog.
Example:
"layla"
Available options:
sada-1, nabra-1 Overrides the Accept header when both are present.
Available options:
mp3, wav, opus, mulaw Defaults to the format's native rate (24000, or 8000 for mulaw).
Speaking rate. Below 1.0 is slower.
Pitch adjustment. Only applies to nabra-1; sada-1 ignores it.
Response
Audio bytes.
The response is of type file.
⌘I

