Create Pronunciation Dictionary
curl --request POST \
--url https://tavusapi.com/v2/pronunciation-dictionaries \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "Brand Terms",
"rules": [
{
"text": "Tavus",
"pronunciation": "TAH-vus",
"type": "alias"
}
]
}
'import requests
url = "https://tavusapi.com/v2/pronunciation-dictionaries"
payload = {
"name": "Brand Terms",
"rules": [
{
"text": "Tavus",
"pronunciation": "TAH-vus",
"type": "alias"
}
]
}
headers = {
"x-api-key": "<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': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Brand Terms',
rules: [{text: 'Tavus', pronunciation: 'TAH-vus', type: 'alias'}]
})
};
fetch('https://tavusapi.com/v2/pronunciation-dictionaries', 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://tavusapi.com/v2/pronunciation-dictionaries",
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([
'name' => 'Brand Terms',
'rules' => [
[
'text' => 'Tavus',
'pronunciation' => 'TAH-vus',
'type' => 'alias'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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://tavusapi.com/v2/pronunciation-dictionaries"
payload := strings.NewReader("{\n \"name\": \"Brand Terms\",\n \"rules\": [\n {\n \"text\": \"Tavus\",\n \"pronunciation\": \"TAH-vus\",\n \"type\": \"alias\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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://tavusapi.com/v2/pronunciation-dictionaries")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Brand Terms\",\n \"rules\": [\n {\n \"text\": \"Tavus\",\n \"pronunciation\": \"TAH-vus\",\n \"type\": \"alias\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tavusapi.com/v2/pronunciation-dictionaries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Brand Terms\",\n \"rules\": [\n {\n \"text\": \"Tavus\",\n \"pronunciation\": \"TAH-vus\",\n \"type\": \"alias\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"pronunciation_dictionary_id": "pd_abc123def456gh",
"name": "Brand Terms",
"rules": [
{
"text": "Tavus",
"pronunciation": "TAH-vus",
"type": "alias",
"case_sensitive": false,
"word_boundaries": true
}
],
"rules_count": 1,
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z"
}{
"error": "Invalid request: name is required"
}{
"message": "Invalid access token"
}Pronunciation Dictionaries
Create Pronunciation Dictionary
Create a pronunciation dictionary with custom rules for controlling how words are spoken. Rules are automatically synced to both Cartesia and ElevenLabs so they work regardless of which TTS engine your PAL uses.
POST
/
v2
/
pronunciation-dictionaries
Create Pronunciation Dictionary
curl --request POST \
--url https://tavusapi.com/v2/pronunciation-dictionaries \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "Brand Terms",
"rules": [
{
"text": "Tavus",
"pronunciation": "TAH-vus",
"type": "alias"
}
]
}
'import requests
url = "https://tavusapi.com/v2/pronunciation-dictionaries"
payload = {
"name": "Brand Terms",
"rules": [
{
"text": "Tavus",
"pronunciation": "TAH-vus",
"type": "alias"
}
]
}
headers = {
"x-api-key": "<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': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Brand Terms',
rules: [{text: 'Tavus', pronunciation: 'TAH-vus', type: 'alias'}]
})
};
fetch('https://tavusapi.com/v2/pronunciation-dictionaries', 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://tavusapi.com/v2/pronunciation-dictionaries",
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([
'name' => 'Brand Terms',
'rules' => [
[
'text' => 'Tavus',
'pronunciation' => 'TAH-vus',
'type' => 'alias'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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://tavusapi.com/v2/pronunciation-dictionaries"
payload := strings.NewReader("{\n \"name\": \"Brand Terms\",\n \"rules\": [\n {\n \"text\": \"Tavus\",\n \"pronunciation\": \"TAH-vus\",\n \"type\": \"alias\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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://tavusapi.com/v2/pronunciation-dictionaries")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Brand Terms\",\n \"rules\": [\n {\n \"text\": \"Tavus\",\n \"pronunciation\": \"TAH-vus\",\n \"type\": \"alias\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tavusapi.com/v2/pronunciation-dictionaries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Brand Terms\",\n \"rules\": [\n {\n \"text\": \"Tavus\",\n \"pronunciation\": \"TAH-vus\",\n \"type\": \"alias\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"pronunciation_dictionary_id": "pd_abc123def456gh",
"name": "Brand Terms",
"rules": [
{
"text": "Tavus",
"pronunciation": "TAH-vus",
"type": "alias",
"case_sensitive": false,
"word_boundaries": true
}
],
"rules_count": 1,
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z"
}{
"error": "Invalid request: name is required"
}{
"message": "Invalid access token"
}For AI agents, use
https://docs.tavus.io/openapi.yaml for the full HTTP API contract.Body
application/json
List of pronunciation rules. Duplicate text values are not allowed. You can omit rules at creation and add them later via Update Pronunciation Dictionary.
Show child attributes
Show child attributes
Example:
[
{
"text": "Tavus",
"pronunciation": "TAH-vus",
"type": "alias"
}
]
Response
Pronunciation dictionary created successfully

