---
title: "Build with AI tools"
description: "Give the pirouter docs to a coding agent such as Cursor or Claude Code: every page has a Markdown version, plus an llms.txt index, a full-text file and a docs MCP server that needs no key."
canonical: "https://pirouter.ai/docs/build-with-ai"
last-updated: "2026-10-17"
lang: "en"
source: "content/docs/en/(start)/build-with-ai.mdx"
---

# Build with AI tools

Give the pirouter docs to a coding agent such as Cursor or Claude Code: every page has a Markdown version, plus an llms.txt index, a full-text file and a docs MCP server that needs no key.

Coding agents read Markdown more reliably than web pages. Every page of the pirouter docs has a Markdown version, and there is an `llms.txt` index and an MCP server that needs no key. Pick one and connect your tool.

## Markdown version of every page

Append `.md` to the address of any docs page to get it as Markdown, for example [`/docs/quickstart.md`](https://pirouter.ai/docs/quickstart.md). The docs home is `/docs/index.md`.

With the request header `Accept: text/markdown`, the page's own address returns Markdown too.

The **Copy page** menu under each page title copies the page as Markdown, or opens it in ChatGPT or Claude so you can ask about it.

## llms.txt and the full text

| File                                                            | Contents                                                                              |
| --------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| [`/docs/llms.txt`](https://pirouter.ai/docs/llms.txt)           | An index of every page by section: title, Markdown address and a one-line description |
| [`/docs/llms-full.txt`](https://pirouter.ai/docs/llms-full.txt) | The Markdown of every page in one file                                                |

For Chinese, prefix `/zh`. Give an agent `llms.txt` when it needs to find a page, and `llms-full.txt` when it should read the whole docs at once; the full file is long and takes a lot of context.

## Docs MCP server

Tools that speak MCP can connect to the docs server directly, with no API key:

```text
https://pirouter.ai/docs/mcp
```

It uses the Streamable HTTP transport, is read-only, and offers two tools:

| Tool          | What it does                                                                     |
| ------------- | -------------------------------------------------------------------------------- |
| `search_docs` | Full-text search; pass `locale` `zh` for the Chinese pages, `limit` from 1 to 10 |
| `read_doc`    | Read one page as Markdown by its path, or by a URL from the search results       |

Add it to Claude Code:

```bash
claude mcp add --transport http pirouter-docs https://pirouter.ai/docs/mcp
```

In other tools, add an HTTP MCP server with the same address in their MCP settings.

## Rules to paste

Put this block in your project's `AGENTS.md` (or `CLAUDE.md`, `.cursor/rules`) so the agent follows the docs when it writes code that calls pirouter:

`AGENTS.md`:

```markdown
## pirouter

- Docs: https://pirouter.ai/docs/llms.txt (append `.md` to any docs URL for Markdown).
- Base URLs: OpenAI protocol https://api.pirouter.ai/v1; Anthropic and Gemini protocols https://api.pirouter.ai.
- Auth: `Authorization: Bearer $PIROUTER_API_KEY`. Never hard-code the key.
- Model IDs are `vendor/model`, e.g. `openai/gpt-6.1-sol`. List them with `GET https://api.pirouter.ai/v1/models`.
- Branch on `error.code`, not on `error.message`. Do not retry 402.
```

## Next steps

- [Quickstart](https://pirouter.ai/docs/quickstart.md): Create a key, top up, and call a model.
- [Integrations](https://pirouter.ai/docs/integrations.md): Point the official SDKs and frameworks at pirouter.
