Rate Limits
Connection limits, timeouts, and reconnection guidance.
Function Timeout
The SSE endpoint runs as a Vercel Serverless Function with maxDuration set to 300 seconds (5 minutes). After 5 minutes, the function terminates and the stream closes.
Your client must reconnect to continue receiving events.
Reconnection Strategy
Custom clients
Implement exponential backoff with jitter:
EventSource handles reconnection automatically with its built-in backoff. For custom fetch-based clients:
let retries = 0;
function connect() {
const response = await fetch(URL, { headers: { Authorization: `Bearer ${TOKEN}` } });
retries = 0; // reset on successful connection
// ... read stream ...
// On stream end or error:
retries++;
const delay = Math.min(1000 * 2 ** retries, 30000) + Math.random() * 1000;
setTimeout(connect, delay);
}| Retry | Delay range |
|---|---|
| 1 | 2 -- 3 s |
| 2 | 4 -- 5 s |
| 3 | 8 -- 9 s |
| 4 | 16 -- 17 s |
| 5+ | 30 -- 31 s (capped) |
Concurrent Connections
There is no enforced limit on concurrent SSE connections per token. However, each connection consumes a Vercel Serverless Function invocation. For most use cases, a single connection is sufficient.
Token Expiry Mid-Stream
Tokens are validated only at connection time. If a token expires while a stream is active, the stream continues until it closes naturally (function timeout or client disconnect). The next reconnection attempt will fail with .
Keep-Alive
The SSE endpoint does not send periodic keep-alive pings. The stream is silent between tip events. EventSource clients handle idle connections correctly — no heartbeat is needed on the client side.
If your custom client has an idle timeout, set it above 300 seconds or disable it for this connection.