Skip to main content
LiveKit’s agent framework lets you build real-time, programmable voice agents. Telnyx integrates with LiveKit through the OpenAI plugin for LLM inference and through livekit-plugins-telnyx for native STT and TTS.

Voice assistant example

This example is based on LiveKit’s agents examples repo, modified to use Telnyx for LLM inference.

Set up and activate a virtual env

Install requirements

Download files

This downloads model weights for voice-activity detection:

Agent code

The following code uses Telnyx for LLM inference via openai.LLM.with_telnyx(), with Telnyx STT and TTS.

Set environment variables

Run the agent worker

Test with a LiveKit frontend

Use the LiveKit Agents Playground to test your agent without building a frontend.

Telnyx STT & TTS plugin

The livekit-plugins-telnyx package provides native Telnyx STT and TTS plugins for LiveKit agents.

STT

Use telnyx.STT() for real-time speech-to-text via Telnyx’s WebSocket streaming API:

TTS

Use telnyx.TTS() for real-time text-to-speech. Pass a voice parameter to select a specific voice:
See TTS available voices for the full list of voice options.