Documentation Index
Fetch the complete documentation index at: https://unkey.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Unkey Deploy is in public beta. To try it, open the product switcher in the
top-left of the dashboard and select Deploy. During beta, deployed
resources are free. We’re eager for feedback, so let us know what you think
on Discord, X, or
email support@unkey.com.
429 response, protecting your app from traffic spikes and abuse.
Each rate limit policy specifies a maximum number of requests within a time window (for example, 100 requests per 60 seconds) and an identifier that determines how the Sentinel groups requests for counting.
Rate limit state is managed by Unkey’s distributed rate limiting service, so limits are consistent across multiple Sentinel replicas.
Configuration
You can create and manage rate limit policies from the Sentinel Policies page in your project dashboard. Each policy requires:- Limit: the maximum number of requests allowed in the window
- Window: the time window in which the limit applies (for example, 60 seconds)
- Identifier: how the Sentinel determines which requests share a rate limit bucket
- Match conditions: which requests the policy applies to (optional, an empty match list applies to all requests)
Identifiers
The identifier determines how the Sentinel groups requests for counting:| Identifier | Description |
|---|---|
| Remote IP | Limit by client IP address. Effective for anonymous traffic but can over-limit users behind shared NATs or proxies. |
| Header value | Limit by a specific request header (for example, X-Tenant-Id). Use only when the header is set by a trusted upstream. |
| Authenticated subject | Limit by the authenticated Principal’s subject field. Requires an authentication policy earlier in the list. |
| URL path | Create separate limits per endpoint, useful for protecting expensive routes. |
| Principal field | Limit by a dotted-path field from the Principal (for example, source.key.meta.org_id for per-organization limits). Requires an authentication policy earlier in the list. |
Response headers
When the Sentinel evaluates a rate limit, it includes the rate limit state in the response headers:| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum number of requests allowed in the window |
X-RateLimit-Remaining | Requests remaining in the current window |
X-RateLimit-Reset | Unix timestamp (seconds) when the window resets |
Retry-After | Seconds until the client can retry (only present on 429) |
Exceeded rate limit behavior
When a rate limit is exceeded, the Sentinel returns HTTP status429 Too Many Requests with the Retry-After header and a JSON error body:

