Message Reference

Complete reference for all client and server messages in the VoiceRun Transcribe WebSocket API.


Client Messages#

session.update#

Configure the transcription session. Send this after receiving session.created.

FieldTypeRequiredDescription
session.modelstringYesSTT model (e.g., "nova-3", "gpt-4o-transcribe")
session.providerstringYesProvider: "DEEPGRAM", "OPENAI", "CARTESIA", "QWEN3"
session.languagestringNoBCP-47 language code. Default: "en". Use "multi" for auto-detect
session.promptstringNoTranscription hint (keywords for Deepgram, context prompt for OpenAI)
session.input_audio_formatstringNoAudio encoding: "pcm16" (default) or "mulaw"
session.sample_rateintegerNoSample rate in Hz. Default: 16000
{ "type": "session.update", "session": { "model": "nova-3", "provider": "DEEPGRAM", "language": "en", "prompt": "insurance, policy, premium", "input_audio_format": "pcm16", "sample_rate": 16000 } }

audio.append#

Send an audio chunk for transcription. Audio must be base64-encoded.

FieldTypeRequiredDescription
audiostringYesBase64-encoded audio bytes. Recommended chunk size: 20ms
{ "type": "audio.append", "audio": "AAAA//8AAAEAAAD/////AAAB..." }

session.close#

Gracefully close the transcription session.

{ "type": "session.close" }

Server Messages#

session.created#

Sent immediately after WebSocket connection is established.

{ "type": "session.created", "session": { "id": "ts_a1b2c3d4e5f6" } }

session.updated#

Confirms that the session configuration has been applied.

{ "type": "session.updated", "session": { "model": "nova-3", "provider": "DEEPGRAM", "language": "en", "sample_rate": 16000, "input_audio_format": "pcm16" } }

speech.started#

Voice Activity Detection (VAD) detected the start of speech.

{ "type": "speech.started" }

speech.stopped#

VAD detected the end of speech.

{ "type": "speech.stopped" }

transcription.partial#

Interim transcription result. Updated frequently as more audio is received.

{ "type": "transcription.partial", "text": "hello how are" }

transcription.completed#

Final transcription result for a complete speech segment.

{ "type": "transcription.completed", "text": "hello how are you doing today", "language": "en" }

session.closed#

Confirms the session has been closed.

{ "type": "session.closed" }

error#

Sent when an error occurs during the session.

{ "type": "error", "error": { "code": "invalid_model", "message": "Unknown STT model: foo-bar" } }

Error codes:

CodeDescription
invalid_messageMalformed or unparseable message
invalid_configInvalid session configuration
invalid_modelUnknown STT model
invalid_providerUnknown or unsupported provider
provider_errorError from the STT provider
internal_errorInternal server error
transcriptionwebsocketsttmessages