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
string
required
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.string
required
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.
integer
required
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.
integer
required
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).integer
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
Examples
Output
Default output shows the request ID, followed by the rate limit result:--output=json, the full response envelope is returned: