Real-time Streaming

Live transcription via WebSocket for voice assistants, live captions, call centers, and real-time applications.

WebSocket Endpoint

WSwss://yourvoic.com:8443/api/v1/stt/realtime/stream

WebSocket 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/info

Get information about real-time streaming capabilities and configuration.

Available Models

ModelDescriptionCredits/secBest For
lucid-monoFastest monolingual3Single-language apps
lucid-multiMultilingual streaming3Global applications
lucid-agentVoice agent optimized3Chatbots, voice assistants
lucid-liteEconomy streaming2High-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