# RATELIMIT.PEEK

> See whether a key could make a request under a rate limiter, without consuming anything.

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

```
RATELIMIT.PEEK name key
```

- 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.PEEK` reports what [RATELIMIT.CHECK](https://docs.hotkv.com/commands/ratelimit-check/index.md) would say
for a request costing 1 unit, without consuming it.

## Return value

| Case | RESP2 | RESP3 |
| --- | --- | --- |
| Always | Array of five integers, as for `RATELIMIT.CHECK` | Same |

The second element is the units available now (nothing is consumed), and the
fifth is the units in use. For a limiter that does not exist, every element is
`0`.

Errors:

- `ERR wrong number of arguments for 'ratelimit.peek' 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.CHECK api user:2
1) (integer) 1
2) (integer) 99
3) (integer) 0
4) (integer) 100
5) (integer) 0
127.0.0.1:6379> RATELIMIT.PEEK api user:2
1) (integer) 1
2) (integer) 99
3) (integer) 0
4) (integer) 100
5) (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.RESET](https://docs.hotkv.com/commands/ratelimit-reset/index.md), [RATELIMIT.STATS](https://docs.hotkv.com/commands/ratelimit-stats/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)