Rate limits
How many requests per minute each API key can send, which headers the API returns, and what happens when you hit the limit.
La documentación está en inglés.
Each API key can send a limited number of requests per minute. The default is 600 requests per minute per key. Every key of your organization has its own limit. The limit counts requests, not tokens, over a sliding window of 60 seconds.
Read the limit of a key with GET /v1/key:
curl https://api.nexrouting.com/v1/key \ -H "Authorization: Bearer $NEXROUTING_API_KEY"The response above is shortened; see Current key for every field.
What counts
Every request with a key counts, on every endpoint, including GET /v1/credits and GET /v1/key. GET /v1/models needs no key and doesn't count. Requests refused because of the limit don't count either.
When you hit the limit
You get status 429 with code rate_limit_exceeded and a retry-after header: the number of seconds until the oldest request in the window drops out.
{ "error": { "message": "Rate limit exceeded: 600 requests per minute for this key.", "type": "rate_limit_error", "param": null, "code": "rate_limit_exceeded" }}Response headers
| Header | When | Meaning |
|---|---|---|
x-request-id | Every response | The ID of the request in our logs, such as req_029b4d9a45564767aab4. |
retry-after | Only on 429 | Seconds to wait before you retry. |
The API doesn't send x-ratelimit-* headers. Keep count in your client, or react to 429.
Busy models
A 429 can also mean that the model is busy on every route. The message is then “The model is receiving too many requests right now. Try again shortly.” and retry-after is 5 seconds. Your key's limit has nothing to do with it: retry after a few seconds, or try the other lane.
Staying under the limit
- Give each app or service its own key: each key has its own limit.
- Send many texts in one embeddings request:
inputtakes an array. - Retry with exponential backoff and honour
retry-after. - Need a higher limit? Contact support from the help button in the dashboard or at support@nexrouting.com.