Stream analysis from a live camera: connect to Interhuman over WebSocket, capture media, and send binary chunks as they are recorded. In this codealong, you will:Documentation Index
Fetch the complete documentation index at: https://docs.interhuman.ai/llms.txt
Use this file to discover all available pages before exploring further.
- Connect to
wss://api.interhuman.ai/v1/stream/analyze - Get camera (and microphone where your stack supports it)
- Send each recorded segment to Interhuman and read typed server events
getUserMedia + MediaRecorder) or Python on the desktop (opencv-python for video; see notes below for audio).
You’ll need an API key. Follow the API key guide for details.
1) Connect to the WebSocket
Open a TLS WebSocket to the stream endpoint. On connect, send session config as a text frame (UTF-8 JSON), then listen for text replies and parse JSON. Branch ontype (signal.detected, engagement.updated, conversation_quality.updated, error).
2) Get camera and microphone
3) Send segments to Interhuman
Send each non-empty recording as a binary WebSocket frame. Start recording after the WebSocket is open and session config is sent.4) Read server envelopes
Every server message shares the same outer shape:type, timestamp, correlation_id, and data. Narrow on type before reading fields inside data.
signal.detected
data.signals[] uses the same shape as upload responses: type, start, end, probability, and rationale.
engagement.updated
conversation_quality.updated (when opted in)
When your session config include lists conversation_quality_overall and/or conversation_quality_timeline, you may receive conversation_quality.updated with data.overall and/or data.timeline for the window that was just processed. See Conversation quality.
error
Errors use the same envelope with type: "error" and structured fields under data (for example code, message, link, and segment when applicable). See Error handling.
How to interpret it quickly
signal.detected:data.signals[]lists moment-level social signals for the segment; eachrationaleexplains that detection.engagement.updated: attention level for a time window within the segment (start/endare seconds within that segment).conversation_quality.updated: optional overall and per-window quality metrics when requested.
Next steps
- Stream & analyze — full AsyncAPI channel, headers, and message schemas.
- Authentication — API key usage; browser WebSockets use the subprotocol as above.
- Error handling — structured error codes and recovery.
- Video upload quickstart — one-shot
POST /v1/upload/analyzeflow. - Agent Skills — installable skills that wrap upload and stream calls.
- Social signals and Conversation quality — meaning of outputs.