April 8, 202610 min readWeb Development

Video calling: build your own or use Agora and Twilio?

The short answer

Managed video APIs charge per minute forever; self-hosted WebRTC has a fixed infrastructure baseline that barely moves with usage. At 1,000 users making an hour of HD calls a day, published comparisons put Agora around $7,182 a month against roughly $80 to $150 for self-hosted WebRTC. Below a few million minutes a month, managed is usually right for speed. Above it, per-minute pricing exceeds the cost of running your own stack. One planning note: Twilio Video was discontinued in 2024, with end of life in December 2026.

Building WebRTC compared with managed video APIs

The two models

Managed

Agora, ZEGOCLOUD, Daily, LiveKit Cloud. The vendor handles signalling, TURN and media servers. You write application logic. You pay per participant-minute, and the bill scales linearly with success.

Self-hosted

Your own signalling, a TURN server, and an SFU for group calls. A largely fixed infrastructure cost that changes little between 100 and 10,000 users. You own the operational burden and the data.

The cost crossover

Managed pricing is per minute, so cost is a function of usage. Self-hosted is mostly a function of infrastructure, so cost behaves closer to a step function. The consequence is that managed is cheaper at low volume and dramatically more expensive at high volume, and the gap widens exactly as your product succeeds.

Published 2026 comparisons put the crossover for serious deployments somewhere above a few million minutes a month, and one analysis puts the decisive flip above roughly 15 million minutes, where self-hosting typically runs three to five times cheaper once hardware, bandwidth and on-call time are counted honestly.

Two caveats worth stating. At genuinely tiny scale, a video feature used by a handful of people, managed can beat self-hosted because self-hosting has a fixed baseline you pay even at zero usage. And if you serve users in China, managed providers with local infrastructure solve a problem that is expensive to solve yourself.

What self-hosting actually involves

This is the part that gets underestimated in the build-versus-buy conversation, so it is worth being specific.

  • Signalling. WebRTC does not define how peers find each other. You build it, usually over WebSockets, along with room management and reconnection.
  • STUN and TURN. STUN helps peers discover their public address. TURN relays media when a direct connection cannot be established, which happens for roughly 15% to 20% of connections behind restrictive NAT and corporate firewalls, and up to 40% in some network environments. TURN carries real bandwidth cost because media flows through your server.
  • An SFU for group calls. Peer-to-peer mesh works for two to four participants; beyond that each participant uploads to every other participant, which destroys bandwidth and battery. Video quality degrades noticeably past four.
  • Everything around it. Recording, reconnection handling, bandwidth adaptation, mobile background behaviour, observability. None of this is in the WebRTC specification.

Choosing the topology

Getting this wrong is the expensive mistake, because changing topology later is a re-architecture rather than a tuning exercise.

TopologyParticipantsTrade-off
Mesh2 to 4No media server, lowest cost, simplest. Collapses beyond four participants.
SFU5 to 100+One connection per participant, server forwards streams without decoding. The default for group calling in 2026.
MCUConstrained clientsServer mixes everything into one composite stream. Useful for legacy integration, considerably more expensive per participant.

What about encryption and data residency?

Self-hosted does not mean less secure, which is a common assumption worth correcting. End-to-end encryption is available through the Insertable Streams API, where the SFU forwards encrypted frames it cannot itself decode. Several open-source stacks support this directly.

For businesses with data residency obligations, and under India's DPDP framework that is a real consideration rather than a theoretical one, self-hosting also means the media never transits a third party you have no agreement with. That is sometimes the deciding factor regardless of cost.

How to decide

Choose managed if

You need to ship this quarter, volume is modest, video is a feature rather than the product, or you have nobody who can operate infrastructure. Speed is a legitimate reason and it costs money later, which is a fair trade at the start.

Choose self-hosted if

Call volume is large or growing fast, data residency or compliance matters, video is core to the product, or you already have a team that operates servers. The fixed cost then becomes an advantage rather than a burden.

A note on vendor risk

Twilio Video's discontinuation, announced in 2024 with end of life in December 2026, is a useful reminder that a managed dependency can be withdrawn on the vendor's timetable rather than yours.

Migrating off a managed platform means moving signalling, media routing and client SDKs across web and mobile. That is not a weekend of work, and it arrives at whatever moment the vendor chooses. The practical mitigation, whichever model you pick, is to keep your signalling and application layer separate from the vendor SDK so a migration is contained rather than total.

From our own builds

We built the video and voice calling on AlgoTipp, a platform for an Australian client, on our own WebRTC implementation rather than a managed API, alongside Socket.io realtime chat in the same product.

Building it ourselves meant owning signalling, TURN fallback and reconnection behaviour, which is real work and worth being honest about. What it bought was cost that does not scale per minute, and media that stays on infrastructure we control, which for a client operating under Australian privacy expectations was not a small consideration.

The part that took longest was not getting a call to connect. It was making calls reconnect gracefully when a phone switched from wifi to mobile data mid-conversation, which is the difference between a demo and something people will use twice.

Frequently asked questions

Building video into your product?

We have built self-hosted WebRTC video and voice calling in production, including the reconnection behaviour that decides whether people use it twice.