# Rate limits

> How many requests you can make, and what to do when you hit a limit.

Vink limits requests per IP address and per key. Both limits work as a token bucket: you can make a burst of requests at once, after which the bucket refills at a fixed rate.

## Catalog

| Limit | Burst | Then |
|---|---|---|
| Per IP address | 60 requests | 1 request every 5 seconds |
| Per key | 30 requests | 1 request every 2 minutes |

The limit per IP address is checked before the key, so a stream of requests with a wrong key is also stopped. A `304 Not Modified` counts as a request.

The catalog changes a few times a day. One request per hour with `If-None-Match` stays far below these limits.

## MCP server

| Limit | Burst | Then |
|---|---|---|
| Per IP address | 120 requests | 1 request per second |
| Per key | 60 tool calls | 1 tool call every 2 seconds |

Listing the tools does not count toward the limit per key. Without a key, only the limit per IP address applies.

## When you hit a limit

The customer API answers `429 Too Many Requests` with the code `RATE_LIMITED` and a `Retry-After` header with the number of seconds to wait:

```http
HTTP/1.1 429 Too Many Requests
Retry-After: 120
Content-Type: application/json

{"error":{"code":"RATE_LIMITED","message":"Too many catalog requests. Try again later."}}
```

Wait at least that long before the next request. Do not retry in a tight loop: every rejected request also counts toward the limit per IP address.

On the MCP server, a tool call over the limit returns a tool error `RATE_LIMITED` with the wait time in the text, so the assistant can wait and try again.

## Retrying other errors

For `502 UPSTREAM_ERROR` and `503 UPSTREAM_UNAVAILABLE`, retry with exponential backoff: wait 1 second, then 2, 4, 8, up to a few minutes, and stop after a handful of attempts. Do not retry `400` or `401`; the same request will fail again.
