Usage and participant minutes
Read environment usage, understand metric units and distinguish missing observations from zero consumption.
On this page
Usage reports describe observed activity in a project environment. Read them with a secret key carrying usage:read. Their quantities are not automatically prices or plan limits.
Fetch usage
This backend helper uses relay.ts from the quickstart:
import { relay } from './relay.js'
export async function participantUsage() {
return relay.usage.get({ range: '7d', category: 'participants', granularity: 'day' })
}Read summary.participantMinutesDerived for participant minutes, and inspect dataQuality and the returned metricDefinitions before displaying the result. You can also call GET /v1/usage directly.
Participant minutes
participantMinutesDerived is participant seconds divided by 60. It is a decimal: 5.538 means about 5.5 minutes, not 5,538 minutes. Two participants connected for five minutes contribute about ten participant minutes.
Connected time and active publication time differ. A connected participant can accrue connection time while their microphone and camera are muted.
Time windows
Choose 24h, 7d, 14d or 30d, or supply both startedAt and endedAt for a positive custom window no longer than 30 days. Do not combine a preset range with explicit boundaries.
Windows use UTC and an exclusive end boundary. Hour/day buckets align with UTC calendar boundaries and are clipped to the requested edges. Compare reports using the same window and granularity.
Media and traffic
| Measurement | Interpretation |
|---|---|
| Active audio/video duration | Observed publication intervals; paused publications and disconnected send transports do not accrue active-media duration. |
| Screen duration | Reported separately; camera and screen overlap does not make two participant-video timelines. |
| SFU bytes | Traffic observed at the media service. Screen bytes are a breakdown, not additional traffic to add again. |
| TURN observations | May be unavailable, partial or authoritative depending on deployment accounting. |
Microphone and screen audio overlap counts once per participant for audio; camera and screen video overlap counts once for video. Use the response's unit, source and aggregation definitions rather than inferring semantics from a field name.
Missing observations are not necessarily zero consumption. Preserve partial/unavailable quality in your interface instead of converting every absent metric to zero.
Scope
A key reads its own project environment. Passing another project/environment does not expand authority. Organization-wide reports and quota views have separate console-session requirements; see reporting reference.
Streaming and assets
Matching newer server builds include serviceUsage alongside room metrics and expose /v1/usage/streaming. The current Node source accepts category: 'streaming'; the published Node 0.1.0 baseline does not. Until using a compatible SDK release, call REST from your backend.
This helper accepts the same API URL used by RelayServer, with or without a /v1 suffix:
export async function readStreamingUsage() {
const apiUrl = process.env.RELAYRTC_API_URL
const apiKey = process.env.RELAYRTC_SECRET_KEY
if (!apiUrl || !apiKey) throw new Error('Configure the API URL and secret key')
const base = apiUrl.replace(/\/+$/, '')
const versioned = base.endsWith('/v1') ? base : `${base}/v1`
const response = await fetch(`${versioned}/usage/streaming?range=7d`, {
headers: { authorization: `Bearer ${apiKey}` },
})
if (!response.ok) throw new Error(`Usage request failed (${response.status})`)
return response.json()
}| Service area | Measurements |
|---|---|
| Sources | Media progress, compositor frames, external ingress, room-export and encoder-program hops. |
| Outputs | Successful activity, reserved capacity, external output bytes and transcode-profile wall time. |
| Viewers | Completed origin response bytes, estimated media-request activity and peak overlap. |
| Recordings/clips | Processing, finalizations, delivery, retained bytes and storage byte-seconds. |
| DVR | Retained-window delivery and shared physical buffer ownership. |
| Mixers | Render/program/input activity and submitted frames. |
| External sources | Upstream fetch bytes and processing observations. |
Service metrics are unpriced. Storage byte-seconds represent bytes multiplied by retained seconds; stored bytes are an end-of-window gauge. Processing and transcode wall time are not CPU time.
Delivery and audience coverage
Completed response-body bytes include manifests, successful retries and actual byte ranges. HEAD requests, access errors and invalid ranges do not become successful media delivery. abortedDeliveryBytes describes separate partial transport observations, not confirmed client receipt.
A grant alone adds no viewer time. Successive completed media requests within 30 seconds establish estimated activity. This is not proven watch time or unique-person count. Shared grants share an identity; renewed grants introduce another identity. CDN responses that bypass the origin are not measured by the origin journal.
Inspect coverage, journalStartedAt and historicalCoverage. Earlier activity cannot be reconstructed from lifetime counters. Requests beyond retained history return USAGE_HISTORY_EXPIRED; select a supported window rather than displaying expired history as zero.
Resource drilldowns
usage-report routes exist under streams, broadcasts, recordings, clips, DVR windows, mixers and restream sources, with usage:read authority. Use the same range as the project report. Stream drilldowns include children; resource lists cap at 100 and indicate resourcesTruncated, while scope totals include the full scope.
Rolling live service reports cover the last 15 minutes. Totals can decrease as observations leave the window. Peak viewers are recomputed for the scope, not summed across resources.
Streaming source usage
GET /v1/streams/{id}/usage is a separate source-side report of sourceSeconds, ingressBytes, programBytes, samples and coverage. It is not a full audience/delivery report. Broadcast detail separately reports run/output observations and reservations.
SFU, TURN, room export, upstream fetch, encoder program and external output are service hops that can carry the same payload. Do not add them together as unique traffic. See usage response reference for exact shapes and availability.