Finalize command mid-session.
All migration guides
If you’re already using the Cartesia SDK, upgrade to version
>=3.2.0Ink 2 only supports English right now.
We expect to add more languages in the coming months.
We expect to add more languages in the coming months.
Connection
Replace the Deepgram WebSocket URL and auth header with Cartesia’s/stt/turns/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 auto-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:Deepgram’sflac,amr-nb,amr-wb,opus,ogg-opus,speex,g729
Finalize command has no equivalent. Ink detects turn boundaries on its own and emits a turn.end when the user stops speaking, so there is nothing to flush.
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, mixing transcript results with separate voice-activity signals. Cartesia folds the same information into a turn lifecycle:turn.start, turn.update, turn.eager_end, turn.resume, and turn.end. See Turn Detection for the full state machine.
The Deepgram Results message
Deepgram’s Results carry a lot of information. You can extract similar information from Cartesia’s turn.update and turn.end events.
Deepgram sends
UtteranceEnd and speech_final: true separately, but they have the same semantic meaning: “the user has finished speaking”.Cartesia simplifies this into a single high-accuracy signal: turn.end.Results message:
turn.update / turn.end event:
turn.start and turn.resume events do not carry a transcript.Example Server Messages
Hello! Nova’s transcripts are joined with spaces. Ink’s are not.
References
API Reference
Cartesia Realtime STT (Auto)
Full Code Example
Using the Cartesia SDK