> For the complete documentation index, see [llms.txt](https://docs.lighter.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lighter.xyz/api/readme.md).

# API Reference

Lighter and Lighter on Robinhood Chain expose the **same REST API, WebSocket API and transaction format**. Pick the base URL and chain ID that match the exchange you are integrating; the server selector in each endpoint's **Test it** panel lists all four.

| Exchange                           | REST base URL                         | WebSocket                                  | Chain ID |
| ---------------------------------- | ------------------------------------- | ------------------------------------------ | -------- |
| Lighter mainnet                    | `https://mainnet.zklighter.elliot.ai` | `wss://mainnet.zklighter.elliot.ai/stream` | `304`    |
| Lighter testnet                    | `https://testnet.zklighter.elliot.ai` | `wss://testnet.zklighter.elliot.ai/stream` | `300`    |
| Lighter on Robinhood Chain mainnet | `https://api.rh.lighter.xyz`          | `wss://api.rh.lighter.xyz/stream`          | `466324` |
| Lighter on Robinhood Chain testnet | `https://api.rh-testnet.lighter.xyz`  | –                                          | `300`    |

Endpoints marked **Lighter on Robinhood Chain only** (points, referral points) exist only on the RH servers. Endpoints marked **Lighter only** (binary options) exist only on the Lighter servers.

{% hint style="info" %}
Lighter RH is a **separate exchange**: accounts, balances, API keys, nonces and account indexes don't carry over, and a transaction signed for one is rejected by the other. See [Lighter on Robinhood Chain](https://docs.lighter.xyz/developers/robinhood-chain/overview).
{% endhint %}

## Sections

* **REST API** – every endpoint under `/api/v1/`, grouped by resource.
* [**WebSocket**](/api/websocket.md) – streaming market and account data, and sending transactions over WebSocket.
* [**Explorer API**](https://docs.lighter.xyz/api/explorer-api) – blocks, batches, account logs and market logs.

New to the API? Start with [Get Started](https://docs.lighter.xyz/developers) and [Signing Transactions](https://docs.lighter.xyz/developers/integration-guides/signing-transactions).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.lighter.xyz/api/readme.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
