Real-time Streaming
Live transcription via WebSocket for voice assistants, live captions, call centers, and real-time applications.
WebSocket Endpoint
WS
wss://yourvoic.com:8443/api/v1/stt/realtime/streamWebSocket endpoint for live audio streaming with instant transcription.
⚠️ Important: WebSocket connections must use port
8443. The standard port (443) does not support WebSocket connections.
GET
/api/v1/stt/realtime/infoGet information about real-time streaming capabilities and configuration.
Available Models
| Model | Description | Credits/sec | Best For |
|---|---|---|---|
lucid-mono | Fastest monolingual | 3 | Single-language apps |
lucid-multi | Multilingual streaming | 3 | Global applications |
lucid-agent | Voice agent optimized | 3 | Chatbots, voice assistants |
lucid-lite | Economy streaming | 2 | High-volume real-time |
Real-time Features
- Interim Results: Live partial transcriptions as you speak
- VAD Events: Voice activity detection - know when speech starts/ends
- Endpointing: Configurable silence detection for utterance boundaries
- Low Latency: Sub-300ms response time for real-time applications
- Keywords Boost: Improve recognition of specific terms in real-time
JavaScript WebSocket Example
// Connect to real-time STT
const params = new URLSearchParams({
api_key: 'YOUR_API_KEY',
model: 'lucid-agent',
interim_results: 'true',
keywords: 'YourVoic,API'
});
const ws = new WebSocket(`wss://yourvoic.com:8443/api/v1/stt/realtime/stream?${params}`);
ws.onopen = () => {
console.log('Connected to real-time STT');
};
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
if (data.type === 'transcript') {
if (data.is_final) {
console.log('Final:', data.text);
} else {
console.log('Interim:', data.text);
}
}
};
ws.onerror = (error) => {
console.error('WebSocket error:', error);
};
ws.onclose = () => {
console.log('Connection closed');
};
// Send audio data (must be in correct format)
// ws.send(audioChunk);
Billing
💡 Billing: You are charged based on audio stream duration at 3 credits per second.
- Credits are calculated based on total audio duration sent
- Idle connections auto-close after 60 seconds
- Minimum 60 credits required to start a session
- Credit balance verified every 30 seconds during streaming