# HTTP — `GET /v1/rateLimits`

Returns the current usage of the exchange request budget of the API key's
account. Requires an API key. Takes no query parameters and no request body.
An API key cannot read the budget of another account.

The exchange budget counts units. A `POST /v1/exchange` request or a write
WebSocket frame costs 1 unit, and a `cancel` or `mass_cancel` with
`fastCancel: true` costs 2. A request needs 1 unit left to be accepted. With 1
unit left, a `fastCancel` request is still accepted: `remaining` reads 0, and
your next request waits until 2 units refill. Each account has its own budget
at the owner's limit, 1,200 units per minute unless Mosaiq set another limit
for the owner.
[HTTP — overview](/api/http-public#rate-limits) lists every limit and how the
budget refills.

```sh
curl "$MOSAIQ_API_BASE_URL/v1/rateLimits" \
  -H "Authorization: Bearer $MOSAIQ_API_KEY"
```

Example HTTP `200` response:

```json
{
  "status": "ok",
  "data": {
    "limit": 1200,
    "used": 40,
    "remaining": 1160,
    "account": "0x9f3c5d0e7a41b2c86f1d94e03a5b7c2d18e6f0a1",
    "owner": "0x0000000000000000000000000000000000000001"
  },
  "server_time_ms": 1790085600000
}
```

| Field | Type | Meaning |
| ----- | ---- | ------- |
| `limit` | integer | The budget of the account: its burst capacity, and the number of units that refill per minute. |
| `used` | integer | Units spent and not yet refilled, equal to `limit - remaining`. It goes down as units refill. It is not a count of past requests. |
| `remaining` | integer | Whole units that the budget has now. Your other requests can spend them before your next one. |
| `account` | string | The address of the account that the API key acts for. |
| `owner` | string | The owner's wallet. For the key of a master account, it equals `account`. |

* Reading this endpoint does not spend the exchange budget. It counts toward
  the HTTP limit of the client IP.
* An exhausted budget returns HTTP `200` with `remaining: 0`.
* A deposit, withdrawal, or transfer sent with the wallet session spends the
  budget of the master account.
* Rotating the API key does not reset the budget.
* The answer does not include the HTTP limit of your IP, venue quotas, or the
  WebSocket connection, message, and in-flight limits.

## Errors

| HTTP | `code` | `detail` | Meaning |
| ---- | ---- | ---- | ------- |
| `429` | `rate_limited` | `rate_limited` | The client IP exceeded its HTTP limit. `retryAfterMs` gives the milliseconds until it admits a request again. |
| `401` | `unauthorized` | `unauthorized` | Missing, invalid, expired, or revoked API key. A Para JWT gets this error too. |
| `403` | `forbidden` | `not_registered` | The authenticated wallet has no Mosaiq account. |
| `500` | `internal_error` | `internal_error` | Mosaiq could not load the account. |

Example HTTP `429` response:

```json
{
  "status": "error",
  "data": { "code": "rate_limited", "detail": "rate_limited", "msg": "rate limit exceeded", "retryAfterMs": 350 },
  "server_time_ms": 1790085600000
}
```
