Streaming

The Streaming Speech-to-Text service leverages WebSockets. This section details the endpoints and procedures necessary for utilizing the streaming functionality, including:

Below, you’ll also find information on error codes and limits.

Close and error codes

The WebSocket specification provides standard errors. Additionally, the API returns application-level errors for well-known scenarios:

Error ConditionStatus CodeMessage
bad sample rate4000”Sample rate must be a positive integer”
auth failed4001”Not Authorized”
insufficient funds4002”Insufficient Funds”
free tier user4003”This feature is paid-only and requires you to add a credit card. Please visit https://app.assemblyai.com/ to add a credit card to your account”
attempt to connect to nonexistent session id4004”Session not found”
session expired4008”Session Expired”
attempt to connect to closed session4010”Session previously closed”
rate limited4029”Client sent audio too fast”
unique session violation4030”Session is handled by another WebSocket”
session times out4031”Session idle for too long”
audio too short4032”Audio duration is too short”
audio too long4033”Audio duration is too long”
audio too small to transcode4034”Audio too small to transcode”
bad schema4101”Endpoint received a message with an invalid schema”
too many streams4102”This account has exceeded the number of allowed streams”
reconnected4103”This session has been reconnected. This WebSocket is no longer valid”
word boost parameter parsing failed4104”Could not parse word boost parameter”

Quotas and Limits

The following limits are imposed to ensure performance and service quality:

  • Idle Sessions - Sessions that don’t receive audio within 1 minute will be terminated.
  • Session Limit - 100 sessions at a time for paid users. Please contact us if you need to increase this limit. Free-tier users must upgrade their account to use real-time streaming.
  • Session Uniqueness - Only one WebSocket per session.
  • Audio Sampling Rate Limit - Customers must send data in near real-time. If a client sends data faster than 1 second of audio per second for longer than 1 minute, we’ll terminate the session.
Was this page helpful?