Soniox

Text-to-Speech

Use Soniox Text-to-Speech in LiveKit Agents.

Overview

soniox.TTS provides real-time text-to-speech synthesis using the Soniox WebSocket TTS API. It delivers:

  • Ultra-low latency — synthesis starts from the first few words, before the full sentence is available, keeping voice agents responsive.
  • 60+ languages with native-speaker-quality voices. See supported languages and voices.
  • Accurate alphanumerics — phone numbers, email addresses, IDs, and other mixed letter-and-digit strings are pronounced correctly.
  • Hallucination-free output — the model speaks the text you send, nothing more.

Basic usage

Use Soniox TTS in an AgentSession:

from livekit.agents import AgentSession
from livekit.plugins import soniox

session = AgentSession(
    tts=soniox.TTS(model="tts-rt-v1", voice="Maya"),
    # ... stt, llm, etc.
)

Configuration

soniox.TTS accepts top-level constructor arguments for the model, voice, language, and audio settings.

Constructor arguments

ArgumentTypeDefaultDescription
api_keystr | NoneSONIOX_API_KEY env varSoniox API key.
modelstrtts-rt-v1-previewTTS model identifier.
languagestrenLanguage code (e.g., "en", "es", "fr"). See supported languages.
voicestrMayaVoice identifier. See voices.
audio_formatstrpcm_s16leOutput audio format. See audio formats.
sample_rateint24000Output sample rate in Hz.
bitrateint | NoneNoneCodec bitrate in bps for lossy compressed formats.
websocket_urlstrwss://tts-rt.soniox.com/tts-websocketSoniox WebSocket endpoint. See regional endpoints.
http_sessionaiohttp.ClientSession | NoneNoneOptional aiohttp session to reuse for the WebSocket connection.

Advanced usage

Regional endpoints

If you want to use a different region than the default (US), pass a regional websocket_url to the TTS constructor:

from livekit.plugins import soniox

tts = soniox.TTS(websocket_url="wss://tts-rt.eu.soniox.com/tts-websocket")

See the list of regional endpoints for available endpoints.

Voice and language

Soniox TTS supports 60+ languages and a range of voices. Specify them via the constructor:

from livekit.plugins import soniox

tts = soniox.TTS(
    model="tts-rt-v1",
    voice="Maya",
    language="en",
)

See the list of supported languages and available voices.

Updating options at runtime

Use update_options() to change the model, language, or voice mid-session without recreating the TTS instance:

tts.update_options(voice="Adrian", language="es")

Reference