Session Limits

Understand the session limits and billing for real-time streaming.

Plan Limits

PlanMax SessionConcurrent StreamsHourly LimitDaily Limit
Free5 minutes110 min30 min
Basic10 minutes230 min2 hours
Pro30 minutes560 min8 hours
Enterprise2 hours20UnlimitedUnlimited

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 CodeDescriptionAction
INSUFFICIENT_CREDITSNot enough credits to continueAdd credits and reconnect
SESSION_LIMIT_REACHEDMax session duration exceededStart a new session
CONCURRENT_LIMITToo many active streamsClose other streams first
HOURLY_LIMITHourly usage limit reachedWait or upgrade plan
DAILY_LIMITDaily usage limit reachedWait or upgrade plan
IDLE_TIMEOUTNo speech for 60 secondsReconnect 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