Skip to main content

Limits and media

Limits

LimitValue
Maximum realtime session duration8 hours — the session closes at the ceiling whether or not you call /end
TURN credential lifetimeRead ice_servers_ttl from the session-create response; currently 24 hours
Concurrent realtime sessionsFinite. Exceeding available capacity yields at_capacity
WebSocket reconnectionNot supported

Treat the two durations as current values, not guarantees. Read ice_servers_ttl rather than assuming 24 hours, and do not design a workflow that depends on running right up to the 8-hour edge.

Always end your sessions

A session you never end keeps consuming analysis capacity until it hits the ceiling. End it on page unload, on error, and on user cancel — not just on the happy path.

For teardown on page close, navigator.sendBeacon will not work: it cannot set the X-API-Key header, so the call does not authenticate. Use fetch with keepalive:

fetch(`https://devapi.imentiv.ai/v2/realtime/session/${sessionId}/end`, {
method: "POST",
headers: { "X-API-Key": apiKey },
keepalive: true,
});

Media recommendations

These are what the pipeline is tuned for, not hard limits.

Video codecVP8 or H.264
Resolution640×480 recommended; up to 1280×720
Frame rate15–30 fps
Audio codecOpus
Sample rate48 kHz
ChannelsMono or stereo

Codecs are negotiated normally during the SDP exchange, so a standard browser getUserMedia stream needs no special configuration.

Sending more does not get you more. Facial analysis samples at up to about ten frames per second regardless of what you send, and audio is resampled server-side. A 30 fps 1080p stream costs you bandwidth and produces the same results as 640×480.

NAT traversal

The session-create response returns both STUN and TURN entries in ice_servers. STUN is enough on most networks; TURN relays when a direct path is impossible — symmetric NAT, restrictive firewalls — and is offered over both UDP and TCP.

Pass the whole array through to RTCPeerConnection and let ICE choose. Do not filter it, and do not hardcode the URLs: the TURN entries carry per-session credentials that expire.