# QUIT

> Ask the server to close the connection once pending replies are sent.

URL: https://docs.hotkv.com/commands/quit/

```
QUIT
```

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

`QUIT` replies `OK` and closes the connection once every earlier reply has
been sent. Nothing sent after `QUIT` on the same connection runs. It can be
sent before the connection is authenticated.

Closing the socket from the client side has the same effect, and most client
libraries do that instead.

## Return value

Simple string `OK` in RESP2 and RESP3. The server then closes the
connection.

## Examples

```
127.0.0.1:6379> QUIT
OK
```

## Compatibility

Same as Redis 7 and Valkey 8. Redis 7.2 marks `QUIT` as deprecated in favour
of closing the connection; HotKV keeps it working.

## See also

[RESET](https://docs.hotkv.com/commands/reset/index.md), [CLIENT KILL](https://docs.hotkv.com/commands/client-kill/index.md)