Skip to main content
The <ConversationRelay> verb routes a call to a ConversationRelay service that provides voice interactions over a WebSocket connection. It provides speech-to-text transcription and allows requesting text-to-speech synthesis for the call over WebSocket.

Attributes

ATTRIBUTEDESCRIPTIONOPTIONSDEFAULT
url The WebSocket URL of the conversation relay server. -
welcomeGreeting A greeting message to be spoken when the conversation relay session starts. -
voice The TTS voice to use (e.g., Telnyx.Natural.abbie, Telnyx.NaturalHD.astra). -
language The language for TTS and transcription (e.g., en, fr, es). -
transcriptionProvider The speech-to-text provider (e.g., deepgram). -
interruptible Whether TTS playback can be interrupted by the caller. true is an alias for any, false is an alias for none. none, any, speech, dtmf, true, falseany
welcomeGreetingInterruptible Whether the welcome greeting can be interrupted by the caller. true is an alias for any, false is an alias for none. none, any, speech, dtmf, true, falseany
dtmfDetection Whether to enable DTMF detection during the conversation relay session. false
backgroundAudioType The type of background audio to mix into the call during the conversation relay session. Must be set together with backgroundAudioValue; both must be present for background audio to apply. media_url-
backgroundAudioValue The background audio source. For media_url, a URL pointing to an audio file (e.g., https://example.com/hold-music.mp3). Must be set together with backgroundAudioType; both must be present for background audio to apply. -

Child verbs/nouns

NOUN/VERBDESCRIPTION
Language Configures a supported language with optional per-language voice and provider settings. Multiple <Language> elements can be specified to enable multilingual conversations.
Parameter Custom key-value parameter passed to the WebSocket server as assistant dynamic variables.

Language Attributes

ATTRIBUTEDESCRIPTIONOPTIONSDEFAULT
code The language code (e.g., en, fr, es). -
ttsProvider The text-to-speech provider to use for this language (e.g., telnyx, google). -
voice The voice to use for this language. -
transcriptionProvider The speech-to-text provider to use for this language (e.g., google, telnyx, deepgram). -
speechModel The speech recognition model to use for this language (e.g., nova-2). -
backgroundAudioType The type of background audio to mix into the call for this language. Must be set together with backgroundAudioValue; both must be present for background audio to apply. media_url-
backgroundAudioValue The background audio source for this language. For media_url, a URL pointing to an audio file (e.g., https://example.com/hold-music.mp3). Must be set together with backgroundAudioType; both must be present for background audio to apply. -

Parameter Attributes

ATTRIBUTEDESCRIPTIONOPTIONSDEFAULT
name The name of the custom parameter. -
value The value of the custom parameter. -

Examples

Basic usage with greeting and voice

Multilingual with DTMF language selection

Custom parameters

Custom parameters are passed to the WebSocket server as assistant dynamic variables.

Non-interruptible greeting

Use welcomeGreetingInterruptible="none" to ensure the greeting plays fully before accepting input.

Background audio

Mix a background audio track into the call by setting backgroundAudioType and backgroundAudioValue together. Both attributes must be present; media_url plays audio from a URL.
Per-language background audio is also supported on <Language> elements: