Operations
Limits on the token mint endpoint, how to detect them, and how to back off correctly.
Rate limits apply to the token mint endpoint at POST /v1/token. The open WebSocket itself has no per-message rate limit; once your token is accepted, events stream as they happen.
The mint endpoint
| Bucket | Limit | Window |
|---|---|---|
| Per API key | 30 requests | 60 seconds |
| Per source IP | 60 requests | 60 seconds |
A request is counted whether it succeeds or fails. Whichever bucket fills first triggers the limit.
In normal production use you mint a token once per WebSocket connection, so you would not hit either limit unless you reconnect many times in close succession. If a single integration is hitting these, treat it as a sign of an aggressive reconnect loop and increase your backoff.
What you receive
When a request is rate-limited, the response is:
HTTP/1.1 429 Too Many Requests
Content-Type: application/json
Retry-After: 60
{"error":"rate_limited"}
The Retry-After header is the number of seconds to wait. Honor it.
How to handle it
- Read the
Retry-Aftervalue as a number of seconds. Default to 60 if it’s missing. - Pause your reconnect logic for that many seconds.
- Add jitter (a random 0-5 second offset) so multiple instances don’t retry at the exact same second.
- Mint again. If you hit
429again, double your wait time on subsequent attempts, capped at a few minutes.
const retryAfter = Number(response.headers.get("retry-after") ?? 60);
const jitter = Math.random() * 5;
await sleep((retryAfter + jitter) * 1000);
When you keep hitting limits
If your application is hitting 429 repeatedly under normal operation, something is wrong with the reconnect loop. A correctly-behaved client mints one token per connection, and connections last as long as the network holds them open. Hitting 30 mints/minute on one key means a reconnect storm. Common causes:
- A retry loop with no backoff that mints tokens as fast as possible
- Multiple application instances sharing one API key and reconnecting simultaneously
- A health check probing
/v1/tokeninstead of an HTTP endpoint
Fix the reconnect logic at the source. The limit isn’t something to raise; if you’re hitting it, your integration is doing more work than it needs to.