premium_*) to match multiple identifiers. Set --limit=0 to completely block access for an identifier.
Required permissions:
ratelimit.*.set_override(to set overrides in any namespace)ratelimit.<namespace_id>.set_override(to set overrides in a specific namespace)
See the API reference for the full HTTP endpoint documentation.
Usage
Flags
The ID or name of the rate limit namespace. Must be 1-255 characters.
Identifier of the entity receiving this custom rate limit. This can be a specific user ID, an IP address, an email domain, or any other string that identifies the target entity. Must be 1-255 characters.Wildcards (
*) can be used to create pattern-matching rules that apply to multiple identifiers. For example:premium_*matches all identifiers starting withpremium_*_adminmatches all identifiers ending with_admin*suspicious*matches any identifier containingsuspicious
The maximum number of requests allowed for this override. This defines the custom quota for the specified identifier(s) and entirely replaces the default limit for matching identifiers. Minimum value is
0.Special values:- Higher than default — for premium or trusted entities
- Lower than default — for suspicious or abusive entities
- 0 — to completely block access (useful for ban implementation)
The duration in milliseconds for the rate limit window. This defines how long the rate limit counter accumulates before resetting to zero. Minimum value is
1000.Common values: 60000 (1 minute), 3600000 (1 hour), 86400000 (1 day). This can differ from the default duration for the namespace.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 created or updated override:--output=json, the full response envelope is returned:

