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

# API Reference

> Endpoint reference for Hit REST and WebSocket APIs

The API Reference is organized by endpoint family. It lists bot-facing paths, parameters, request bodies, response schemas and WebSocket payloads. For workflow explanations and code examples, use the [Developers](/developers/quickstart) guides.

## Base URLs

| Surface   | Type      | Base URL                 |
| --------- | --------- | ------------------------ |
| REST API  | HTTPS     | `https://hit.com/api/v1` |
| WebSocket | Socket.IO | `wss://markets.hit.com`  |

## Auth Labels

| Label        | Type                           | Description                                                                                      |
| ------------ | ------------------------------ | ------------------------------------------------------------------------------------------------ |
| Public       | unauthenticated                | No credentials are required.                                                                     |
| JWT          | bearer token or session cookie | User authentication through an `Authorization: Bearer` token or supported authentication cookie. |
| API key HMAC | signed headers                 | Trading API key headers: `hit-api-key`, `hit-signature`, `hit-timestamp` and `hit-passphrase`.   |

## Sections

| Section                                         | Type               | Contents                                             |
| ----------------------------------------------- | ------------------ | ---------------------------------------------------- |
| [Authentication](/api-reference/authentication) | REST and Socket.IO | API key headers and WebSocket auth payload           |
| [Events](/api-reference/events)                 | REST               | Event discovery and event volume                     |
| [Markets](/api-reference/markets)               | REST               | Market lookup, market volume and public activity     |
| [Prices](/api-reference/prices)                 | REST               | Order books, last trade price and price history      |
| [Public Profiles](/api-reference/profiles)      | REST               | Public profile summary, P/L, positions and activity  |
| [Leaderboards](/api-reference/leaderboards)     | REST               | Combined P/L, volume and liquidity-rewards rankings  |
| [Trades](/api-reference/trades)                 | REST               | Raw trades and enriched public trade activity        |
| [Orders](/api-reference/orders)                 | REST               | Create, list and cancel orders                       |
| [Portfolio](/api-reference/portfolio)           | REST               | User positions, portfolio value and account activity |
| [Rewards](/api-reference/rewards)               | REST               | Dollar-denominated maker rewards and claims          |
| [WebSockets](/api-reference/websockets)         | Socket.IO          | Namespaces, client messages and server events        |

## Pagination

Paginated REST endpoints return `Pagination<T>`.

| Field         | Type            | Required | Description                                                                                                    |
| ------------- | --------------- | -------- | -------------------------------------------------------------------------------------------------------------- |
| `first`       | integer         | Yes      | One-based index of the first item on the current page.                                                         |
| `last`        | integer         | Yes      | One-based index of the last item on the current page.                                                          |
| `limit`       | integer         | Yes      | Maximum items returned on the current page.                                                                    |
| `total`       | integer or null | Yes      | Total item count when requested with `total=true`; otherwise `null` on endpoints that support skipping totals. |
| `totalCapped` | boolean         | No       | `true` when `total` reached the server-side count cap and represents a lower bound rather than an exact count. |
| `data`        | `T[]`           | Yes      | Page items.                                                                                                    |

Endpoints that support cursor pagination also return `hasMore` and `nextCursor`. Pass the opaque `nextCursor` value back as the next request's `cursor`; do not parse or modify it.

Some newer endpoints return page-number pagination instead:

| Field         | Type            | Required | Description                                                                 |
| ------------- | --------------- | -------- | --------------------------------------------------------------------------- |
| `page`        | integer         | Yes      | Current page number.                                                        |
| `limit`       | integer         | Yes      | Maximum items returned on the current page.                                 |
| `total`       | integer or null | Yes      | Total item count when requested.                                            |
| `pageCount`   | integer or null | Yes      | Total page count when `total` is available.                                 |
| `totalCapped` | boolean         | No       | `true` when `total` and `pageCount` are based on the server-side count cap. |
| `data`        | `T[]`           | Yes      | Page items.                                                                 |

## Errors

Errors use standard HTTP status codes with a JSON body when a message is available.

| Field        | Type                | Required | Description                           |
| ------------ | ------------------- | -------- | ------------------------------------- |
| `statusCode` | integer             | No       | HTTP status code.                     |
| `message`    | string or string\[] | Yes      | Error message or validation messages. |
| `error`      | string              | No       | HTTP error label.                     |
