Limits and media
Limits
| Limit | Value |
|---|---|
| Maximum realtime session duration | 8 hours — the session closes at the ceiling whether or not you call /end |
| TURN credential lifetime | Read ice_servers_ttl from the session-create response; currently 24 hours |
| Concurrent realtime sessions | Finite. Exceeding available capacity yields at_capacity |
| WebSocket reconnection | Not 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.
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 codec | VP8 or H.264 |
| Resolution | 640×480 recommended; up to 1280×720 |
| Frame rate | 15–30 fps |
| Audio codec | Opus |
| Sample rate | 48 kHz |
| Channels | Mono 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.