curl --request POST \
--url https://api.slng.ai/v1/pronunciation/dictionaries \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "brand-pronunciations",
"metadata": {
"language": "hi-IN",
"providers": [
"sarvam",
"cartesia"
]
},
"modes": {
"rewrite": {
"rules": [
{
"match": "NAIC",
"replace": "en ay eye see"
},
{
"match": "B2B",
"replace": "bee to bee"
}
]
}
}
}
'import requests
url = "https://api.slng.ai/v1/pronunciation/dictionaries"
payload = {
"name": "brand-pronunciations",
"metadata": {
"language": "hi-IN",
"providers": ["sarvam", "cartesia"]
},
"modes": { "rewrite": { "rules": [
{
"match": "NAIC",
"replace": "en ay eye see"
},
{
"match": "B2B",
"replace": "bee to bee"
}
] } }
}
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({
name: 'brand-pronunciations',
metadata: {language: 'hi-IN', providers: ['sarvam', 'cartesia']},
modes: {
rewrite: {
rules: [
{match: 'NAIC', replace: 'en ay eye see'},
{match: 'B2B', replace: 'bee to bee'}
]
}
}
})
};
fetch('https://api.slng.ai/v1/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://api.slng.ai/v1/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-pronunciations',
'metadata' => [
'language' => 'hi-IN',
'providers' => [
'sarvam',
'cartesia'
]
],
'modes' => [
'rewrite' => [
'rules' => [
[
'match' => 'NAIC',
'replace' => 'en ay eye see'
],
[
'match' => 'B2B',
'replace' => 'bee to bee'
]
]
]
]
]),
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.slng.ai/v1/pronunciation/dictionaries"
payload := strings.NewReader("{\n \"name\": \"brand-pronunciations\",\n \"metadata\": {\n \"language\": \"hi-IN\",\n \"providers\": [\n \"sarvam\",\n \"cartesia\"\n ]\n },\n \"modes\": {\n \"rewrite\": {\n \"rules\": [\n {\n \"match\": \"NAIC\",\n \"replace\": \"en ay eye see\"\n },\n {\n \"match\": \"B2B\",\n \"replace\": \"bee to bee\"\n }\n ]\n }\n }\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.slng.ai/v1/pronunciation/dictionaries")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"brand-pronunciations\",\n \"metadata\": {\n \"language\": \"hi-IN\",\n \"providers\": [\n \"sarvam\",\n \"cartesia\"\n ]\n },\n \"modes\": {\n \"rewrite\": {\n \"rules\": [\n {\n \"match\": \"NAIC\",\n \"replace\": \"en ay eye see\"\n },\n {\n \"match\": \"B2B\",\n \"replace\": \"bee to bee\"\n }\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.slng.ai/v1/pronunciation/dictionaries")
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 \"name\": \"brand-pronunciations\",\n \"metadata\": {\n \"language\": \"hi-IN\",\n \"providers\": [\n \"sarvam\",\n \"cartesia\"\n ]\n },\n \"modes\": {\n \"rewrite\": {\n \"rules\": [\n {\n \"match\": \"NAIC\",\n \"replace\": \"en ay eye see\"\n },\n {\n \"match\": \"B2B\",\n \"replace\": \"bee to bee\"\n }\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "pd_01abc...",
"org_id": "org_123",
"name": "brand-pronunciations",
"normalized_name": "brand-pronunciations",
"modes": {
"rewrite": {
"rules": [
{
"match": "NAIC",
"replace": "en ay eye see"
}
]
},
"ipa": {
"rules": [
{
"match": "SLNG",
"ipa": "slɪŋ"
}
]
}
},
"content_hash": "sha256:...",
"created_at": "2026-05-15T12:00:00.000Z",
"metadata": {
"language": "hi-IN",
"providers": [
"sarvam",
"cartesia"
]
},
"created_by_key_label": "production-key"
}{
"code": "invalid_pronunciation",
"error": "Invalid pronunciation dictionary reference."
}{
"code": "pronunciation_unauthenticated",
"error": "Missing or invalid organization context."
}{
"code": "pronunciation_conflict",
"error": "Pronunciation dictionary already exists: brand-pronunciations"
}{
"code": "pronunciation_unavailable",
"error": "Pronunciation dictionaries are temporarily unavailable."
}Create pronunciation dictionary
Create a reusable pronunciation dictionary for TTS rewrite rules.
curl --request POST \
--url https://api.slng.ai/v1/pronunciation/dictionaries \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "brand-pronunciations",
"metadata": {
"language": "hi-IN",
"providers": [
"sarvam",
"cartesia"
]
},
"modes": {
"rewrite": {
"rules": [
{
"match": "NAIC",
"replace": "en ay eye see"
},
{
"match": "B2B",
"replace": "bee to bee"
}
]
}
}
}
'import requests
url = "https://api.slng.ai/v1/pronunciation/dictionaries"
payload = {
"name": "brand-pronunciations",
"metadata": {
"language": "hi-IN",
"providers": ["sarvam", "cartesia"]
},
"modes": { "rewrite": { "rules": [
{
"match": "NAIC",
"replace": "en ay eye see"
},
{
"match": "B2B",
"replace": "bee to bee"
}
] } }
}
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({
name: 'brand-pronunciations',
metadata: {language: 'hi-IN', providers: ['sarvam', 'cartesia']},
modes: {
rewrite: {
rules: [
{match: 'NAIC', replace: 'en ay eye see'},
{match: 'B2B', replace: 'bee to bee'}
]
}
}
})
};
fetch('https://api.slng.ai/v1/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://api.slng.ai/v1/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-pronunciations',
'metadata' => [
'language' => 'hi-IN',
'providers' => [
'sarvam',
'cartesia'
]
],
'modes' => [
'rewrite' => [
'rules' => [
[
'match' => 'NAIC',
'replace' => 'en ay eye see'
],
[
'match' => 'B2B',
'replace' => 'bee to bee'
]
]
]
]
]),
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.slng.ai/v1/pronunciation/dictionaries"
payload := strings.NewReader("{\n \"name\": \"brand-pronunciations\",\n \"metadata\": {\n \"language\": \"hi-IN\",\n \"providers\": [\n \"sarvam\",\n \"cartesia\"\n ]\n },\n \"modes\": {\n \"rewrite\": {\n \"rules\": [\n {\n \"match\": \"NAIC\",\n \"replace\": \"en ay eye see\"\n },\n {\n \"match\": \"B2B\",\n \"replace\": \"bee to bee\"\n }\n ]\n }\n }\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.slng.ai/v1/pronunciation/dictionaries")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"brand-pronunciations\",\n \"metadata\": {\n \"language\": \"hi-IN\",\n \"providers\": [\n \"sarvam\",\n \"cartesia\"\n ]\n },\n \"modes\": {\n \"rewrite\": {\n \"rules\": [\n {\n \"match\": \"NAIC\",\n \"replace\": \"en ay eye see\"\n },\n {\n \"match\": \"B2B\",\n \"replace\": \"bee to bee\"\n }\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.slng.ai/v1/pronunciation/dictionaries")
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 \"name\": \"brand-pronunciations\",\n \"metadata\": {\n \"language\": \"hi-IN\",\n \"providers\": [\n \"sarvam\",\n \"cartesia\"\n ]\n },\n \"modes\": {\n \"rewrite\": {\n \"rules\": [\n {\n \"match\": \"NAIC\",\n \"replace\": \"en ay eye see\"\n },\n {\n \"match\": \"B2B\",\n \"replace\": \"bee to bee\"\n }\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "pd_01abc...",
"org_id": "org_123",
"name": "brand-pronunciations",
"normalized_name": "brand-pronunciations",
"modes": {
"rewrite": {
"rules": [
{
"match": "NAIC",
"replace": "en ay eye see"
}
]
},
"ipa": {
"rules": [
{
"match": "SLNG",
"ipa": "slɪŋ"
}
]
}
},
"content_hash": "sha256:...",
"created_at": "2026-05-15T12:00:00.000Z",
"metadata": {
"language": "hi-IN",
"providers": [
"sarvam",
"cartesia"
]
},
"created_by_key_label": "production-key"
}{
"code": "invalid_pronunciation",
"error": "Invalid pronunciation dictionary reference."
}{
"code": "pronunciation_unauthenticated",
"error": "Missing or invalid organization context."
}{
"code": "pronunciation_conflict",
"error": "Pronunciation dictionary already exists: brand-pronunciations"
}{
"code": "pronunciation_unavailable",
"error": "Pronunciation dictionaries are temporarily unavailable."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Unique dictionary name within the authenticated organization.
128^[A-Za-z0-9._-]+$"brand-pronunciations"
Pronunciation modes stored on the dictionary. Only rewrite is executable today.
Show child attributes
Show child attributes
Optional application metadata stored with the dictionary.
{
"language": "hi-IN",
"providers": ["sarvam", "cartesia"]
}
Response
Pronunciation dictionary created.
Immutable pronunciation dictionary identifier.
"pd_01abc..."
Organization that owns the dictionary.
"org_123"
Dictionary name.
"brand-pronunciations"
Normalized dictionary name used for lookups.
"brand-pronunciations"
Pronunciation modes stored on the dictionary. Only rewrite is executable today.
Show child attributes
Show child attributes
Content hash for the stored dictionary.
"sha256:..."
Creation timestamp.
"2026-05-15T12:00:00.000Z"
Optional application metadata stored with the dictionary.
{
"language": "hi-IN",
"providers": ["sarvam", "cartesia"]
}
API key label that created the dictionary, when available.
"production-key"
Was this page helpful?