turn_detection: server_vad.
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 OpenAI WebSocket URL and auth header with Cartesia’s/stt/turns/websocket, including your desired model and input audio format as query parameters:
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:
Session configuration
OpenAI configures the session in thesession.update payload. Cartesia takes the equivalent settings as query parameters.
encoding
encoding
OpenAI sets the input format under
audio.input.format. Cartesia takes encoding and sample_rate as query parameters.OpenAI’s PCM format is 16-bit, 24 kHz, mono. Cartesia accepts that
sample_rate directly, so you can stream the same audio without resampling. Cartesia also accepts pcm_s32le, pcm_f16le, and pcm_f32le.Sending audio
OpenAI 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:
session.update message; reconnect a new WebSocket to change parameters.
To commit all audio and close the session, send a JSON formatted text frame:
Sending audio with the SDK
Decoding base64 encoded audio before sending
Closing
Event mapping
OpenAI signals turns withinput_audio_buffer.speech_started / speech_stopped / committed, then bursts transcript deltas and a completed event per turn.
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.
Completed transcripts
An OpenAIconversation.item.input_audio_transcription.completed event:
turn.end event:
turn.start and turn.resume events do not carry a transcript.Example Server Messages
OpenAI batches each turn. Ink streams within the turn.
References
API Reference
Cartesia Realtime STT (Auto)
Full Code Example
Using the Cartesia SDK