Skip to content

Instantly share code, notes, and snippets.

@j0nscalet
Created March 5, 2026 21:18
Show Gist options
  • Select an option

  • Save j0nscalet/cc60efe5d7faac900da4cafd3d4feee5 to your computer and use it in GitHub Desktop.

Select an option

Save j0nscalet/cc60efe5d7faac900da4cafd3d4feee5 to your computer and use it in GitHub Desktop.
Telnyx LiveKit Agent Example
from livekit.agents import AgentSession, AutoSubscribe, WorkerOptions, cli, llm
from livekit.plugins import openai, telnyx
async def entrypoint(ctx):
await ctx.connect(auto_subscribe=AutoSubscribe.AUDIO_ONLY)
session = AgentSession(
stt=telnyx.STT(
transcription_engine="deepgram",
base_url="wss://api.telnyx.com/v2/speech-to-text/transcription?transcription_model=deepgram/nova-3",
),
tts=telnyx.TTS(voice="Minimax.speech-02-hd.Wise_Woman"),
llm=openai.LLM.with_telnyx(model="Qwen/Qwen3-235B-A22B"),
)
await session.start(
room=ctx.room,
agent=llm.ChatContext().append(
role="system",
text="You are a helpful voice assistant powered by Telnyx.",
),
)
if __name__ == "__main__":
cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment