> ## Documentation Index
> Fetch the complete documentation index at: https://docs.llmgenerator.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Logout

> This endpoint revokes the user's current access and refresh tokens.

## POST /auth/logout

This endpoint invalidates the user's session by revoking all their refresh tokens. Requires a valid access token in the Authorization header.

<Warning>
  Access tokens remain valid until they expire (15 minutes). For immediate full logout, the client should also clear the access token locally.
</Warning>

### Request Headers

<ParamField header="Authorization" type="string" required>
  Bearer token. Format: `Bearer YOUR_ACCESS_TOKEN`
</ParamField>

### Response

<ResponseField name="success" type="boolean">
  Indicates whether the logout was successful.
</ResponseField>

<ResponseField name="message" type="string">
  A confirmation message.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.llmgenerator.com/api/v1/auth/logout \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.llmgenerator.com/api/v1/auth/logout', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
    }
  });

  const data = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json Success (200) theme={null}
  {
    "success": true,
    "message": "Logout successful. All refresh tokens have been revoked."
  }
  ```

  ```json Unauthorized (401) theme={null}
  {
    "message": "Authorization header required"
  }
  ```
</ResponseExample>
