success field in the response to determine if the request should be allowed.
Required permissions:
ratelimit.*.limit(to check limits in any namespace)ratelimit.<namespace_id>.limit(to check limits in a specific namespace)
See the API reference for the full HTTP endpoint documentation.
Usage
Flags
The id or name of the namespace. Use namespaces to organize rate limits by service or purpose, such as
api.requests or auth.login. Must be 1-255 characters.The entity being rate limited. Use user IDs for per-user limits, IP addresses for anonymous limiting, or API key IDs for per-key limits. The same identifier can be used across different namespaces to apply multiple rate limit types. Must be 1-255 characters.
Maximum operations allowed within the duration window before requests are rejected. When this limit is reached, subsequent requests fail until the window resets. Balance user experience with resource protection when setting limits for different user tiers.
Rate limit window duration in milliseconds after which the counter resets. Shorter durations enable faster recovery but may be less effective against sustained abuse. Common values include
60000 (1 minute), 3600000 (1 hour), and 86400000 (24 hours).How much of the rate limit quota this request consumes, enabling weighted rate limiting. Defaults to
1. Use higher values for resource-intensive operations and 0 for tracking without limiting. When accumulated cost exceeds the limit within the duration window, subsequent requests are rejected.Global Flags
| Flag | Type | Description |
|---|---|---|
--root-key | string | Override root key ($UNKEY_ROOT_KEY) |
--api-url | string | Override API base URL (default: https://api.unkey.com) |
--config | string | Path to config file (default: ~/.unkey/config.toml) |
--output | string | Output format — use json for raw JSON |
Examples
Output
Default output shows the request ID with latency, followed by the rate limit result:--output=json, the full response envelope is returned:

