Skip to main content
After you finish streaming audio, close the WebSocket and complete the session with REST APIs. Click on each tab below to learn more about how to complete the session after streaming for Ambient and Dictation.

Complete the session after streaming audio

After sending the final RU9G message, close the WebSocket connection and complete the ambient session with REST.
1

Close the WebSocket Connection

Close the WebSocket connection from the client when you are done sending audio for that segment.
2

End the Session Using REST

End the session using End ambient session API.
3

Retrieve Results Using REST

Poll session status and fetch transcript and structured data using these REST APIs:
Final transcripts and notes are not guaranteed to arrive over WebSocket. Treat REST APIs as the source of truth.

Troubleshooting common issues while streaming audio

Use this table to troubleshoot common ambient streaming errors. It explains what each error or behavior means, why it occurs, and how to resolve it.

Available cookbooks

AmbientAPI

End Ambient After Streaming

Send RU9G, then end session.

5 min
AmbientAPI

Poll Session Status Before Fetching Content

Poll until status is completed.

5 min
AmbientAPI

Fetch Note Content with composition_id

Retrieve the note with composition_id.

5 min

Available tutorials

Ambient

Build an Ambient Streaming Client

Authenticate, create a session, stream PCM audio over WebSocket, and retrieve clinical note results.

20 minIntermediate
Dictation

Build a Dictation Streaming Client

Create a transcription session, stream audio, read partial frames, and print the final transcript.

15 minIntermediate
Form filling

Build a Form filling Session Client

Create a Form filling session, send template context, stream audio, and retrieve structured form data.

20 minIntermediate

Next steps

Open the Ambient audio streaming API for the ambient WebSocket request and response contract. Open Stream audio to a Dictation session for the Dictation WebSocket handshake and message fields. Review Audio capture and streaming FAQs for codec, chunk size, and reconnect guidance.
Last modified on August 13, 2026