the pricing talks about number of minutes connect ...
# ask-ai
b
the pricing talks about number of minutes connect with webrtc. This makes sense when user is connected to livekit server. But are the minutes also counted when user is connected to other user via webrtc as in P2P. Or am I misunderstanding something here?
t
Thanks for reaching out, aditya. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hi there! Just to help clarify, LiveKit counts connection minutes for WebRTC connections only when users are connected to LiveKit servers. So, if your WebRTC connection is truly peer-to-peer (P2P) without involving any LiveKit server (like for signaling or media relay), you won’t see any connection minutes or bandwidth charges. That said, if your P2P connection uses LiveKit’s infrastructure for things like signaling, NAT traversal, or as a fallback relay (such as through the SFU), then connection minutes and bandwidth might be billed. The $0.0005 per minute fee only applies when participants are actively connected to LiveKit servers. If you’d like, I’m here to help clarify anything further or take a look at your specific setup. Just let me know! Sources: Towards a future-aligned pricing model | LiveKit Pricing | Towards a future-aligned pricing model
b
Perfect, this also means that livekit server will choose P2P in earnest if that is the best method to connect users correct?
t
Thank you for reaching out with your question! I’d love to clarify how LiveKit handles connections. LiveKit doesn’t automatically select P2P mode for connecting users, nor does it support P2P connections directly. Instead, it’s designed around a centralized SFU (Selective Forwarding Unit) architecture, where all media flows through LiveKit servers. This approach helps ensure great scalability, low latency, and reliable performance, especially when you have larger group sessions or broadcasts. LiveKit does a wonderful job optimizing transport protocols like UDP, TCP, and TURN/TLS based on network conditions, but it doesn’t switch to P2P mode. If your project specifically needs P2P connectivity, that would need to be set up separately, outside of LiveKit’s main features. I hope this helps clarify things! Please feel free to ask if you have any more questions or need further assistance. Sources: How We Built a Globally Distributed WebRTC Mesh Network | Decentraland's Catalyst: using WebRTC to interact in the metaverse | Connecting to LiveKit | LiveKit Docs | pkg/rtc/transportmanager.go
b
I get that, but P2P is one of the options considered by SFU right?
t
Thanks for reaching out! I wanted to share that the LiveKit SFU doesn’t use P2P for media routing. Instead, all media streams go through the server, following a centralized SFU setup. This approach helps keep things scalable, ensures low latency, and delivers reliable performance, as the SFU forwards media packets to participants using server-side downtracks. If you have any more questions about LiveKit’s architecture or if something isn’t clear, please don’t hesitate to ask—I’m here to help! Sources: LiveKit Server Components | livekit/livekit_composite | DeepWiki | How We Built a Globally Distributed WebRTC Mesh Network | Cloud Architecture | LiveKit Docs
b
Maybe I didnt say it right. lets assume there are only 2 participants in a room. And they are located close to each other geographically. In this sense P2P webrtc might make sense. Is that something livekit will switch to?
t
Thank you for your question! I’d love to clarify how LiveKit works for you. Even when there are only two participants who are close to each other geographically, LiveKit doesn’t switch to P2P WebRTC. Instead, it uses a server-based setup with something called a Selective Forwarding Unit (SFU) to handle the media streams. This means all media is routed through the LiveKit server, which helps optimize routing and reduce latency by leveraging its distributed infrastructure. This approach is designed to provide you with consistent performance and scalability, no matter if it’s just two participants or more. I hope this helps explain things better! If you have any more questions, feel free to ask—I’m here to help. Sources: Decentraland's Catalyst: using WebRTC to interact in the metaverse | examples/voice_agents/llamaindex-rag/data/raw_data.txt
b
so there used to be a p2p flag in the client sdk. but I guess it was removed. huh
t
Thank you for reaching out! I wanted to share that, based on the information available, there isn’t any mention of a P2P flag in the LiveKit client SDKs or its removal. LiveKit is thoughtfully designed around a server-based SFU architecture, so P2P functionality isn’t something it supports at this time. If you happen to have more details or specific examples about the P2P flag you’re referring to, please don’t hesitate to share them. I’m here to help and would be happy to assist you further!