Cloudflare Realtime
Build video calls and live audio that scale to thousands — Cloudflare's global network does the heavy lifting.
What is Cloudflare Realtime?
Cloudflare Realtime (formerly Cloudflare Calls) is infrastructure for building live audio and video apps — video calls, voice chat, watch parties, and more — using WebRTC, the technology browsers use for real-time media.
WebRTC (Web Real-Time Communication) lets browsers send audio and video to each other with very low delay. The hard part is making it work for many people at once — that's what Realtime solves with its SFU.
Think of it like a switchboard
Instead of everyone calling everyone directly (which melts phones in big groups), each person sends their stream once to Cloudflare's switchboard, which forwards it to all the others. One send, many receives.
Why use it?
In a plain peer-to-peer (mesh) call, each person sends a copy of their video to every other person. With 5 people that's already 20 streams — it quickly overwhelms phones and laptops. An SFU fixes this by relaying media for everyone.
Scales to big rooms
Each client uploads once; the SFU fans it out. Rooms can grow far beyond what mesh allows.
Low latency
Media is relayed from a Cloudflare data center near each user, keeping conversations snappy.
Works behind firewalls
The built-in TURN service relays media when strict networks block direct connections.
You stay in control
It's unopinionated infrastructure — build whatever UI and logic you want on top.
When should you use it?
Video meetings
Group calls and conferencing where many people see and hear each other.
Live audio rooms
Drop-in voice chat, talk shows, or social audio with many listeners.
Interactive streaming
Game lobbies, watch parties, or events where audience can hop on mic.
Live support & sales
One-to-one or small-group video for help desks, tutoring, or telehealth.
How to get started
Realtime offers three layers: RealtimeKit (ready-made SDKs with UI), the SFU (low-level WebRTC server), and TURN (a relay). Below we use the SFU HTTPS API directly: create a session, then push a local track. First create a Realtime app in the dashboard to get an App ID and App Secret.
Set your app credentials
Your App ID identifies the app; the App Secret is its password. Keep the secret on your server, never in the browser.
export APP_ID="your-app-id" export APP_SECRET="your-app-secret"Create a new session
A session is one WebRTC connection between a user and Cloudflare. The response gives you a sessionId to use in the next call.
curl -X POST \ https://rtc.live.cloudflare.com/v1/apps/$APP_ID/sessions/new \ -H "Authorization: Bearer $APP_SECRET" # Response: # { "sessionId": "<SESSION_ID>" }Push a local track
A track is one media stream (audio or video). Your browser creates a WebRTC 'offer' (an SDP) describing what it wants to send; you forward it here. location 'local' means you are sending media up to Cloudflare.
curl -X POST \ https://rtc.live.cloudflare.com/v1/apps/$APP_ID/sessions/$SESSION_ID/tracks/new \ -H "Authorization: Bearer $APP_SECRET" \ -d '{ "sessionDescription": { "type": "offer", "sdp": "<LOCAL_OFFER_SDP>" }, "tracks": [ { "location": "local", "mid": "0", "trackName": "mic" }, { "location": "local", "mid": "1", "trackName": "camera" } ] }'Apply the answer
Cloudflare replies with an 'answer' SDP. Your browser applies it to finish the handshake, and media starts flowing. To let others watch, they create their own session and pull these tracks as 'remote'.
{ "requiresImmediateRenegotiation": false, "sessionDescription": { "type": "answer", "sdp": "<CLOUDFLARE_ANSWER_SDP>" }, "tracks": [ { "mid": "0", "trackName": "mic" } ] }
Want it easier? Use RealtimeKit
If you don't want to touch raw WebRTC, RealtimeKit gives you SDKs with ready-made call UI components — meetings in a fraction of the code.
Key concepts
WebRTC
The browser standard for real-time audio, video, and data with very low latency — no plugins needed.
SFU 選擇性轉發單元
Selective Forwarding Unit: a server that receives each person's stream once and forwards it to the others.
Mesh vs SFU
Mesh = everyone connects to everyone (heavy). SFU = everyone connects to one relay (scalable).
Session 連線階段
One WebRTC PeerConnection between a client and Cloudflare. It holds one or more tracks.
Track 軌道
A single media stream — one for the mic, one for the camera. Tracks are 'local' (sent) or 'remote' (received).
TURN 中繼伺服器
A relay that carries media when firewalls block direct connections. Free when paired with the SFU.
Tips & pricing
How billing works
The SFU charges $0.05 per GB of egress (media sent out of Cloudflare), with the first 1,000 GB free every month. TURN is free when used with the SFU; on its own it's also $0.05/GB egress with 1,000 GB free monthly.
Keep the App Secret server-side
Never ship your App Secret to the browser. Have your backend create sessions and tracks, then pass only what the client needs.
- Choose RealtimeKit for speed, the SFU for full control — they're complementary.
- An SFU scales far better than mesh once you have more than ~3-4 participants.
- Pair Realtime with Durable Objects or Workers to manage room state and signaling.
- It was renamed from Cloudflare Calls, so older guides may use that name.
Related products
menu_bookOfficial docsopen_in_new