{
"type": "init",
"config": {
"language": "en",
"sample_rate": 16000,
"encoding": "linear16",
"enable_partials": true
}
}{
"type": "audio",
"data": "UklGRiQAAABXQVZFZm10IBAAAAABAAEA..."
}{
"type": "finalize"
}{
"type": "ready",
"session_id": "sess_abc123"
}{
"type": "partial_transcript",
"transcript": "Hello wor",
"confidence": 0.85
}{
"type": "final_transcript",
"transcript": "Hello world, this is a test.",
"confidence": 0.95,
"language": "en",
"duration": 2.5
}{
"type": "error",
"code": "auth_error",
"message": "Invalid or expired API key"
}Real-time speech-to-text transcription using Soniox Speech AI via WebSocket. Supports streaming audio with speaker diarization, automatic language identification, and configurable endpoint detection in 60+ languages.
{
"type": "init",
"config": {
"language": "en",
"sample_rate": 16000,
"encoding": "linear16",
"enable_partials": true
}
}{
"type": "audio",
"data": "UklGRiQAAABXQVZFZm10IBAAAAABAAEA..."
}{
"type": "finalize"
}{
"type": "ready",
"session_id": "sess_abc123"
}{
"type": "partial_transcript",
"transcript": "Hello wor",
"confidence": 0.85
}{
"type": "final_transcript",
"transcript": "Hello world, this is a test.",
"confidence": 0.95,
"language": "en",
"duration": 2.5
}{
"type": "error",
"code": "auth_error",
"message": "Invalid or expired API key"
}API key issued by SLNG. Pass as Authorization: Bearer <token> in the WebSocket upgrade request headers.
GET
Must contain all of these types
Initialize an STT session with recognition configuration.
Stream an audio frame to be transcribed.
Signal that no more audio frames will be sent.
Indicates the session is ready to receive audio.
Interim transcription result (when enable_partials is true).
Final transcription result with optional metadata.
Indicates an error occurred during recognition.
Was this page helpful?