commit_strategy=manual.
All migration guides
If you’re already using the Cartesia SDK, upgrade to version
>=3.2.0Connection
Replace the ElevenLabs 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
ElevenLabs bundles the sample format and rate into a single
All Cartesia encodings support all sample rates.
audio_format token. Cartesia splits them into encoding and sample_rate.Cartesia also accepts
pcm_s32le, pcm_f16le, pcm_f32le, and pcm_alaw.All Cartesia encodings support all sample rates.
Sending audio
ElevenLabs wraps each audio chunk in a JSON formatted text frame and base64-encodes the audio bytes.Cartesia accepts audio chunks as binary frames: send the raw audio bytes directly:
Cartesia’s control commands are bare text frames, not JSON. To commit buffered audio and emit a transcript without ending the session, send a
- No need to supply previous text
- Sample rate is determined upon connection by the
sample_ratequery parameter
finalize frame:
To commit all remaining audio and close the session, send a
close frame:
Sending audio with the SDK
Decoding base64 encoded audio before sending
Committing and closing
Event mapping
Scribe emits interimpartial_transcript events, then a committed_transcript when you commit.Cartesia emits
transcript deltas plus acknowledgments for the finalize and close commands.
Committed transcripts
A Scribecommitted_transcript carries the full text of the segment since the last commit:
transcript events, each carrying a delta:
Followed by a Cartesia
- Ink 2 does not return
durationorwordsyet- Ink 2 and Whisper currently only emit final transcripts (
is_final: true)
flush_done event:
Ignore theis_finalproperty onflush_doneanddoneevents
Example Server Messages
Scribe sends full transcripts. Ink sends deltas and may break words.
References
API Reference
Cartesia Realtime STT (Manual)
Full Code Example
Using the Cartesia SDK