Telnyx Voice: TTS — Full Documentation
Complete page content for TTS (Voice section) of the Telnyx developer docs (https://developers.telnyx.com). Root index: https://developers.telnyx.com/llms.txt · Lightweight index for this subsection: https://developers.telnyx.com/development/llms/voice-tts-llms-txt.md
Overview
Source: https://developers.telnyx.com/docs/voice/tts/overview.md
1. Choose your interface
Real-time streaming. Send text, receive audio chunks as they’re synthesized. HTTP POST. Get audio back as binary, base64, or async URL. OpenAI SDK compatible. TTS during live calls via Call Controlspeak or TeXML “.
2. Choose a pre-built voice
Natural, NaturalHD, Ultra, Kokoro, Qwen3TTS, xAI Grok. AWS Polly, Azure, ElevenLabs, Minimax, MurfAI, Rime, Resemble, Inworld, Fish Audio.3. Or create your own
Clone and design custom voices. Available on select providers: Qwen3TTS, Minimax, ElevenLabs, Resemble.WebSocket Streaming
Lifecycle
Source: https://developers.telnyx.com/docs/voice/tts/websocket-streaming.mdReal-time text-to-speech over a persistent WebSocket connection. Send text, receive audio.
Endpoint
Connection Lifecycle
1. Handshake
There are two ways to establish a connection:Direct WebSocket connection
You can connect directly to the WebSocket endpoint by passing all configuration as query parameters in thewss:// URL:
HTTP upgrade
Alternatively, initiate the connection as an HTTP GET request that upgrades to a WebSocket via the standard101 Switching Protocols handshake. This is what happens under the hood when a WebSocket client connects, and may be relevant if you need fine-grained control over the upgrade (e.g., setting custom headers in environments where the WebSocket library doesn’t expose them directly).
Initialization frame
Regardless of how the connection is established, send an initialization frame before any text:voice_settings to configure provider-specific parameters:
2. Streaming
Once initialized, text and audio flow concurrently — no request/response pairing. Text is buffered and synthesized at sentence boundaries. Client → Server
Server → Client
See Messages for the complete wire protocol reference.
"flush": true to force synthesis of buffered partials.
Text preprocessing: Markdown formatting is automatically stripped before synthesis (headers, bold, italics, code blocks, links, lists, emoji). Useful when synthesizing LLM output. Pronunciation dictionary replacements are applied if pronunciation_dict_id is set.
Streamed vs. concatenated delivery: Most providers (Telnyx Natural/NaturalHD/Qwen3TTS, Rime, Minimax, Resemble, Inworld) stream audio in separate frames where text is null. AWS Polly and Azure return audio in the text-bearing chunk instead. See Messages for details.
3. Teardown
Send{"text": ""} (empty string) to flush remaining buffered text and close gracefully. The server finishes synthesis, sends any remaining audio and a final frame, then closes the WebSocket.
Configuration
Source: https://developers.telnyx.com/docs/voice/tts/websocket-streaming/configuration.md
Two Configuration Surfaces
Both are one-shot. After the init frame, no configuration can change for the session. To change settings, open a new connection.
Query Parameters
Set on the URL at connect time. Immutable for the session.Voice Selection
The
voice_id segment (third part of the voice string) refers to different things depending on the provider and model:
The Voices API (
GET /v2/ai/tts/voices) returns all voices available to your account — pre-built and cloned — with each voice’s compound id ready to use as the voice parameter.
Connection Options
|
disable_cache | boolean | false | Bypass the audio cache and always synthesize fresh. |
Example
Voice Settings
Provider-specific tuning (speed, pitch, format, emotion, etc.) is not set via query parameters. It is passed once in thevoice_settings object on the initialization frame:
Messages
Source: https://developers.telnyx.com/docs/voice/tts/websocket-streaming/messages.md
Client → Server
All client messages are JSON text frames.Text Frame
Text to synthesize." " (single space) for handshake. "" (empty string) for end-of-sequence.
Provider-specific voice configuration. Only used in the handshake frame ({"text": " "}). See Voice Settings.
When true, immediately synthesizes all buffered text without waiting for a sentence boundary. Default: false.
When true, stops the current synthesis worker and starts a new one. The original handshake is replayed automatically. Use for barge-in/interruption.
Message Sequence
1. Handshake (required first message):Server → Client
All server messages are JSON text frames.Audio Chunk
Returned when synthesis produces audio for a complete sentence.null when the provider uses streamed delivery — audio arrives in separate streamed chunk frames instead. See note below.
The text segment this audio corresponds to. null for streamed audio chunks.
false for audio chunks.
true if audio was served from cache.
Time in milliseconds from speech request to first audio frame. Only present on the first chunk of each synthesis.
Streamed Audio Chunk
For providers that stream audio incrementally (Telnyx Natural, NaturalHD, Qwen3TTS, Rime, Minimax, Resemble, Inworld), audio arrives in separate frames:text is always null). The concatenated audio chunk for these providers has audio: null — only the streamed chunks carry audio bytes.
For AWS Polly and Azure, audio is returned in the audio field of the regular audio chunk frame. For all other providers, ignore the audio field on the text-bearing chunk and collect audio from the streamed frames.
Final Frame
Signals that synthesis is complete for the current text input:Error Frame
Errors
Source: https://developers.telnyx.com/docs/voice/tts/websocket-streaming/errors.md
HTTP Errors (Handshake)
These occur during the WebSocket upgrade request, before the connection is established.WebSocket Errors (Runtime)
After the connection is established, errors arrive as JSON frames:Error Messages
Troubleshooting
Examples
Source: https://developers.telnyx.com/docs/voice/tts/websocket-streaming/examples.md
Basic Streaming
Python
JavaScript
Conversational (Barge-In)
Send multiple text segments and interrupt mid-synthesis:LLM Token Streaming
Stream tokens from an LLM directly to TTS. The server buffers text and synthesizes at sentence boundaries:REST API
Overview
Source: https://developers.telnyx.com/docs/voice/tts/rest-api.md
How It Works
You send text in, audio streams back over the same HTTP connection. No polling, no callbacks. The response uses HTTP chunked transfer encoding — audio chunks arrive as they’re synthesized. Your client can begin playback immediately without waiting for the full file. The connection stays open until synthesis completes or 30 seconds pass with no new chunks. This makes REST suitable for real-time playback, not just batch file generation. For multi-turn conversational use cases where you’re continuously feeding text, use WebSocket Streaming instead.Text Preprocessing
Before synthesis, text passes through two stages:- Markdown stripping — headers, bold, italics, code blocks, links, lists, emoji are converted to plain text.
- Pronunciation dictionary — if
pronunciation_dict_idis set, custom word replacements are applied.
API Reference
The full OpenAPI spec for these endpoints is available in the auto-generated API Reference. Note: the OAS is currently being cleaned up — some fields and provider-specific schemas may be incomplete.Request
Source: https://developers.telnyx.com/docs/voice/tts/rest-api/request.md
Endpoint
Example
Request Body
Response
Source: https://developers.telnyx.com/docs/voice/tts/rest-api/response.mdThe
output_type request field controls what comes back.
Streaming Audio (default)
Withoutput_type: "binary_output" (or omitted), the response is raw audio over HTTP chunked transfer encoding:
Base64
Withoutput_type: "base64_output", the full audio is returned as a JSON payload after synthesis completes:
Async (audio_id)
Withoutput_type: "audio_id", synthesis runs in the background. You get a URL back immediately:
GET /v2/text-to-speech/speech/:audio_id. If the audio is still synthesizing, the GET response itself streams chunks as they become available.
Examples
Source: https://developers.telnyx.com/docs/voice/tts/rest-api/examples.md
OpenAI SDK Compatibility
The REST endpoint is a drop-in replacement for the OpenAI Audio API:API Reference
Source: https://developers.telnyx.com/docs/voice/tts/rest-api/api-reference.mdSee the full API reference: Generate Speech from Text.
Providers
Overview
Source: https://developers.telnyx.com/docs/voice/tts/providers/telnyx.md
Selecting Telnyx
Telnyx is the default provider. If you don’t specify a provider, you get Telnyx. WebSocket:Models
Ultra is REST-only, not available over public WebSocket. Grok is available for Voice AI Assistants and direct REST TTS calls.
Browse all available voices via the Voices API or the Voice Design.
Natural
Source: https://developers.telnyx.com/docs/voice/tts/providers/telnyx/natural.mdVoice format:
Telnyx.Natural.
Pre-built English voices backed by Rime Mist.
Voice Samples
WebSocket
Query Parameters
Voice Settings
Send in the init frame ({"text": " "}):
REST API
Fields
Response
Default (binary_output): chunked audio bytes with Content-Type: audio/mpeg (or audio/wav, audio/pcm).
With output_type: "base64_output": JSON with base64-encoded audio.
With output_type: "audio_id": JSON with an audio_url for deferred retrieval.
NaturalHD
Source: https://developers.telnyx.com/docs/voice/tts/providers/telnyx/naturalhd.mdVoice format:
Telnyx.NaturalHD.
Pre-built voices backed by Rime Arcana. 9 languages: en, fr, de, es, ar, hi, ja, he, pt.
Voice Samples
WebSocket
Query Parameters
Voice Settings
Send in the init frame ({"text": " "}):
REST API
Fields
Response
Default (binary_output): chunked audio bytes with Content-Type: audio/mpeg (or audio/wav, audio/pcm).
With output_type: "base64_output": JSON with base64-encoded audio.
With output_type: "audio_id": JSON with an audio_url for deferred retrieval.
KokoroTTS
Source: https://developers.telnyx.com/docs/voice/tts/providers/telnyx/kokoro.mdVoice format:
Telnyx.KokoroTTS.
Lightweight, lowest-latency model. 5 languages: en, es, fr, it, pt.
Voice Samples
WebSocket
Query Parameters
Voice Settings
None. All synthesis parameters are fixed. The init frame only needs{"text": " "}.
REST API
Fields
No model-specific fields. Audio format is always MP3.Response
Default (binary_output): chunked audio bytes with Content-Type: audio/mpeg.
With output_type: "base64_output": JSON with base64-encoded audio.
With output_type: "audio_id": JSON with an audio_url for deferred retrieval.
Qwen3TTS
Source: https://developers.telnyx.com/docs/voice/tts/providers/telnyx/qwen3.mdVoice format:
Telnyx.Qwen3TTS.
Voice cloning model. 11 languages: en, zh, fr, de, it, ja, ko, pt, ru, es, ar.
The voice_id is the name of a clone you created in the Voice Design. Clones are scoped to your organization.
Voice Samples
WebSocket
Query Parameters
Voice Settings
Send in the init frame ({"text": " "}):
REST API
Fields
Response
Default (binary_output): chunked PCM audio bytes. Always 24kHz signed 16-bit LE mono.
With output_type: "base64_output": JSON with base64-encoded PCM.
With output_type: "audio_id": JSON with an audio_url for deferred retrieval.
Ultra
Source: https://developers.telnyx.com/docs/voice/tts/providers/telnyx/ultra.mdVoice format:
Telnyx.Ultra.
Sub-100ms latency. 36 languages.
REST only — Ultra is not available over public WebSocket.
Voice Samples
SSML Emotions
Ultra supports inline SSML emotion tags. Place the tag before the text:angry, excited, content, sad, scared.
Additional: happy, enthusiastic, curious, calm, grateful, affectionate, sarcastic, surprised, confident, hesitant, apologetic, determined, frustrated, disappointed.
Omitting the tag = neutral delivery. Use sparingly — Ultra interprets emotional subtext from the text itself.
Nonverbal Cues
Insert[laughter] inline for natural laughing:
Language Support
Setlanguage_boost to improve pronunciation for the target language:
Arabic, Bengali, Bulgarian, Chinese, Czech, Danish, Dutch, English, Finnish, French, German, Gujarati, Hebrew, Hindi, Indonesian, Italian, Japanese, Korean, Malay, Marathi, Māori, Norwegian, Polish, Portuguese, Punjabi, Romanian, Russian, Slovak, Spanish, Swedish, Tamil, Telugu, Thai, Turkish, Ukrainian, Vietnamese.
REST API
Fields
Response
Default (binary_output): chunked audio bytes with Content-Type: audio/mpeg.
With output_type: "base64_output": JSON with base64-encoded audio.
With output_type: "audio_id": JSON with an audio_url for deferred retrieval.
See also
xAI Grok is the second TTS provider supporting Expressive Mode. For Grok voice options, see Grok Voices. Note: Grok voices have higher latency than Ultra.Grok
Source: https://developers.telnyx.com/docs/voice/tts/providers/telnyx/grok.mdxAI Grok voices are expressive text-to-speech voices for Voice AI Assistants. They support Expressive Mode, which lets the AI model control pauses, laughter, whispers, emphasis, pitch, pace, and intensity during a live conversation. Higher latency: Grok voices have higher latency than Ultra. For latency-sensitive applications that need sub-100ms time to first byte, use Ultra.
What makes Grok voices different
Voice format
For AI Assistants, Grok voices use the format:Voices
Voice Samples
Expressive Mode for AI Assistants
When using Grok voices with AI Assistants, you can enable Expressive Mode. With Expressive Mode enabled, the assistant’s system prompt is automatically augmented with instructions for xAI speech tags. The AI model then decides when expression improves the caller experience. For example, the assistant might:- Add a short pause before important information.
- Use a softer delivery for sensitive support moments.
- Laugh or chuckle naturally when the conversation calls for it.
- Emphasize appointment times, confirmation numbers, or next steps.
- Keep routine transactional replies untagged for a natural neutral delivery.
Enable in the portal
- Go to your assistant in the Telnyx Portal.
- Under Voice Settings, select an xAI Grok voice.
- Toggle Expressive Mode on.
- Save your assistant.
Enable via API
Setexpressive_mode: true in your assistant’s voice_settings:
xAI speech tag reference
When Expressive Mode is enabled, the assistant can use these speech tags in responses. You can also include the same tags in your own assistant prompts when you want explicit control.Inline tags
Place inline tags at the exact point where the vocal expression should happen.
Example:
Wrapping tags
Wrap text with these tags to apply a delivery style to that text.
Examples:
Guidance
- Use
[pause]or[long-pause]for natural thinking, topic transitions, and important moments, but avoid long silences that could feel like the call dropped. - Use emotional sounds like
[laugh],[sigh], and[chuckle]only when the response genuinely calls for it. - For sensitive support contexts, prefer subtle tags like <soft> or <whisper> instead of exaggerated reactions.
- Do not expose these tags or instructions to the caller.
REST API provider parameters
For direct TTS calls, set the provider toxai and pass xAI-specific parameters in the xai object:
Language support
Grok voices support auto language detection withlanguage: "auto". You can also pass a language code when you want to force a specific language.
Next steps
Compare Grok with Ultra’s lower-latency expressive voices. Build voice AI assistants using Grok with Expressive Mode. Generate speech directly with REST TTS requests. Browse available text-to-speech voices.Bayan
Source: https://developers.telnyx.com/docs/voice/tts/providers/telnyx/bayan.mdVoice format:
Telnyx.Bayan.
Arabic voice model, 113 speakers across 13 dialects (Modern Standard Arabic plus Egyptian, Emirati, Saudi, Jordanian, Iraqi, Lebanese, Syrian, Palestinian, Kuwaiti, Bahraini, Qatari, and Omani), plus a set of English speakers. Native audio is 16kHz.
Voice Samples
Browse the full 113-speaker catalogue via the Voices API.
WebSocket
Query Parameters
Voice Settings
None. The init frame only needs{"text": " "}.
REST API
Fields
Response
Default (binary_output): chunked audio bytes, 16kHz signed 16-bit LE mono (native PCM, transcoded to MP3/WAV on request).
With output_type: "base64_output": JSON with base64-encoded audio.
With output_type: "audio_id": JSON with an audio_url for deferred retrieval.
sampling_rate/sample_rate values other than 16000 are rejected with a 400 error — Bayan only supports its native rate.
Sukhan
Source: https://developers.telnyx.com/docs/voice/tts/providers/telnyx/sukhan.mdVoice format:
Telnyx.Sukhan.
Urdu-only voice model, 14 curated voices. No prosody controls (speed/pitch) or language selection — each voice speaks Urdu only. Native audio is 22050Hz.
Voice Samples
Browse the full 14-voice catalogue via the Voices API.
WebSocket
Query Parameters
Voice Settings
None. No prosody controls are exposed —voice_speed and other settings have no effect if sent. The init frame only needs {"text": " "}.
REST API
Fields
Response
Default (binary_output): chunked audio bytes, 22050Hz signed 16-bit LE mono (native PCM, transcoded to MP3 on request).
With output_type: "base64_output": JSON with base64-encoded audio.
With output_type: "audio_id": JSON with an audio_url for deferred retrieval.
sampling_rate/sample_rate values other than 22050 are rejected with a 400 error. Unsupported format values are also rejected — REST response_format accepts only pcm/mp3; WebSocket audio_format accepts only mp3/linear16 (its PCM equivalent). Neither accepts wav.
Rime
Source: https://developers.telnyx.com/docs/voice/tts/providers/rime.md
Models
Voice Format
Voice Samples
WebSocket
Query Parameters
Voice Settings
REST API
Fields
Response
Default (binary_output): chunked audio bytes.
With output_type: "base64_output": JSON with base64-encoded audio.
With output_type: "audio_id": JSON with an audio_url for deferred retrieval.
Minimax
Source: https://developers.telnyx.com/docs/voice/tts/providers/minimax.mdVoice format:
minimax..
voice_id can be a system voice (pre-built) or a cloned voice from the Voice Design (organization-scoped).
Voice Samples
WebSocket
Query Parameters
Voice Settings
REST API
Fields
Response
Default (binary_output): chunked audio bytes.
With output_type: "base64_output": JSON with base64-encoded audio.
With output_type: "audio_id": JSON with an audio_url for deferred retrieval.
Resemble
Source: https://developers.telnyx.com/docs/voice/tts/providers/resemble.mdVoice format:
resemble.Turbo.
Default model: Turbo. voice_id is a voice from your own Resemble account.
Voice Samples
WebSocket
Query Parameters
Voice Settings
REST API
Fields
Response
Default (binary_output): chunked audio bytes.
With output_type: "base64_output": JSON with base64-encoded audio.
With output_type: "audio_id": JSON with an audio_url for deferred retrieval.
Inworld
Source: https://developers.telnyx.com/docs/voice/tts/providers/inworld.mdVoice format:
inworld..
Models:
inworld-tts-1.5-mini(aliasMini) — faster, lower latency.inworld-tts-1.5-max(aliasMax) — higher quality.inworld-tts-2(aliasTTS2) — latest generation; supports thedelivery_modeparameter.
inworld-tts-1.5-mini if model omitted.
Voice Samples
WebSocket
Query Parameters
Voice Settings
REST API
Fields
Response
Default (binary_output): chunked audio bytes.
With output_type: "base64_output": JSON with base64-encoded audio.
With output_type: "audio_id": JSON with an audio_url for deferred retrieval.
xAI
Source: https://developers.telnyx.com/docs/voice/tts/providers/xai.mdVoice format:
xAI.
xAI Grok voices are expressive, multilingual text-to-speech voices. They support inline speech tags for pauses, vocal sounds, emphasis, pitch, pace, and intensity.
xAI Grok voices are higher-latency than Telnyx Ultra. For latency-sensitive applications that need sub-100ms time to first byte, use Ultra.
Voices
Voice Samples
WebSocket
xAI Grok voices are not available on the public TTS WebSocket API. Use the REST API for direct text-to-speech generation, or use xAI Grok voices with AI Assistants.REST API
Fields
Response
Default (binary_output): chunked audio bytes.
With output_type: "base64_output": JSON with base64-encoded audio.
With output_type: "audio_id": JSON with an audio_url for deferred retrieval.
Expressive speech tags
Use speech tags inline intext when you want more expressive delivery.
AI Assistants
For AI Assistants, choose an xAI Grok voice such asxAI.eve and enable Expressive Mode to let the assistant decide when speech tags improve the caller experience.
Build voice AI assistants using xAI Grok voices with Expressive Mode.
Generate speech directly with REST TTS requests.
Fish Audio
Source: https://developers.telnyx.com/docs/voice/tts/providers/fishaudio.mdVoice format:
FishAudio..
Fish Audio is a Telnyx-hosted external TTS provider. Telnyx exposes a hand-vetted shortlist of Fish Audio voices from their public Voice Library.
Fish Audio is cross-lingual — any voice can speak any language from the input text. The language field in the voice listing is the voice’s native accent only, not a synthesis constraint.
Models
All curated voices are available under all three models.
Curated Voices
Only curated catalog voices are accepted for synthesis. Arbitrary Fish Voice-Library
reference_ids cannot be used under the Telnyx API key.
Emotion Tags
Fish Audio S2 models (s2.1-pro, s2-pro) support inline emotion, tone, and audio-effect markers placed directly in the input text. S1 uses parentheses — (happy) — instead of brackets. The markers are processed by the upstream Fish Audio API and do not add latency or count toward token limits.
text field. Markers can be combined for layered effects — [excited][laughing] We won! Ha ha! — and accept intensity modifiers like [slightly sad], [very excited], [extremely angry].
For the full list of supported emotions, tone markers, audio effects, and S1 syntax, see Fish Audio’s Emotion Control guide.
WebSocket
Query Parameters
Voice Settings
Fish Audio does not expose speed or pitch controls.voice_settings are limited to format and sample rate overrides. Emotion and tone are controlled inline in the text via bracket markers — see Emotion Tags below.
REST API
Fields
Response
Default (binary_output): chunked audio bytes.
With output_type: "base64_output": JSON with base64-encoded audio.
With output_type: "audio_id": JSON with an audio_url for deferred retrieval.
Audio Formats & Sample Rates
Each format has a fixed set of accepted sample rates:
On WebSocket, the
audio_format query parameter and voice_settings.format are independent parameters with different vocabularies. The audio_format query param accepts mp3, wav, and linear16 (which maps to pcm). The voice_settings.format field accepts mp3, wav, pcm, and opus directly. If both are set, voice_settings.format takes precedence.
In-Call Playback
Fish Audio is available for in-call TTS via Call Controlspeak and TeXML “. For telephony playback, the gateway automatically delivers MP3 at 44.1 kHz to ensure correct resampling by the call-control audio pipeline.
See In-Call Playback for details.
Provider Docs
AWS Polly
Source: https://developers.telnyx.com/docs/voice/tts/providers/aws.mdVoice format:
aws.Polly..
Example: aws.Polly.Generative.Lucia
The engine can also be parsed from a hyphenated suffix on the voice ID — e.g., Lucia-longform resolves to engine long-form.
Voice Samples
WebSocket
Query Parameters
Voice Settings
REST API
Fields
Response
Default (binary_output): chunked audio bytes. Format depends on output_format.
With output_type: "base64_output": JSON with base64-encoded audio.
With output_type: "audio_id": JSON with an audio_url for deferred retrieval.
SSML Tags
Source: https://developers.telnyx.com/docs/voice/tts/providers/aws/ssml-tags.mdIn this tutorial, you’ll learn about SSML tags that can help customize your audio response in your text-to-speech application. This tutorial assumes you’ve already set up your developer account and environment and you know how to send commands and receive webhooks using the Telnyx Voice API.
What are SSML tags?
Speech Synthesis Markup Language (SSML) is an XML-based markup language that is used to generate synthetic speech for appliations. SSML tags are used to change the tone of speech in the application by adjusting pitching, volume, duration of speech, and more.SSML tag examples
Adding a pause
SSML Tag:
There are 2 ways for defining the length of the pause by using the following attributes:
- Time: Defines the number of s or ms
- Strength: Chooses the strength using the following values:
- None: no pause
- Pause: the same duration as after a period
- x-weak: the same as none.
- weak: sets a pause of the same duration as the pause after a comma
- medium: has the same strength as weak
- strong: sets a pause of the same duration as the pause after a sentence
- x-strong: sets a pause of the same duration as the pause after a paragraph.
Emphasizing words
SSML Tag:- Strong - increases the volume and slows the speaking rate
- Moderate - increases the volume and slows the speaking rate, but less than Strong
- Reduced - decreases the volume and speeds up the speaking rate
Set a different language
SSML Tag:Adding a pause between paragraphs
SSML Tag:Using phonetic pronunciation
SSML Tag:- Alphabet, with the following options:
- ipa, meaning the International Phonetic Alphabet (IPA) will be used
- x-sampa, which indicates that the Extended Speech Assessment Methods Phonetic Alphabet (X-SAMPA) will be used.
- ph, specifies how the text should be pronounced.
Controlling volume, speaking rate, and pitch
SSML Tag::- Volume:
- default: resets the volume to default value
- silent, x-soft, soft, medium, loud, x-loud: sets the volume to predefined value
- +ndB, -ndB: changes the volume relative to the current level
- Rate:
- x-slow, slow, medium, fast,x-fast: sets the pitch to a predefined value
- n%: a percentage change in speaking pace.
Adding a pause between sentences
SSML Tag:Controlling how special words are spoken
SSML Tags:- characters or spell-out
- cardinal or number
- digits
- fraction
- unit
- date
- time
- address
- telephone.
Pronouncing acronyms and abbreviations
SSML Tag:Azure
Source: https://developers.telnyx.com/docs/voice/tts/providers/azure.mdVoice format:
azure.
Example: azure.en-US-AvaMultilingualNeural
No model ID segment — Azure voices are flat identifiers. Default voice: en-US-AvaMultilingualNeural.
Voice Samples
WebSocket
Query Parameters
Voice Settings
REST API
Fields
Response
Default (binary_output): chunked audio bytes.
With output_type: "base64_output": JSON with base64-encoded audio.
With output_type: "audio_id": JSON with an audio_url for deferred retrieval.
ElevenLabs
Source: https://developers.telnyx.com/docs/voice/tts/providers/elevenlabs.mdElevenLabs requires your own API key configured in your Telnyx account. Telnyx relays requests to the ElevenLabs API — voice settings are passed through directly. Voice format:
elevenlabs..
Example: elevenlabs.v3.Adam
voice_id is a voice from your own ElevenLabs account — pre-built, cloned, or designed. Preview voices at elevenlabs.io/voice-library.
WebSocket
Query Parameters
Voice Settings
Relayed directly to the ElevenLabs API. Any field ElevenLabs accepts can be passed here.REST API
Fields
Response
Default (binary_output): chunked audio bytes. Format determined by ElevenLabs.
With output_type: "base64_output": JSON with base64-encoded audio.
With output_type: "audio_id": JSON with an audio_url for deferred retrieval.
Other
Pronunciation Dictionaries
Source: https://developers.telnyx.com/docs/voice/tts/pronunciation-dictionaries.mdPronunciation dictionaries let you control how specific words and phrases are spoken during text-to-speech synthesis. Dictionaries are applied automatically before speech generation — no changes to your text input required.
Item Types
Each dictionary contains up to 100 items. Two types are supported:Alias (text replacement)
Replaces matched text with alternative text before synthesis:Phoneme (IPA notation)
Specifies exact pronunciation using the International Phonetic Alphabet:Using a Dictionary
Pass the dictionary ID when synthesizing speech: REST API:pronunciation_dict_id as a query parameter on the connection URL:
Managing Dictionaries
Create a dictionary
multipart/form-data instead of providing items as JSON. Plain text format:
List dictionaries
Get a dictionary
Update a dictionary
409 Conflict. Re-fetch and retry.
Delete a dictionary
Limits
File Upload Formats
When creating a dictionary via file upload, two formats are supported: PLS/XML — standard W3C Pronunciation Lexicon Specification format:word=aliasfor alias itemsword:/phoneme/for IPA phonemes
In-Call Playback
Source: https://developers.telnyx.com/docs/voice/tts/in-call-playback.mdIn-call TTS plays synthesized speech during live voice calls. Two integration paths:
Voice API
Use thespeak command to play TTS on an active call:
TeXML
Use the “ element:AI Assistants
AI Assistants use TTS for voice output. Configure the voice model in assistant settings. See AI Assistants for voice configuration.Voice Selection
In-call TTS uses the same voice format as WebSocket and REST:Pricing
Source: https://developers.telnyx.com/docs/voice/tts/rest-api/pricing.mdPricing for WebSocket TTS varies by engine and model. Contact sales or check the pricing page for current rates.
API Reference (TTS)
Text To Speech Commands
- List available voices: Retrieve a list of available voices from one or all TTS providers. When
provideris specified, returns voices for that provider only. Otherwise, returns voic…