AUDIO frame with "data": "RU9G" (Base64 of ASCII EOF), close the socket, then POST /api/v1/ambient/session/{ambient_session_id}/end. Closing the socket alone is not enough.
This cookbook assumes you already have your Partner ID, authentication tokens, and an active ambient session with a WebSocket stream open.
- TypeScript
- Python
Common mistakes
- Close the WebSocket without sending
RU9G. - Send Dictation-style
AUDIO_ENDon the ambient/ws/streamendpoint. - Treat WebSocket close alone as session complete. You still need REST end, then status polling.