Default limits
Need a higher rate limit?Our services are infinitely scalable and we offer custom rate limits that scale to support any workload at no additional cost. If you need a higher rate limit, please either contact our Sales team or send an email to support@assemblyai.com.
Auto-scaling
Anytime you open 80% or more of your current limit in a minute, the number of new streams able to be opened over the next minute will automatically increase by 10%. Auto-scaling applies to paid accounts; free accounts stay at their starting limit. For example, assuming you max out your available new sessions rate limit each minute for 5 minutes:
At the start of the 6th minute, there would be 610 total open streams. Over the next 60 seconds, a maximum of 160 (146 x 1.10, rounded down) new streams would be able to be opened.
This usage pattern has no ceiling and can continue to scale up indefinitely to whatever your application requires.
Scale-down behavior
Based on the rate at which you are opening streams in comparison to your current limit, your new sessions per minute limit adjusts as follows:- 80% or more: scales up by 10%.
- 60% to 79%: unchanged.
- Less than 60%: scales down by 5% for the next minute, but never below your account’s starting limit.
If your usage has been low for a period of time, the scale-down may impact your ability to immediately open a large number of new streams, even if you have a high number of open sessions.
What happens when you hit the limit
If you exceed your current new sessions per minute limit, the server sends anError message with the text Unauthorized Connection: Too many concurrent sessions, then closes the WebSocket with code 1008 and the reason See Error message for details. Despite the wording, the limit counts new sessions per minute, not open sessions. Back off and open the session again in the next minute.
Credential and account problems, such as an invalid API key or insufficient funds, also close with code 1008. Retry only when the error text is Unauthorized Connection: Too many concurrent sessions; for any other 1008, fix the key or account first. See Common session errors and closures for the full list.
You can check your current limit on the Rate Limits page of your dashboard.
Only opening a session counts against the limit. Sessions that stay open do not, and closing sessions does not free up room within the current minute. If you are receiving this error unexpectedly, look for code that opens sessions in a loop, such as reconnecting without backoff.
Properly terminating sessions
To ensure sessions are cleaned up correctly:- If you are using the WebSocket API directly, send a
Terminatemessage ({"type": "Terminate"}) to close the session.
This also affects your billStreaming is billed per session — the total time your WebSocket stays open, not the amount of audio you send. Sessions that aren’t terminated auto-close after 3 hours and are billed for the full duration.
Check your limit
You can view your current streaming rate limit on the Rate Limits page of your dashboard.With the current version of multi-project support, rate limiting is applied at the account level, not at the project level. This means that the rate limits for each API key mirror the rate limits for the account.