Tts
Turn text into speech in a voice you choose, with pronunciations you control. Speak a sentence or stream speech as it is made.
The voice list has every provider's voices, one row per voice, with
filters and counts (gender, accent, language, style, model), each
provider's models with their cost and default, and your organization's
custom voices. Speaking runs the same path as a call: text
normalization, your organization's pronunciation dictionary, the
voice's provider and model, voice controls, and the speech cache.
speak returns a link to the audio (async mode for long text),
speak/stream streams it back as it is made, and the speech socket
takes many pieces of text over one connection. Speech is billed per
character.
The pronunciation dictionary controls how voices say words on your
calls. Entries come in three layers, later ones winning on the same
term: the platform's built-in entries (global), entries for your
organization's domain, and your organization's own (org), the only
layer you can change. An entry has a respelling every provider reads
and optional IPA for providers that accept phonemes. Calls pick up a
change within about ten minutes; these routes always read fresh.
Use this resource to work with voices and speech directly; to change
the voice an agent uses on calls, edit the agent's tts settings
(Entities API).
Operations
- Create a custom voice from a recording of someone speaking.
POST /Platform/tts/voices/clone - Delete a custom voice your organization created.
POST /Platform/tts/voices/delete - Get the sentence voice samples speak in a language.
GET /Platform/tts/sample-sentence - Preview how the voice engine says a sentence.
GET /Platform/tts/pronunciations/preview - List the pronunciation dictionary voice calls use in your organization.
GET /Platform/tts/pronunciations - Remove a word from your organization's pronunciation dictionary.
POST /Platform/tts/pronunciations/remove - Search the pronunciation dictionary for entries similar to a word.
GET /Platform/tts/pronunciations/search - Add or change how a word is spoken on your organization's calls.
POST /Platform/tts/pronunciations/set - Speak text in a voice and get a link to the audio.
POST /Platform/tts/speak - Speak text in a voice and stream the audio back as it is made.
POST /Platform/tts/speak/stream - Suggest how a word sounds, in IPA, for a pronunciation entry.
GET /Platform/tts/pronunciations/suggest-ipa - List voices to choose an agent's voice from.
GET /Platform/tts/voices
Channels
- Stream text in and speech out, with no agent or call involved
WEBSOCKET /Platform/tts/stream
Objects
IpaSuggestion
term: str. The word or phrase.ipa: str. Its sounds in IPA, words separated by spaces.
PronunciationEntry
term: str. Word or phrase as the agent writes it; matched case-insensitively on whole words.spoken: str. What the voice engine says instead, usually a phonetic respelling.source: str. Layer the entry comes from: global, a domain name (e.g. veterinary), or org.ipa: optional str or null. The word's sounds in IPA (International Phonetic Alphabet), used instead ofspokenwhere the voice's provider and model accept phonemes.
PronunciationPreview
text: str. The sentence as given.spoken_text: str. The sentence after text normalization and the pronunciation dictionary: what the voice engine is sent.audio_url: optional str or null. Signed URL of the sentence spoken in the default call voice (WAV, valid for 24 hours); set only whenspeakwas true.
SampleSentence
language: str. Two-letter language code.text: str. The sentence.
SpeechResult
audio_url: str. Signed link to the audio in the requested format, valid for 24 hours.format: str. The audio format: wav, mp3, pcm (16-bit little-endian mono) or mulaw.sample_rate: int. Samples per second of the audio.duration_ms: int. Length of the audio in milliseconds.characters: int. Characters synthesized (what speech is billed by).words: optional List[SpokenWord] or null. Each word with its start and end, whentimestampswas true.
VoiceList
voices: List[VoiceOption]. Voices on this page, by name, one row per voice.total: int. Voices matching the filters, across all pages.offset: optional int. Voices skipped before this page.providers: optional List[TTSProviderInfo]. Every provider with its models; filter by one withprovider.facets: optional Dict[str, List[FacetValue]] or null. Withfacets, on the first page: per filter (provider, model, gender, age, language, accent, style), its values by how many voices each matches under the other filters, most first.match: optional "exact" or "similar".exact: the voices contain the search text (or there is no search).similar: none did, so these are the voices closest in meaning to the search, nearest first, on one page.
VoiceOption
provider: str. The voice's provider; set it as an agent'stts.provider.voice_id: str. The provider's voice id; set it astts.voice_id.name: optional str or null. The voice's display name.description: optional str or null. The provider's short description of how the voice sounds.gender: optional str or null. The voice's gender as the provider labels it; empty when the provider gives none.accent: optional str or null. The voice's accent as the provider labels it.age: optional str or null. The voice's apparent age as the provider labels it.use_cases: optional List[str]. What the provider says the voice suits, e.g. customer support.tags: optional List[str]. Words the provider uses for how the voice sounds, e.g. warm, calm.locale: optional str or null. The voice's native locale, e.g. en-US, when the provider gives one.languages: optional List[str]. Two-letter codes of the languages the voice speaks.models: optional List[str]. Models the voice can be used with; any of them is a validtts.model_id.default_model_id: optional str or null. The model to use unless you need another; set it astts.model_id.custom: optional bool. True for a voice your organization cloned (only your organization sees it).