WebSocket API Introduction
The 60db WebSocket API provides real-time, bidirectional streaming for Speech-to-Text (STT) and Text-to-Speech (TTS) services.Base URL
Available Endpoints
| Endpoint | Description |
|---|---|
/ws/stt | Speech-to-Text streaming |
/ws/tts | Text-to-Speech streaming |
/ws/health | Health check endpoint |
Why WebSocket?
WebSocket provides several advantages over REST API for audio processing:- Real-time streaming: Low-latency bidirectional communication
- Continuous audio: Stream audio chunks as they’re recorded
- Live transcription: Get partial results while speaking
- Efficient: No need to send complete audio files
- Interactive: Natural conversation experience
Quick Start
1. Connect with API Key
2. Handle Connection Events
3. Send Messages
4. Send Binary Data
Connection Flow
Authentication
WebSocket connections authenticate via query parameter:Message Format
All control messages are JSON formatted:Next Steps
- STT WebSocket Guide - Learn Speech-to-Text
- TTS WebSocket Guide - Learn Text-to-Speech
- Complete WebSocket Reference - Full API documentation