User
Add a custom TTS voice
Register a voice from your own OpenAI-compatible text-to-speech server so Bolna voice agents can speak with it.
POST
/
user
/
tts
/
custom
cURL
curl --request POST \
--url https://api.bolna.ai/user/tts/custom \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"custom_tts_voice": "vivian",
"custom_tts_model": "Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice",
"custom_tts_url": "https://your-host/v1",
"custom_tts_key": "your-endpoint-key"
}
'import requests
url = "https://api.bolna.ai/user/tts/custom"
payload = {
"custom_tts_voice": "vivian",
"custom_tts_model": "Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice",
"custom_tts_url": "https://your-host/v1",
"custom_tts_key": "your-endpoint-key"
}
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({
custom_tts_voice: 'vivian',
custom_tts_model: 'Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice',
custom_tts_url: 'https://your-host/v1',
custom_tts_key: 'your-endpoint-key'
})
};
fetch('https://api.bolna.ai/user/tts/custom', 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.bolna.ai/user/tts/custom",
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([
'custom_tts_voice' => 'vivian',
'custom_tts_model' => 'Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice',
'custom_tts_url' => 'https://your-host/v1',
'custom_tts_key' => 'your-endpoint-key'
]),
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.bolna.ai/user/tts/custom"
payload := strings.NewReader("{\n \"custom_tts_voice\": \"vivian\",\n \"custom_tts_model\": \"Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice\",\n \"custom_tts_url\": \"https://your-host/v1\",\n \"custom_tts_key\": \"your-endpoint-key\"\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.bolna.ai/user/tts/custom")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"custom_tts_voice\": \"vivian\",\n \"custom_tts_model\": \"Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice\",\n \"custom_tts_url\": \"https://your-host/v1\",\n \"custom_tts_key\": \"your-endpoint-key\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bolna.ai/user/tts/custom")
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 \"custom_tts_voice\": \"vivian\",\n \"custom_tts_model\": \"Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice\",\n \"custom_tts_url\": \"https://your-host/v1\",\n \"custom_tts_key\": \"your-endpoint-key\"\n}"
response = http.request(request)
puts response.read_body{
"message": "custom TTS added successfully",
"status": "added",
"id": "<string>"
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}Registers one voice from your text-to-speech server, with the model, endpoint and key Bolna uses to call it. Send
custom_tts_key as an empty string if your server has no authentication. Read more in Custom TTS.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Add a voice from an OpenAI-compatible text-to-speech server
The voice name your server accepts, passed through unchanged. Unique within the scope
The model your server serves, passed through unchanged
OpenAI-compatible base URL, including the version segment. Bolna calls POST {base_url}/audio/speech
Bearer token sent to your endpoint. Stored encrypted. Send an empty string if your server has no authentication
Was this page helpful?
⌘I
cURL
curl --request POST \
--url https://api.bolna.ai/user/tts/custom \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"custom_tts_voice": "vivian",
"custom_tts_model": "Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice",
"custom_tts_url": "https://your-host/v1",
"custom_tts_key": "your-endpoint-key"
}
'import requests
url = "https://api.bolna.ai/user/tts/custom"
payload = {
"custom_tts_voice": "vivian",
"custom_tts_model": "Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice",
"custom_tts_url": "https://your-host/v1",
"custom_tts_key": "your-endpoint-key"
}
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({
custom_tts_voice: 'vivian',
custom_tts_model: 'Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice',
custom_tts_url: 'https://your-host/v1',
custom_tts_key: 'your-endpoint-key'
})
};
fetch('https://api.bolna.ai/user/tts/custom', 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.bolna.ai/user/tts/custom",
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([
'custom_tts_voice' => 'vivian',
'custom_tts_model' => 'Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice',
'custom_tts_url' => 'https://your-host/v1',
'custom_tts_key' => 'your-endpoint-key'
]),
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.bolna.ai/user/tts/custom"
payload := strings.NewReader("{\n \"custom_tts_voice\": \"vivian\",\n \"custom_tts_model\": \"Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice\",\n \"custom_tts_url\": \"https://your-host/v1\",\n \"custom_tts_key\": \"your-endpoint-key\"\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.bolna.ai/user/tts/custom")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"custom_tts_voice\": \"vivian\",\n \"custom_tts_model\": \"Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice\",\n \"custom_tts_url\": \"https://your-host/v1\",\n \"custom_tts_key\": \"your-endpoint-key\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bolna.ai/user/tts/custom")
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 \"custom_tts_voice\": \"vivian\",\n \"custom_tts_model\": \"Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice\",\n \"custom_tts_url\": \"https://your-host/v1\",\n \"custom_tts_key\": \"your-endpoint-key\"\n}"
response = http.request(request)
puts response.read_body{
"message": "custom TTS added successfully",
"status": "added",
"id": "<string>"
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}
