# Using these docs with AI tools

Source: https://platform.lyrouter.com/ai_gateway/docs/ai-tools/en
Last updated: 2026-10-19

Every page of these docs has a Markdown version written for AI, and there is also a site index, a full-text bundle, OpenAPI specs and an MCP server. When you ask DeepSeek, ChatGPT, Claude, Cursor, Claude Code or a similar tool to write code against the LYRouter API, give it one of these instead of letting it guess from memory.

All addresses below are on the console domain `https://platform.lyrouter.com`, not on the gateway `https://api.lyrouter.com`.

## Which one to use

| Purpose | What to give the AI |
| --- | --- |
| Ask about one page | "Copy as AI-friendly Markdown" at the top of the page |
| Let the AI find the relevant pages itself | [llms.txt](https://platform.lyrouter.com/llms.txt) |
| Give the AI all the docs at once | [llms-full.txt](https://platform.lyrouter.com/llms-full.txt) |
| Generate client code or validate requests | [OpenAPI specs](#openapi-specs) |
| Look up the docs from your editor or terminal | [MCP server](#mcp-server) |

## Copy button on each page

Each page has a **Copy as AI-friendly Markdown** button under its title. It copies the page as Markdown; paste it into any AI chat to ask about the page. The copy starts with the page address; links within the site become full addresses, screenshots become text descriptions, and code blocks are kept as they are.

## Markdown address of each page

Add `.md` to a page address to get the page as Markdown, the same content that "Copy as AI-friendly Markdown" copies:

| Page | Markdown address |
| --- | --- |
| `https://platform.lyrouter.com/ai_gateway/docs/errors` | `https://platform.lyrouter.com/ai_gateway/docs/errors.md` |
| `https://platform.lyrouter.com/ai_gateway/docs/errors/en` | `https://platform.lyrouter.com/ai_gateway/docs/errors/en.md` |

English pages have `/en` in the address; articles that exist only in Chinese have no `en.md`.

## llms.txt and llms-full.txt

Two files follow the [llms.txt convention](https://llmstxt.org):

| File | Contents |
| --- | --- |
| [`/llms.txt`](https://platform.lyrouter.com/llms.txt) | The docs index: each page's title, Markdown address and a one-sentence summary, Chinese first and English after, with the OpenAPI specs and the MCP server listed at the end |
| [`/llms-full.txt`](https://platform.lyrouter.com/llms-full.txt) | All Chinese articles as one Markdown file, separated by `---`, each starting with its address |

`llms-full.txt` is long. Use it with models that have a large context window, or upload it as a knowledge file. When you only need part of the docs, give the AI `llms.txt` and let it fetch the pages it needs.

## OpenAPI specs

| File | Covers |
| --- | --- |
| [lyrouter-openapi.yaml](https://platform.lyrouter.com/ai_gateway/api-spec/lyrouter-openapi.yaml) | Chat (Chat Completions, Responses, Anthropic Messages), embeddings, rerank and listing models |
| [multimodal-openapi.yaml](https://platform.lyrouter.com/ai_gateway/api-spec/multimodal-openapi.yaml) | Multimodal endpoints such as image generation and editing, and video tasks |

Both are OpenAPI 3.1. Give them to an AI as the reference for the API, or generate a client with a code generator:

```bash
npx openapi-typescript https://platform.lyrouter.com/ai_gateway/api-spec/lyrouter-openapi.yaml \
  -o ./src/lyrouter-api.d.ts
```

The specs describe the API the gateway exposes. Which parameters a particular model accepts is given on each endpoint page and in [Protocol compatibility and limits](https://platform.lyrouter.com/ai_gateway/docs/compatibility/en).

## MCP server

The docs are available from an MCP server at:

```text
https://platform.lyrouter.com/api/v1/docs/mcp
```

It uses the Streamable HTTP transport and needs no API key. It provides two tools:

| Tool | What it does |
| --- | --- |
| `search_docs` | Searches the docs by keywords or a question, in Chinese or English, and returns the title, page address, Markdown address and a snippet of matching pages |
| `get_doc` | Reads the full Markdown of one page by its identifier (such as `errors`) or its address, in Chinese or English |

Add it to Claude Code:

```bash
claude mcp add --transport http lyrouter-docs https://platform.lyrouter.com/api/v1/docs/mcp
```

In Cursor, put this configuration in `~/.cursor/mcp.json` (or in the project's `.cursor/mcp.json` to use it in one project only):

```json
{
  "mcpServers": {
    "lyrouter-docs": {
      "url": "https://platform.lyrouter.com/api/v1/docs/mcp"
    }
  }
}
```

For other tools that support remote MCP servers, add the same address as their instructions describe. Once it is added, mention "the LYRouter docs" in your question and the AI calls these tools to get the current content.

## FAQ

### The AI says it cannot open the docs address. What should I do?

**Answer:** Some AI products cannot browse the web in a chat, or cannot open arbitrary addresses. Use "Copy as AI-friendly Markdown" and paste the content into the chat instead.

### The AI's parameters differ from these docs. Which is right?

**Answer:** These docs. The AI may be mixing in content from the OpenAI or Anthropic documentation or from older versions. Give it the Markdown of the relevant page and ask again.
