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

# Rate Limits

> We enforce rate limits on both REST API and WebSocket usage.

All rate limits are enforced **per IP address**.

## REST API

| Endpoint | Requests/min | Requests/hour |
| - | :-: | :-: |
| `POST /exchange` | 20,000 | — |
| `POST /info` | 5,000 | 200,000 |

## WebSocket

| Limit | Value |
| - | :-: |
| Max connections per IP | 100 |
| Max subscriptions per IP | 1,000 |
| Max inbound messages/min per IP | 2,000 |

> [!NOTE]
>
> The 2,000 messages/min limit applies to messages **sent by the client** (subscribe, unsubscribe, ping, etc.). There is no limit on server-to-client messages.

## Response Headers

### `/exchange` endpoint

| Header | Description | Example |
| - | - | :-: |
| `X-Used-Weight-1m` | Weight used in current minute | `1250` |
| `Retry-After` | Seconds until retry allowed (only on 429) | `12` |

### `/info` endpoint

Includes all headers from `/exchange`, plus:

| Header | Description | Example |
| - | - | :-: |
| `X-RateLimit-1m` | Requests used / limit (1 min window) | `150/5000` |
| `X-RateLimit-1h` | Requests used / limit (1 hour window) | `3200/200000` |

## Error Responses

### HTTP 429 — Rate Limited

```json theme={null}
{
  "code": 429,
  "message": "Rate limit exceeded. Try again later."
}
```

### HTTP 418 — IP Banned

Returned after repeated rate limit violations.

```json theme={null}
{
  "code": 418,
  "message": "IP banned. Retry in 300 seconds."
}
```

> [!WARNING]
>
> Ban durations escalate with repeated violations: **5 min → 30 min → 2 hours → 24 hours → 7 days**.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.