Prerequisites
- Avaturn API key (dashboard)
- OpenAI API key with Realtime API access
- Backend in Node.js or Python; any JS framework on the frontend
1. Mint an OpenAI client secret
On your backend, exchange your OpenAI API key for a short-lived client secret.2. Create an Avaturn session
3. Connect from the frontend
4. Clean up
dispose() tears down the local SDK state. The backend session expires shortly after the user disconnects (default 60s). To terminate immediately, call DELETE /api/v1/sessions/{id} from your backend.
Next steps
OpenAI Realtime engine
Tools, custom prompts, turn detection, transcripts.
Cartesia engine
Drive the avatar from a Cartesia Line agent.
SDK methods
Devices, mute, attach to a new DOM node.
SDK events
Speech start/end, lifecycle, transcripts.