Unkey Deploy is currently in private beta. To get access, reach out on
Discord 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 a subject that identifies the entity being limited.
Rate limit subjects
The subject determines how the Sentinel groups requests for counting:| Subject | Description |
|---|---|
| Remote IP | Limit by client IP address |
| Header value | Limit by a specific request header (for example, X-Tenant-Id) |
| Authenticated subject | Limit by the authenticated Principal’s subject field |
| URL path | Create separate limits per endpoint |
| Source field | Limit by a field from the Principal’s source (for example, source.key.meta.org_id for per-organization limits) |
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:

