Concurrency Limits and Timeouts

Learn about concurrency limits and timeouts with the Cartesia API.

We measure concurrency in terms of the number of unique contexts active at a given time. For WebSockets, each context_id corresponds to a unique context; additional messages you send with the same context_id will not count against your concurrency limit. For regular HTTP endpoints, each HTTP request corresponds to a context.

If you exceed your concurrency limit, you will receive a 429 Too Many Requests error. You can check your concurrency limit and upgrade it on the playground at play.cartesia.ai.

Interpreting concurrency limits

How you interpret your concurrency limit depends on how you’re using Sonic.

WebSocket timeouts

We close idle WebSocket connections after 5 minutes. If you need to keep a connection open for longer, you can periodically do a generation to keep the connection from idling.