Finalize command mid-session.
All migration guides
If you’re already using the Cartesia SDK, upgrade to version
>=3.2.0Connection
Replace the Deepgram WebSocket URL and auth header with Cartesia’s/stt/websocket.
cartesia_version query param and use a short-lived access token using the access_token query param instead of an API key.
Connect to the manual-finalization WebSocket with the Cartesia SDK:
Query parameters
encoding
encoding
Sending audio
Both APIs accept raw PCM audio as binary WebSocket frames in the same way.Cartesia does not support these encodings:Cartesia’s control commands are bare text frames, not JSON. To force the model to flush any buffered audio and emit the transcript:flac,amr-nb,amr-wb,opus,ogg-opus,speex,g729
KeepAlive message. The connection has a 3-minute idle timeout that resets every time you send an audio chunk — keep streaming audio (silent or otherwise) to hold it open.
Event mapping
Deepgram emits four server message types. Cartesia emits transcript chunks plus acknowledgments for thefinalize and close commands.
A Deepgram
Results message:
transcript events:
- Ink 2 does not return
durationorwordsyet- Ink 2 and Whisper currently only emit final transcripts (
is_final: true)
Example Server Messages
Ink may break words. Nova’s transcripts are joined with spaces. Ink’s are not.
References
API Reference
Cartesia Realtime STT (Manual)
Full Code Example
Using the Cartesia SDK