Media
Calls, stages and livestreams on Beam: delivery profiles, how a session reaches Worker nodes, and what to read next.
Beam media carries live audio and video for your application's own users: calls (two to a few dozen people talking), stages (a few speakers and a large audience) and broadcasts (a livestream from OBS or an encoder to thousands of viewers). Your backend creates sessions with the Media API and signs short-lived tokens for its users; their apps connect straight to the Beam Workers that serve the session. Beam never needs your users' accounts.
Media for your application's users is separate from Room media channels, which serve members of a Room through their own Beam agent. Both use the same Workers and the same session model.
Delivery profiles
A session has exactly one delivery profile, chosen when you create it.
| Profile | Use | Transport | Latency target | Protection |
|---|---|---|---|---|
interactive | Calls, direct messages with video, screen share, voice agents | WebRTC both ways | under 250 ms one way | e2ee (default) or public |
stage | A few speakers, many listeners, hand raising | WebRTC; listeners only receive | under 400 ms | public (default) or e2ee |
broadcast | Livestreams and events | Ingest over WHIP, RTMP(S) or SRT; delivery over LL-HLS | 2 to 4 s | public (default) or protected |
e2ee: frames are encrypted end to end with SFrame; Workers forward them without being able to read them. See Media Encryption.public: Workers can read the media. Required for transcoding and HLS output.protected: a broadcast's segments are encrypted (cbcs) for delivery through the CDN; the transcoder still sees the source, so it is not end-to-end encryption.
An interactive or stage session that is public can also be published as HLS
(hls_output), for an audience larger than WebRTC should serve. A session with
recording enabled keeps a recording that plays later through the same edges.
How a session reaches its viewers
- Your backend creates a project once and registers an Ed25519 public key on it. The private key never leaves your backend.
- For each call, stage or stream it creates a session with the Media API.
- For each user it signs a media token: who the user is, which session, and whether they may publish. See Media Tokens.
- The user's app hands the token to the Beam SDK, which asks the media directory for the nearest healthy Workers and connects to them directly.
- Core plans the session's nodes on Workers (an SFU for calls; relays near listeners for stages; ingest, transcode (on a GPU, or on a CPU for a source-only broadcast), packager, shields and edges for broadcasts) and keeps them current as the audience grows or a Worker fails. Workers verify tokens offline against the keys Core gives them and can never mint one.
Your app never chooses Workers: the directory steers each user, and the SDK fails over to the next endpoint on its own.
Start here
| Goal | Read |
|---|---|
| A video call in a web page | Quickstart: Call |
| Speakers and a large audience | Quickstart: Stage |
| A livestream from OBS or ffmpeg | Quickstart: Broadcast |
| A bot, transcriber or AI voice agent in a call | Server-side Participants |
| Tokens, keys, roles and revocation | Media Tokens |
| What Beam, Workers and you can read | Media Encryption |
| Every route and field | Media API Reference |
| Media channels of a Room, for its members | Room Media Channels |
| Session, participant and recording events | Media Webhooks |
Every step of these guides also works from a terminal with
beam media: create projects and sessions, mint
test tokens, print ingest URLs and read a session's topology.
What you need
- An organization API key from the Console. The
Media API authenticates with it, like the rest of the BeamCore API, and media
usage is charged to its organization. The key needs the
media:readpermission to read projects, sessions, recordings and usage, andmedia:writeto change them and mint tokens (media:writeincludes reading). Both are organization-wide: Owner, Admin and Developer organization keys hold them, a key with a custom role gets them under Media in its permissions, and a key bound to a project has no Media API access. - The BeamCore API URL (
BEAM_CORE_URL) and the media directory URL (BEAM_MEDIA_DIRECTORY_URL) of your environment. They come with access to an environment (production, or a lab for testing) and belong in your configuration: the SDKs have no default directory, and every client passesdirectoryUrl. - A backend you control, to hold the signing key and mint tokens. Never ship the signing key or the API key to a browser or mobile app.
- For broadcasts, an encoder: OBS, ffmpeg, GStreamer or a hardware encoder that speaks WHIP, RTMP(S) or SRT.
Usage and billing
Media is metered from three sources that must agree: signed usage reports from the Workers, quality beacons from the SDKs, and Beam's own audit samples. Only verified usage is billed. Each product has these units:
| Product | Units |
|---|---|
| Interactive | participant-minutes, GB delivered, GB received, peak participants |
| Stage | participant-minutes (speakers), listener-minutes, GB delivered, GB received, peak participants |
| Broadcast | viewer-minutes, ingest-minutes, GB delivered, GB received, peak viewers |
| Transcode | rendition-minutes |
| Recording | GB-months stored |
| Recording playback (VOD) | GB delivered, viewer-minutes |
Units are independent measures of one session. The price list of your organization decides which of them are charged: minutes, GB, both, or another unit. A unit without a price is listed in your usage and not charged. A unit your environment does not measure yet has no usage and no charge.
- GB are 10⁹ bytes of media sent to your clients (delivered) or received from them (received), without retransmissions, padding or traffic between Beam's nodes.
- Peak is the most participants, or viewers, connected at one instant of the hour. A stage counts speakers and listeners together.
A price may depend on what was used:
| Attribute | Values | Units |
|---|---|---|
| Class | audio, sd (the shorter side of the video is below 720), hd (720 to 1079), fhd (1080 to 1439), uhd (1440 and above); minutes also idle, connected without media | participant-, listener-, viewer- and rendition-minutes, GB delivered |
| Kind | human, bot (media bots) | participant- and listener-minutes |
| Transport | whip, whep, hls, rtmp, rtmps, srt | ingest-minutes, GB delivered, GB received |
Rendition-minutes have no idle class. When a participant's connections
overlap, the minute takes the most demanding class.
Read your verified usage with GET /v1/media/sessions/{id}/usage or
GET /v1/media/usage (reference). A session whose
estimate your credits cannot cover is refused with 402 insufficient_credits;
a product that is not sold in an environment is refused with
402 product_not_priced.
Limits
- Token lifetime: at most 24 hours; keep tokens to minutes or hours and mint new ones as users come back.
- End-to-end encrypted sessions carry Opus audio and VP8 video (simulcast, or a single layer). Redundant audio (RED) is refused there; public sessions may use it. Public sessions and ingest also accept H.264, VP9, AV1 and H.265.
- Protected broadcasts need EME ClearKey: Safari and native Apple players cannot
play them yet (
protected_unsupported). Public broadcasts play everywhere. - Media Workers need a public IP address: Workers behind home NAT do not serve media yet.