# RATELIMIT.STATS

> Report a rate limiter's settings, tracked keys and allowed and denied totals.

URL: https://docs.hotkv.com/commands/ratelimit-stats/

```
RATELIMIT.STATS name
```

- Group: Rate limiting
- Complexity: O(1)
- HotKV Cloud: Performance and Scale plans
- On-Premise: requires the rate-limiting license feature

Named rate limiters apply one policy (a limit, a window and an algorithm) separately to every key you check against them, such as a user id, an API key or an IP address. `RATELIMIT.STATS` describes one limiter.

## Return value

The reply is a flat array of alternating field names and values in both RESP2 and RESP3 (it is not sent as a RESP3 map). The fields, in order:

| Field | Type | Meaning |
| --- | --- | --- |
| `name` | Bulk string | Limiter name. |
| `algo` | Bulk string | `sliding_window`, `token_bucket` or `leaky_bucket`. |
| `limit` | Integer | Units allowed per window. |
| `window_ms` | Integer | Window length in milliseconds. |
| `unique_keys` | Integer | Keys the limiter currently tracks. |
| `total_allowed` | Integer | Units allowed so far (the sum of the allowed requests' costs). |
| `total_denied` | Integer | Units denied so far. |

Errors:

- `ERR limiter not found` if the limiter does not exist.
- `ERR wrong number of arguments for 'ratelimit.stats' command` if the argument count is wrong.
- `NOLICENSE rate-limiting requires a HotKV license. Contact sales@hotkv.com` if your license does not include the `rate-limiting` feature.

## Examples

```
127.0.0.1:6379> RATELIMIT.STATS api
 1) "name"
 2) "api"
 3) "algo"
 4) "sliding_window"
 5) "limit"
 6) (integer) 100
 7) "window_ms"
 8) (integer) 60000
 9) "unique_keys"
10) (integer) 2
11) "total_allowed"
12) (integer) 101
13) "total_denied"
14) (integer) 1
```

## Compatibility

HotKV-only command. Redis and Valkey have no equivalent.

## See also

[RATELIMIT.CREATE](https://docs.hotkv.com/commands/ratelimit-create/index.md), [RATELIMIT.CHECK](https://docs.hotkv.com/commands/ratelimit-check/index.md), [RATELIMIT.PEEK](https://docs.hotkv.com/commands/ratelimit-peek/index.md), [RATELIMIT.RESET](https://docs.hotkv.com/commands/ratelimit-reset/index.md), [RATELIMIT.DROP](https://docs.hotkv.com/commands/ratelimit-drop/index.md), [RATELIMIT.LIST](https://docs.hotkv.com/commands/ratelimit-list/index.md), [AI features guide](https://docs.hotkv.com/ai-features/index.md)