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

# API overview

> The Totalis Hyperliquid REST and WebSocket API: base URL, authentication, requests, pagination, units, errors, and rate limits.

The Hyperliquid API is REST over HTTPS with JSON bodies, in `snake_case`, plus a
[WebSocket](/hyperliquid/api-reference/websocket/connection) for account and maker updates and a
[market data socket](/hyperliquid/api-reference/websocket/market-data) for public prices. It is separate from the
[Solana API](/solana/api-reference/introduction) and has its own keys.

## Base URL

```
https://hip4-api.totalis.trade
```

| Surface | URL |
| - | - |
| REST | `https://hip4-api.totalis.trade/v1/...` |
| WebSocket | `wss://hip4-api.totalis.trade/v1/stream` |
| Market data | `wss://hip4-api.totalis.trade/v1/market-stream` |

Every route runs on HyperEVM, chain ID `999`.

## Try it without a key

Market reads are public:

```bash theme={null}
curl "https://hip4-api.totalis.trade/v1/markets?limit=3"
```

## Authentication

Send your API key as a bearer token on every authenticated request:

```
Authorization: Bearer ttk_v1_prd_...
```

Each key acts for one account, yours or a maker's, and holds scopes. Calls that move funds also carry
a wallet signature in the body. Keys, scopes and signing are on
[Authentication & signing](/hyperliquid/authentication).

## Requests

* A command `POST` sends an `Idempotency-Key` header, a new lowercase UUIDv7 per command. A few
  routes take none.
* Amounts are strings in USDC atomic units (6 decimals): `"25000000"` is 25 USDC. Never a JSON number.
* Large identifiers (`outcome_id`, chain, block) are decimal strings.

The full encoding table and the idempotency exceptions are on
[Errors, pagination & limits](/hyperliquid/errors#requests).

## Responses

A successful response is the resource itself, with no envelope. A `204` has no body. A list returns its
rows in `items` and pages by cursor:

```json theme={null}
{ "items": [], "next_cursor": "eyJnIjo2NDM3LCJhIjoxMjYwLCJrIjoibWFya2V0In0", "has_more": true }
```

Send `next_cursor` back as `?cursor=` until `has_more` is `false`. Cursors are opaque, so do not parse
or build them. Page size rules are on [Pagination](/hyperliquid/errors#pagination).

## Errors

Every HTTP error has the same shape:

```json theme={null}
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "The stake must be a positive integer.",
    "retry": "NEVER",
    "request_id": "0198f0a2-5c1e-7b3a-9f10-2d4c6e8a0b12",
    "field_violations": [{ "field": "/stake", "code": "INVALID" }]
  }
}
```

Branch on `error.code`, never on `error.message`, and follow `retry`. A WebSocket closes with a close
code and the error `code` as its reason instead. Every code is on [Errors](/hyperliquid/errors#codes).

## Rate limits

Over quota returns `429 RATE_LIMITED` with `Retry-After` in seconds. The per-route limits are on
[Rate limits](/hyperliquid/limits-and-fees#rate-limits).

## Endpoints by task

### Taking

| Step | Endpoint or event |
| - | - |
| Find markets | [`GET /v1/markets`](/hyperliquid/api-reference/markets/list-markets), [`GET /v1/markets/{outcome_id}`](/hyperliquid/api-reference/markets/get-market) |
| Check your balance | [`GET /v1/me/balances`](/hyperliquid/api-reference/account/get-balances) |
| Follow your account | [`GET /v1/stream`](/hyperliquid/api-reference/websocket/account), `account` subscription |
| Ask for quotes | [`POST /v1/rfqs`](/hyperliquid/api-reference/rfqs/create-rfq), then `QUOTE_CREATED` |
| Accept one | [`POST /v1/quotes/{quote_id}/accept`](/hyperliquid/api-reference/quotes/accept-quote) |
| Recover a lost accept | [`GET /v1/quotes/{quote_id}/acceptance`](/hyperliquid/api-reference/quotes/get-acceptance) |
| Stop asking | [`POST /v1/rfqs/{rfq_id}/cancel`](/hyperliquid/api-reference/rfqs/cancel-rfq) |
| Follow the fill | `OPERATION_UPDATED`, or [`GET /v1/me/operations/{operation_id}`](/hyperliquid/api-reference/account/get-operation) |
| Read positions | [`GET /v1/me/positions`](/hyperliquid/api-reference/positions/list-positions), [`GET /v1/me/positions/{position_id}`](/hyperliquid/api-reference/positions/get-position) |
| Cash out | [`POST /v1/me/positions/{position_id}/cashout`](/hyperliquid/api-reference/positions/cash-out-position), then accept a quote |
| Withdraw | [`POST /v1/me/withdrawals`](/hyperliquid/api-reference/withdrawals/create-withdrawal) |

### Making

| Step | Endpoint or event |
| - | - |
| Check capital | [`GET /v1/makers/{maker_id}/capital`](/hyperliquid/api-reference/makers/get-maker-capital) |
| Receive RFQs | [`GET /v1/stream`](/hyperliquid/api-reference/websocket/maker), `maker` subscription, `RFQ_CREATED` |
| Quote, or replace a quote | [`POST /v1/rfqs/{rfq_id}/quotes`](/hyperliquid/api-reference/quotes/create-quote) |
| Pull a quote | [`DELETE /v1/quotes/{quote_id}`](/hyperliquid/api-reference/quotes/cancel-quote) |
| Receive acceptances | `QUOTE_ACCEPTED`. Nothing is filled until you confirm. |
| Confirm or decline | [`POST /v1/quotes/{quote_id}/confirm`](/hyperliquid/api-reference/quotes/confirm-quote) |
| Reconcile after a restart | [`GET /v1/makers/{maker_id}/acceptances`](/hyperliquid/api-reference/quotes/list-acceptances) |
| Read backed positions | [`GET /v1/me/positions`](/hyperliquid/api-reference/positions/list-positions) with a maker key |
| Lower your collateral | [`POST /v1/makers/{maker_id}/collateral-reductions`](/hyperliquid/api-reference/makers/create-collateral-reduction) |

The full maker loop is on [Market making](/hyperliquid/guides/market-making).

## Endpoint groups

<CardGroup cols={2}>
  <Card title="Markets" icon="store" href="/hyperliquid/api-reference/markets/list-markets">
    HIP-4 markets, their sides and price history. Public.
  </Card>

  <Card title="RFQs & Quotes" icon="bolt" href="/hyperliquid/api-reference/rfqs/create-rfq">
    Request quotes and accept one as a taker, or quote and confirm as a maker.
  </Card>

  <Card title="Positions" icon="layer-group" href="/hyperliquid/api-reference/positions/list-positions">
    Positions you hold or your maker backs, and cash-outs.
  </Card>

  <Card title="Account" icon="wallet" href="/hyperliquid/api-reference/account/get-identity">
    Identity, balances, activity, operations and withdrawals.
  </Card>

  <Card title="Makers" icon="chart-line" href="/hyperliquid/api-reference/makers/get-maker-capital">
    Maker capital and collateral.
  </Card>

  <Card title="Deployment" icon="cube" href="/hyperliquid/api-reference/deployment/get-deployment">
    The chain, vault and fees every signature binds to.
  </Card>

  <Card title="WebSocket" icon="plug" href="/hyperliquid/api-reference/websocket/connection">
    Account and maker updates, resumable from a cursor.
  </Card>

  <Card title="Errors" icon="triangle-exclamation" href="/hyperliquid/errors">
    Every code, limit and rate limit, and which errors to retry.
  </Card>
</CardGroup>


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