Session Limits
Understand the session limits and billing for real-time streaming.
Plan Limits
| Plan | Max Session | Concurrent Streams | Hourly Limit | Daily Limit |
|---|---|---|---|---|
| Free | 5 minutes | 1 | 10 min | 30 min |
| Basic | 10 minutes | 2 | 30 min | 2 hours |
| Pro | 30 minutes | 5 | 60 min | 8 hours |
| Enterprise | 2 hours | 20 | Unlimited | Unlimited |
Connection Requirements
- Minimum Credits: 60 credits required to start a session
- Idle Timeout: Sessions auto-close after 60 seconds of no speech
- Credit Check: Balance verified every 30 seconds during streaming
How Billing Works
📊 Billing: You're charged based on audio stream duration at the model's credit rate.
- Credits calculated based on audio duration sent
- Rate depends on model (2-3 credits/second)
Session Management
Checking Session Status
// The server sends periodic status updates
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
if (data.type === 'session_status') {
console.log('Session duration:', data.duration);
console.log('Credits used:', data.credits_used);
console.log('Credits remaining:', data.credits_remaining);
}
};
Graceful Disconnect
// Close the connection gracefully
ws.send(JSON.stringify({ type: 'close' }));
// Or simply close the WebSocket
ws.close();
Error Handling
| Error Code | Description | Action |
|---|---|---|
INSUFFICIENT_CREDITS | Not enough credits to continue | Add credits and reconnect |
SESSION_LIMIT_REACHED | Max session duration exceeded | Start a new session |
CONCURRENT_LIMIT | Too many active streams | Close other streams first |
HOURLY_LIMIT | Hourly usage limit reached | Wait or upgrade plan |
DAILY_LIMIT | Daily usage limit reached | Wait or upgrade plan |
IDLE_TIMEOUT | No speech for 60 seconds | Reconnect when ready |
Best Practices
- Monitor credits remaining during long sessions
- Implement reconnection logic for dropped connections
- Use appropriate model for your use case to optimize costs
- Close connections when not actively streaming to free up slots