Configure voice providers
Voice needs two providers - one to hear, one to speak - and you only supply credentials for the ones you actually use.
VOICE_STT_PROVIDER=deepgram
DEEPGRAM_API_KEY=...
VOICE_TTS_PROVIDER=cartesia
CARTESIA_API_KEY=...
CARTESIA_VOICE_ID=...For ElevenLabs instead, set VOICE_TTS_PROVIDER=elevenlabs, ELEVENLABS_API_KEY, and
ELEVENLABS_VOICE_ID.
Cap concurrency deliberately
VOICE_MAX_SESSIONS=...Voice sessions are long-lived and each one holds a connection to both providers for its whole duration. This is not a request-shaped workload, and the fleet limit is what keeps a busy afternoon from becoming a provider bill nobody predicted.
How a session runs
The client opens the voice WebSocket, sends its session configuration, and then streams audio in the codec and sample rate the server expects. Getting the codec wrong is the usual first failure, and it presents as silence rather than an error.
See for the exact provider variables and protocol details.
Next
- Design a voice agent - the per-agent half, and how to write for speech.
- - protocol, codecs, and variables.
- Troubleshoot a deployment - when a session will not start.