from where the async def entrypoint(ctx: agents.Jo...
# ask-ai
t
from where the async def entrypoint(ctx: agents.JobContext): session = AgentSession( stt="assemblyai/universal-streaming:en", llm="openai/gpt-5-nano", tts="cartesia/sonic-3:9626c31c-bec5-4cca-baa8-f8ba9e84c8bc", vad=silero.VAD.load(), turn_detection=MultilingualModel(), ) api key is taken here
t
Thanks for reaching out, Aritra. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! Just to help you out, the API key in your code snippet is usually fetched from environment variables using something like
os.getenv()
. After that, it’s passed along to the different service configurations (like STT, LLM, TTS, VAD) that work with the
AgentSession
. This way, your sensitive credentials stay safe and sound. If you’d like me to walk you through any part of the service setup or if something feels unclear, please don’t hesitate to ask. I’m here to help! Sources: examples/voice_agents/langfuse_trace.py
t
async def entrypoint(ctx: agents.JobContext): session = AgentSession( stt="assemblyai/universal-streaming:en", llm="openai/gpt-5-nano", tts="cartesia/sonic-3:9626c31c-bec5-4cca-baa8-f8ba9e84c8bc", vad=silero.VAD.load(), turn_detection=MultilingualModel(), ) why this code never hits llm="openai/gpt-5-nano", api, even i remove env of openai key, it still works
t
I'm glad you asked! The code works without the OpenAI API key because it uses LiveKit Inference, which is a managed service designed to make things easier for you by handling authentication and routing to model providers like Azure OpenAI behind the scenes. So, instead of needing the
OPENAI_API_KEY
, the system uses your LiveKit API credentials (
LIVEKIT_API_KEY
and
LIVEKIT_API_SECRET
) to authenticate requests through the Agent Gateway API. This setup is really helpful because it takes away the hassle of managing multiple provider API keys. It also smartly maps the model identifier (like
openai/gpt-5-nano
) to the right backend provider using LiveKit's infrastructure, making everything smoother for you. Sources: plugins/openai/src/models.ts | OpenAI LLM models | LiveKit Docs | livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/models.py
t
async def entrypoint(ctx: agents.JobContext): session = AgentSession( stt="assemblyai/universal-streaming:en", # llm="openai/gpt-5-nano", llm=inference.LLM( model="openai/gpt-5-nano", provider="openai", extra_kwargs={ "reasoning_effort": "medium", "response_format": "text", "store": True, "temperature": 0.3, }, ), tts="elevenlabs/eleven_turbo_v2_5:iP95p4xoKVk53GoZ742B", vad=silero.VAD.load(), turn_detection=MultilingualModel(), ) how do i pass the elevanlabs api key
t
I'm here to help you pass the ElevenLabs API key in your
AgentSession
for TTS configuration. You have a couple of friendly options to do this: • Environment Variable (Recommended): You can set your API key in the environment as
ELEVEN_API_KEY
. The ElevenLabs plugin will then automatically pick it up for you—pretty convenient! • Direct Argument: Alternatively, you can pass the API key directly in the TTS configuration like this:
Copy code
from livekit.plugins import elevenlabs

session = AgentSession(
    tts=elevenlabs.TTS(
        api_key="your_elevenlabs_api_key",
        voice_id="iP95p4xoKVk53GoZ742B",
        model="eleven_multilingual_v2"
    )
    # ... other configurations
)
Just a heads-up: if the API key isn’t provided, an error will pop up. If you run into any issues or want me to walk you through it, please don’t hesitate to ask—I’m here to help! Sources: ElevenLabs TTS plugin guide | LiveKit Docs | livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/stt.p... | examples/src/frontdesk/frontdesk_agent.ts
t
how is the stt output is passed to the llmmodel session = AgentSession( stt="assemblyai/universal-streaming:en", llm=inference.LLM( model="openai/gpt-5-nano", provider="openai", extra_kwargs={ "reasoning_effort": "minimal", "response_format": "text", "store": True, "verbosity": "low", }, ), tts="elevenlabs/eleven_turbo_v2_5:iP95p4xoKVk53GoZ742B", vad=silero.VAD.load(), turn_detection=MultilingualModel(), )
t
I'm glad you asked about how the STT output is passed to the LLM in the
AgentSession
. Here’s a friendly walkthrough of the process: 1. Final Transcription Event: When the STT system finishes transcribing, it fires an event (like
onFinalTranscript
) with the text it captured. 2. Updating Chat Context: This transcribed text is then added to the shared
ChatContext
as a new message from the user, helping keep our conversation history intact. 3. Triggering LLM Inference: The refreshed
ChatContext
is sent to the LLM during its next inference cycle, so it always has the latest input to work with. 4. LLM Response Generation: Using this updated context, the LLM crafts a response, which is then sent back to the session. This event-driven setup really helps keep our interactions smooth and responsive. If you’d like, I’m here to provide more details or examples—just let me know! Sources: agents/src/voice/room_io/room_io.ts | livekit-agents/livekit/agents/voice/agent_session.py | Pipeline nodes and hooks | LiveKit docs
t
i had set extra_kwargs={ "reasoning_effort": "minimal", "response_format": "text", "store": True, "verbosity": "low", }, to minimal, still why it sends it as, Configuration Response text Reasoning effort medium Verbosity medium
t
I’m glad you asked about the
reasoning_effort
and
verbosity
parameters in
extra_kwargs
. These get passed to the LLM API, but their behavior can depend on a few important things: • Model and Provider Support: It’s a good idea to double-check that the model you’re using (like
openai/gpt-5-nano
) and the provider (
openai
) actually support these parameters. Sometimes, if they aren’t supported, the parameters might just be ignored. • Defaulting Behavior: The OpenAI plugin might fill in default values if you don’t specify them. For example,
reasoning_effort
often defaults to
"minimal"
unless you set it yourself. • Subtle Effects: Keep in mind that settings like
"minimal"
reasoning effort might not create big changes in the output, so it can feel like the parameter isn’t doing much. Here are a few steps you can try to troubleshoot this: 1. First, confirm that your model and provider support these parameters. 2. Turn on debug logging (for example, by setting
LK_OPENAI_DEBUG=1
) so you can see if the parameters are actually being sent in your requests. 3. Try experimenting with different values, like
"high"
reasoning effort, to see if you notice any changes in the responses. If you’d like, I’m here to help you with any of these steps or to dive deeper into debugging. Just let me know! Sources: Kimi LLM | LiveKit Docs | DeepSeek LLM | LiveKit Docs | livekit-agents/livekit/agents/voice/agent_session.py | agents/src/inference/llm.ts | OpenAI LLM models | LiveKit Docs
t
livekit limits
t
Hi there! I’d love to help you understand the limits LiveKit has based on your plan: • Quotas: On the free Build plan, you get monthly usage limits like 5,000 WebRTC participant minutes, 50 GB downstream data transfer, 60 transcode minutes, and 1,000 agent session minutes. If you’re on a paid plan, don’t worry—overage billing is available to give you more flexibility. • Concurrency Limits: For example, the Build plan supports up to 100 participants per project, 5 agent sessions, and 5 LiveKit Inference connections for STT/TTS. • Rate Limits: The Server API allows up to 1,000 requests per minute, and LiveKit Inference LLM has its own specific RPM and TPM limits. • Session Limits: You can have up to 100,000 simultaneous participants per session, and if you need more, higher limits are available with paid plans—just ask! You can easily check and manage these limits anytime in the LiveKit Cloud dashboard under Settings > Project. If you have any questions or want more details, I’m here to help! Sources: pkg/config/config.go | Quotas and limits | LiveKit docs | delay-handling/raw_data.txt | examples/voice_agents/llamaindex-rag/data/raw_data.txt
t
where i can check how much out of 2.50$ limit to models i have used
t
You can easily check your LiveKit Inference credit usage for the $2.50 limit in the LiveKit Cloud dashboard. This dashboard gives you a clear and unified view of your usage and billing across all supported models. If you have any trouble finding this information or would like more detailed billing metrics, please don’t hesitate to reach out—I’m here to help you every step of the way! Sources: Quotas and limits | LiveKit docs | Introducing LiveKit Inference: A unified model interface for voice AI | Models | LiveKit Docs | livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/experimental/realti... | Build voice, video, and physical AI | LiveKit