rapid-honey-43838
03/02/2026, 11:29 AMtall-airline-16756
03/02/2026, 11:29 AMtall-airline-16756
03/02/2026, 11:30 AMrapid-honey-43838
03/02/2026, 11:30 AMtall-airline-16756
03/02/2026, 11:31 AMroom_finished webhook event to detect when a session ends. It includes room metadata (room name, start/end time, participants) but does not include cost data.
• Calculate estimates yourself by correlating room_started / room_finished timestamps and participant connection data to get connection minutes, then combine that with bandwidth/transcoding usage to estimate cost.
• Final, exact charges appear on your LiveKit Cloud project billing (usage metrics and invoices) in the dashboard.
Helpful details and next steps
• If you want automated near-real-time cost estimates per session:
◦ Capture room_started and room_finished webhooks.
◦ Track participant join/leave timestamps to compute per-participant connection minutes.
◦ Collect bandwidth and transcoding metrics (egress/ingress) for the room if you need to include data-based charges.
◦ Apply your project’s pricing rules (connection minutes, bandwidth, transcoding, agent session pricing such as $0.01 per agent session minute) to produce an estimated cost per session.
• If you’d like, I can:
◦ Outline a concrete example calculation given your project’s pricing and a sample room timeline.
◦ Suggest a webhook/event processing layout to capture the necessary metrics automatically.
Which would you prefer — an example end-to-end cost calculation, or a short webhook processing design to estimate costs in real time?
Sources: Best practices for managing webhook event streams | LiveKit | Understanding and Estimating Pricing for Video Conference and Livestream Us... | Deploy and scale agents on LiveKit Cloud | Terms of Service | LiveKitrapid-honey-43838
03/02/2026, 11:34 AMtall-airline-16756
03/02/2026, 11:34 AMroom_finished. Make endpoints idempotent and verify webhook signatures.
Suggested components
• Webhook receiver (HTTP endpoint)
• Processing worker / queue for asynchronous work
• Session store (DB) to persist session metadata and running cost estimates
• Periodic reconciler (background job) to update running costs every N minutes
Event handling flow
1. room_started
◦ Create session record: room_id, start_time, initial state, cost = 0.
◦ Optionally start a periodic job to produce running estimates.
1. participant_joined
◦ Record participant_id, join_time, participant_type (standard/agent/ingress/egress).
◦ Mark participant as billable if type = standard or agent.
1. participant_left (or participant_disconnected)
◦ Record leave_time, compute that participant's connection minutes for the interval, update running connection minutes.
1. egress_started / egress_ended (or composite/recording webhooks)
◦ Track start/end times for transcoding/egress to compute transcoding minutes.
1. Periodic status reconciliation (every 5–10 minutes)
◦ For each active session:
▪︎ Calculate elapsed minutes since last reconciliation for each billable participant (based on join/leave events).
▪︎ Estimate bandwidth since last reconciliation: use known/assumed bitrates per participant or, if available, actual egress metrics.
▪︎ Add incremental costs to the session record.
◦ Persist running estimate to DB/monitoring to display near-real-time cost.
1. room_finished
◦ Finalize session: set end_time, finalize any open participant/leaving windows, finalize egress/transcoding durations.
◦ Run final cost calculation:
▪︎ Sum connection minutes × connection rate
▪︎ Sum bandwidth GB × bandwidth rate
▪︎ Sum transcoding minutes × transcoding rate
◦ Persist final cost and push summary to your billing/analytics dashboard.
Implementation details & best practices
• Use room_finished to detect session end; it contains start/end timestamps and room metadata but not cost details. Use participant events to compute connection minutes and egress events to compute transcoding minutes.
• Store every webhook event raw + parsed to allow reconciliation if events are missing or duplicated.
• Validate webhook authenticity (JWT/signature) and return 2XX quickly; perform cost computations asynchronously.
• Make handlers idempotent — webhooks may be retried. Use event IDs or timestamps to avoid double-counting.
• If you need more precise bandwidth, capture egress metrics (if available) or instrument clients to report actual bytes sent/received.
• Expose a near-real-time dashboard using the session store for ops/finops visibility; keep reconciliation frequency reasonable to balance accuracy and load.
Would you like:
• A sample data schema for the session store (tables/fields) that matches this flow?
• An end-to-end example implementation (pseudo-code or a Node/Python sketch) of webhook handlers and reconciler using these events?
Pick which one and I’ll provide the next level of detail.
Sources: Understanding and Estimating Pricing for Video Conference and Livestream Us... | Deploy and scale agents on LiveKit Cloud | Server-side | livekit/livekit_composite | DeepWiki | Best practices for managing webhook event streams | LiveKitrapid-honey-43838
03/02/2026, 12:20 PMtall-airline-16756
03/02/2026, 12:20 PMrapid-honey-43838
03/02/2026, 12:21 PMtall-airline-16756
03/02/2026, 12:22 PMuniversal-streaming, universal-streaming-multilingual
• Cartesia: ink-whisper (100 languages)
• Deepgram: flux (English), nova-3 (multilingual), nova-2 (33 languages / variants)
• ElevenLabs: scribe-v2-realtime (41 languages)
• Plugins available for Amazon Transcribe, Azure AI Speech, Google Cloud Speech, OpenAI, etc.
(For multilingual automatic choice, use deepgram/nova-3:multi.)
LLM (large language model) examples you can select
• OpenAI: GPT-4o, GPT-4o mini, GPT-4.1, GPT-5 variants
• Google Gemini: Gemini 3 Pro / Flash, Gemini 2.5 variants
• DeepSeek: DeepSeek V3 / V3.2
• Kimi (Moonshot AI): Kimi K2 Instruct
• Plugins available for Anthropic (Claude), Amazon Bedrock, Mistral, Together, xAI, and more.
TTS (text-to-speech) examples you can select
• Cartesia: sonic-3, sonic-2, sonic-turbo, sonic (multilingual)
• Deepgram: aura-2 (English/Spanish)
• ElevenLabs: eleven_flash_v2, eleven_turbo_v2, eleven_multilingual_v2
• Inworld: inworld-tts-1.5-max, inworld-tts-1.5-mini
• Rime: arcana, mistv2
• Plugins available for Baseten, Google Gemini, OpenAI, Resemble, etc.
How you specify models in a session
• You set the chosen model identifiers when creating/configuring an AgentSession. Example (pseudo-code):
session = AgentSession(
stt="deepgram/nova-3:en",
llm="openai/gpt-4.1-mini",
tts="cartesia/sonic-3:voice-id",
)
Notes and practical tips
• The exact model used for a session is determined by your session configuration (or plugin settings). LiveKit does not implicitly pick a single model — you request the model you want via the Inference API or plugin config.
• For real-time audio-to-audio use cases, LiveKit supports Realtime-capable models (e.g., OpenAI Realtime, Amazon Nova Sonic) via the Realtime models path.
• You can customize model params (language, voice, extra kwargs) per session.
• If you need a recommended combination for a specific language, latency budget, or cost target, tell me your constraints and I’ll suggest STT/LLM/TTS choices and parameter settings.
Would you like:
• A recommended STT+LLM+TTS combo for low-latency real-time conversations, or
• Exact model strings and example AgentSession JSON for a specific language/region? Sources: Introducing LiveKit Inference: A unified model interface for voice AI | Speech-to-text (STT) models overview | LiveKit Documentation | Deepgram TTS | LiveKit Documentation | Large language models (LLM) overview | LiveKit Documentation | DeepSeek LLM | LiveKit Documentationrapid-honey-43838
03/02/2026, 12:23 PMtall-airline-16756
03/02/2026, 12:23 PMstt="deepgram/nova-3:en", llm="openai/gpt-4.1-mini", tts="cartesia/sonic-3:voice-id"). That configuration is the authoritative source of which models the session used.
• Use Agent Observability in the LiveKit Cloud dashboard to inspect agent traces and session behavior. Observability can help you infer model usage from the agent’s configured tools and calls, though it does not necessarily attach explicit model identifiers into every event.
• Add custom logging inside your agent logic: log the model identifiers at session start or whenever you switch models. Emit those logs to your own monitoring or link them to room IDs so you can correlate later with webhook events.
Practical recommendation
• If you need model-level visibility in downstream tooling or billing:
◦ Record the AgentSession model choices to your session store when the session is created.
◦ Include that record’s session/room ID in any cost or event summaries you produce.
◦ Optionally emit a custom webhook or log entry that explicitly states the STT/LLM/TTS model strings for that session.
If you want, I can:
• Show an example AgentSession payload and the exact fields to store for later correlation, or
• Provide a short snippet (Node/Python) that logs the model identifiers at session start and ties them to the `room_id`/session events.
Which would you prefer?
Sources: Streamline troubleshooting with Agent Observability | Turns overview | LiveKit Documentation | Agent session | LiveKit Documentation