Skip to main content
This guide covers migrating from Deepgram’s Turn-based Audio (Flux) API. Both Cartesia and Deepgram Flux emit turn-based events over a WebSocket, so migrating to Ink is mostly a matter of renaming fields and updating a few connection parameters.

All migration guides

This guide contains both bare API descriptions and SDK code. To install the SDK:
If you’re already using the Cartesia SDK, upgrade to version >=3.2.0
Ink 2 only supports English right now.
We expect to add more languages in the coming months.

Connection

Replace the Deepgram WebSocket URL and auth header with Cartesia’s.
In browsers, WebSockets do not support request headers. Instead, pass the API version as the 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

Deepgram FluxCartesia InkNotes
model=flux-general-en requiredmodel=ink-2 requiredSee STT Models for all options.
encoding=linear16encoding=pcm_s16le requiredSee encoding for all options.
sample_ratesample_rate requiredNo change.
language_hintOnly English is supported right now. Multi-lingual support is coming soon!
cartesia_version=2026-03-01 requiredSee API Conventions for details.
eager_eot_threshold, eot_threshold, eot_timeout_msTurn detection is controlled by the model. Configuration is coming soon!
keytermComing soon!
mip_opt_outControlled by your organization.
DeepgramCartesia
linear16pcm_s16le
linear32pcm_s32le
mulawpcm_mulaw
alawpcm_alaw
Not supportedpcm_f16le
Not supportedpcm_f32le
opusNot supported
ogg-opusNot supported

Sending audio

Both APIs accept raw PCM audio as binary WebSocket frames in the same way.
Cartesia does not support these encodings: opus, ogg-opus
To close the session, send a JSON encoded WebSocket text frame:
Cartesia has no equivalent of Deepgram’s Configure control message since there’s no need to configure end-of-turn.

Event mapping

Deepgram typeCartesia type
Connectedconnected
Errorerror
TurnInfoSee below
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.
Deepgram TurnInfo.eventCartesia typeCarries transcript?
StartOfTurnturn.startNo (Deepgram: yes)
Updateturn.updateYes
EagerEndOfTurnturn.eager_endYes
TurnResumedturn.resumeNo (Deepgram: yes)
EndOfTurnturn.endYes
A Deepgram TurnInfo message:
Becomes a Cartesia turn.* event:
Like Deepgram, the 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.
Deepgram FluxCartesia Realtime STT (Auto)
StartOfTurnturn.start
Update "Flux's transcripts"turn.update "Flux's transcripts"
EagerEndOfTurn "Flux's transcripts"turn.eager_end "Flux's transcripts"
TurnResumedturn.resume
Update "Flux's transcripts are joined with spaces."turn.update "Flux's transcripts are joined with spaces."
EagerEndOfTurn "Flux's transcripts are joined with spaces."turn.eager_end "Flux's transcripts are joined with spaces."
EndOfTurn "Flux's transcripts are joined with spaces."turn.end "Flux's transcripts are joined with spaces."
StartOfTurnturn.start
Update "Ink's are not."turn.update " Ink's are not."
EagerEndOfTurn "Ink's are not."turn.eager_end " Ink's are not."
EndOfTurn "Ink's are not."turn.end " Ink's are not."

References

API Reference

Cartesia Realtime STT (Auto)

Full Code Example

Using the Cartesia SDK