Prerequisites
-
A Cartesia API key. Create one here, then add it to your shell profile:
- A language runtime and package manager:
Stream audio and receive transcripts
These scripts use Cartesia’s text-to-speech to generate audio, then stream it to Ink 2 for transcription.- Python
- TypeScript
1
Install the client library
2
Create the script
realtime-stt.py
3
Run the script
turn.update events with incremental, additive transcripts. Finally, you should see a turn.end event with the full transcript.What just happened
You streamed raw PCM audio to Ink 2 over WebSocket and read transcript events as they arrived.turn.update gives live progress for the active turn, and turn.end gives the finalized transcript for that turn.
What’s next
Learn about Ink 2
How the realtime speech-to-text model works.
Understand turn detection
See how Ink 2 detects when a user starts and stops speaking.
Build with Ink
Find integrations, SDKs, examples, and migration guides.