> 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/developers/ai-and-agents/use-with-ai.md).

# Use these docs with AI

Give Claude, Cursor, Devin, ChatGPT or any AI agent access to the Lighter docs via llms.txt and Markdown pages.

These docs are designed to be read by AI assistants and coding agents as well as people.

## llms.txt

[`https://docs.lighter.xyz/llms.txt`](https://docs.lighter.xyz/llms.txt) lists every guide and API endpoint with a one-line summary and a link to its Markdown version. Point your agent at it to discover pages.

## Markdown pages

Add `.md` to any page URL to get clean Markdown:

```
https://docs.lighter.xyz/developers/getting-started/quickstart-typescript.md
https://docs.lighter.xyz/api/transactions.md
```

## Tell your agent how to build on Lighter

Drop the [Agent instructions](/developers/ai-and-agents/agent-instructions.md) into your repo as `AGENTS.md` / `CLAUDE.md` / `.cursor/rules` so your coding agent follows Lighter's rules (decimals, nonces, key safety) by default.

### Devin

1. Commit the [Agent instructions](/developers/ai-and-agents/agent-instructions.md) as `AGENTS.md` in the root of the repo Devin works on. Devin reads it automatically at the start of every session.
2. Optionally, add a [skill](https://docs.devin.ai/product-guides/skills) for Lighter work at `.agents/skills/lighter/SKILL.md`, so Devin looks up the docs before writing Lighter code:

{% code title=".agents/skills/lighter/SKILL.md" %}

```markdown
---
name: lighter
description: Use when writing or changing code that calls the Lighter API, WebSocket or signer.
---

1. Read https://docs.lighter.xyz/llms.txt and open the relevant pages (append .md to any page URL).
2. Follow the rules in AGENTS.md: integer prices and sizes, per-API-key nonces, confirm execution after sendTx.
3. Test against testnet (https://testnet.zklighter.elliot.ai, chain ID 300) before touching mainnet.
```

{% endcode %}

## Letting an AI agent trade

If you're building an agent that trades on a user's behalf:

* Give it a **dedicated API key** on a **dedicated sub-account** funded with only what it may risk.
* Use a **read-only token** for any agent that only needs to look. See [Read-only Authentication](/developers/integration-guides/api-keys.md#read-only-authentication).
* Never give an agent the user's Ethereum private key. API keys can't send funds to other owners.
* Keep a human confirmation step for withdrawals, transfers and large orders.


---

# 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/developers/ai-and-agents/use-with-ai.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.
