NuevoCarril Eco ya en 91 modelos: el mismo modelo a menor precio

Moneda

Siempre recargas en euros. Las demás monedas se muestran al tipo de cambio de hoy del BCE. Tipos de cambio de referencia del BCE

Iniciar sesiónEmpezar

Documentaciónv1

Menú de la documentaciónRate limits

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.

Response
{  "error": {    "message": "Rate limit exceeded: 600 requests per minute for this key.",    "type": "rate_limit_error",    "param": null,    "code": "rate_limit_exceeded"  }}

Response headers

HeaderWhenMeaning
x-request-idEvery responseThe ID of the request in our logs, such as req_029b4d9a45564767aab4.
retry-afterOnly on 429Seconds 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: input takes 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.