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.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 turn-detection WebSocket with the Cartesia SDK:
Query parameters
encoding
encoding
Turn detection
turn_end_timeout_ms is the direct equivalent of eot_timeout_ms.
turn_eager_end_threshold and turn_end_threshold offer similar functionality to eager_eot_threshold and eot_threshold, but their directionality is inverted. In Deepgram, higher values require more certainty before firing; in Cartesia, lower values require more certainty before firing. Don’t reuse your Deepgram values directly. See Configuring turn detection for each threshold’s behavior, range, and default.
Sending audio
Both APIs accept raw PCM audio as binary WebSocket frames in the same way.Cartesia does not support these encodings:To close the session, send a JSON encoded WebSocket text frame:opus,ogg-opus
Configure control message since there’s no need to configure end-of-turn.
Event mapping
Deepgram wraps all turn events in a single
TurnInfo message with an event discriminator. Cartesia emits one message type per event, with the type on the top-level type field.
A Deepgram
TurnInfo message:
turn.* event:
transcript is cumulative within a turn.
Event handler
The branching structure of your handler is unchanged — just the message shape.Example Server Messages
Flux’s transcripts are joined with spaces. Ink’s are not.
References
API Reference
Cartesia Realtime STT (Auto)
Full Code Example
Using the Cartesia SDK