First time building? Complete Quickstart — Step 1 to configure your CLI and register with the platform.
1. Install the plugin
pip install "telnyx-livekit-plugin @ git+https://github.com/team-telnyx/telnyx-livekit-plugin.git#subdirectory=telnyx-livekit-plugin"
This is the Telnyx-maintained plugin, which includes the latest features and fixes ahead of the upstream livekit-plugins-telnyx PyPI package. We host our own release to iterate faster than the upstream cadence allows. Use the git install above for the current recommended version.
Plugin source on GitHub
2. Write your agent
Create agent.py:
import asyncio
from livekit.agents import Agent, AgentSession, JobContext, RoomInputOptions
from livekit.plugins import openai, silero, telnyx
class MyAgent(Agent):
def __init__(self):
super().__init__(instructions="You are a helpful voice assistant.")
async def on_enter(self):
self.session.generate_reply(
instructions="Greet the caller and ask how you can help."
)
async def entrypoint(ctx: JobContext):
session = AgentSession(
stt=telnyx.STT(
transcription_engine="Deepgram",
base_url="wss://api.telnyx.com/v2/speech-to-text/transcription",
),
llm=openai.LLM.with_telnyx(model="moonshotai/Kimi-K2.6"),
tts=telnyx.TTS(
voice="Telnyx.NaturalHD.astra",
sample_rate=24000,
),
vad=silero.VAD.load(),
)
await ctx.connect()
await session.start(
agent=MyAgent(),
room=ctx.room,
room_input_options=RoomInputOptions(),
)
disconnect_event = asyncio.Event()
@ctx.room.on("disconnected")
def on_disconnect(*args):
disconnect_event.set()
await disconnect_event.wait()
The only Telnyx-specific parts are the stt, tts, and llm — everything else is standard LiveKit.
3. Add a requirements file
Create requirements.txt:
livekit-agents
livekit-plugins-openai
livekit-plugins-silero
telnyx-livekit-plugin @ git+https://github.com/team-telnyx/telnyx-livekit-plugin.git#subdirectory=telnyx-livekit-plugin
4. Deploy
lk agent deploy . --secrets TELNYX_API_KEY=$TELNYX_API_KEY
The platform builds your image in-cluster, deploys it, and starts the worker. Check the status:
Tail logs once it’s running:
lk agent logs --id <AGENT_ID>
Swap models
The example above uses Telnyx-hosted defaults. Swap any component independently:
- STT — Deepgram, Nova-3, Nova-2, Flux → STT plugin
- TTS — Telnyx Natural HD, MiniMax, Rime, ElevenLabs (BYOK), Azure → TTS plugin
- LLM — GPT-4o-mini, Kimi-K2.6, Claude (BYOK) → LLM plugin
Next steps