Overview
Session management controls the behavior of the Unmute conversation system, including voice selection, conversation instructions, and recording preferences.Session Configuration
Sessions are configured using thesession.update client event. The backend requires this configuration before it begins processing audio.
Configuration Object
The session configuration is defined by theSessionConfig model:
object
string
Voice identifier for text-to-speech synthesis. Must match a voice ID from the
/v1/voices endpoint.boolean
required
Whether to allow recording of the conversation session. Set to
false to disable recording.Getting Available Voices
Before configuring a session, retrieve the list of available voices:HTTP Endpoint
Response
good: true are returned. The comment field is excluded from the response.
JavaScript Example
Configuring a Session
Send asession.update event immediately after establishing the WebSocket connection.
Example: Basic Configuration
Example: With Instructions
Server Confirmation
The server responds with asession.updated event:
Instructions Object
Theinstructions field is an Unmute extension to the OpenAI Realtime API. It provides structured guidance to the language model.
Character
Defines the AI assistant’s personality, tone, and behavioral characteristics. Examples:"You are a professional medical assistant.""You are an enthusiastic teacher who loves explaining complex topics.""You are a concise technical support agent."
Scenario
Provides context about the conversation setting or purpose. Examples:"You are helping a user troubleshoot their software issue.""The user is practicing English conversation.""You are conducting a job interview simulation."
Updating Session Mid-Conversation
You can send additionalsession.update events at any time to change the configuration:
session.updated.
Voice Cloning
Unmute supports custom voice cloning. Upload audio samples to create new voices.Upload Voice Sample
file: Audio file (maximum size: configurable viaMAX_VOICE_FILE_SIZE_MB)
Using Cloned Voice
Once uploaded, use the returned voice name in your session configuration:JavaScript Example
Recording Management
Theallow_recording parameter controls whether conversations are recorded for later analysis.
Disabling Recording
Enabling Recording
- Client events (with audio anonymized as sample counts)
- Server events (responses, transcriptions, etc.)
- Conversation metadata
Complete Session Setup Example
Error Handling
If session configuration fails, the server sends anerror event:
Next Steps
Client Events
Send audio and commands to the server
Server Events
Receive responses and updates from the server
WebSocket Overview
Learn about the WebSocket protocol