# CLIENT ID

> Return the unique id of the current connection.

URL: https://docs.hotkv.com/commands/client-id/

```
CLIENT ID
```

- Group: Connection
- Complexity: O(1)
- HotKV Cloud: all plans
- On-Premise: no license needed

`CLIENT ID` returns the id of the current connection. Ids are unique for the
life of the server process and grow with every new connection, so a larger
id means a newer connection. The same id appears as `id=` in
[CLIENT LIST](https://docs.hotkv.com/commands/client-list/index.md), in the `id` field of
[HELLO](https://docs.hotkv.com/commands/hello/index.md), and is what [CLIENT KILL](https://docs.hotkv.com/commands/client-kill/index.md)
`ID` and [CLIENT UNBLOCK](https://docs.hotkv.com/commands/client-unblock/index.md) take.

## Return value

The id as an integer, in RESP2 and RESP3.

## Examples

```
127.0.0.1:6379> CLIENT ID
(integer) 12
```

## Compatibility

Same as Redis 7 and Valkey 8.

## See also

[CLIENT INFO](https://docs.hotkv.com/commands/client-info/index.md), [CLIENT LIST](https://docs.hotkv.com/commands/client-list/index.md),
[CLIENT KILL](https://docs.hotkv.com/commands/client-kill/index.md), [CLIENT UNBLOCK](https://docs.hotkv.com/commands/client-unblock/index.md)