Guides: Guides to monitoring AI traffic and making documentation AI-ready: Markdown pages, llms.txt and crawler access
# Guides for AI-ready documentation
> Vendor-neutral guides on monitoring AI traffic to your documentation and making your docs ready for AI to crawl, fetch, and read.
AI assistants, answer engines, and training crawlers now read documentation alongside human readers. You can track this traffic and prepare any docs site for it, whether or not you use EkLine. The methods use open standards and common practices, not EkLine features. ## Monitor AI traffic [Section titled “Monitor AI traffic”](#monitor-ai-traffic) Understand which AI bots read your documentation, how to identify them in your logs, and how to measure their activity. [Understand AI traffic to your docs ](/guides/ai-traffic/understanding/)What AI bots and crawlers are, the three categories that matter, and why they affect documentation teams. [Identify AI bots and crawlers ](/guides/ai-traffic/identify-bots/)A reference of common user-agent tokens by operator, with verification methods. [Monitor AI traffic to your docs ](/guides/ai-traffic/monitor/)Measure AI crawler and referral traffic using server logs, CDN analytics, and web analytics. ## Make your docs AI-ready [Section titled “Make your docs AI-ready”](#make-your-docs-ai-ready) Configure your documentation site so AI tools can fetch, read, and use your content, and decide which AI systems may access it. [Serve a Markdown version of every page ](/guides/serve-markdown/)Give each page a clean Markdown version through per-page files, content negotiation, and an HTML discovery tag. [What is llms.txt? ](/guides/llms-txt/what-is-llms-txt/)The proposed standard, its format, and how it differs from robots.txt and sitemap.xml. [Add an llms.txt file to your docs ](/guides/llms-txt/add-llms-txt/)Create, place, and maintain an llms.txt file, with platform-specific options. [Control AI crawler access ](/guides/control-ai-access/)Use robots.txt to block training crawlers while allowing AI search and on-demand fetchers. [Stop AI assistants from recommending removed API endpoints ](/guides/retire-api-endpoints-for-ai/)Retire an endpoint so AI tools find the removal and its replacement in your docs, spec, llms.txt, and API responses. ## Where EkLine helps [Section titled “Where EkLine helps”](#where-ekline-helps) Serving your docs to AI tools only pays off when the content behind them is accurate. EkLine keeps that side current. [How EkLine Docs Reviewer works ](/reviewer/overview/)Catch style, terminology, and broken-link problems in pull requests before AI tools read the published page. [EkLine Automations ](/agent/scheduled-agents/)Run recurring audits, including an SEO review of titles, descriptions, headings, and internal links, on a schedule you set.
# Identify AI bots and crawlers
> Reference table of AI bot user-agent tokens by operator and category, plus how to verify a request is genuine using reverse DNS and published IP ranges.
You identify AI traffic by the user-agent token each bot reports. Match these tokens in your server logs to spot AI traffic, and use them to write `robots.txt` rules. Caution Operators add, rename, and retire bots often, and user-agent strings carry version numbers that change. Treat this table as a starting point, and check current values in each operator’s own bot docs. The “Verify a bot is genuine” section explains why the token alone is not proof. ## Common AI user-agent tokens [Section titled “Common AI user-agent tokens”](#common-ai-user-agent-tokens) The token is the part of the user-agent string you match in `robots.txt` and logs — for example, the full OpenAI string `Mozilla/5.0 ... compatible; GPTBot/1.1; +https://openai.com/gptbot` reports the token `GPTBot`. | Operator | Token | Category | Notes | | ------------ | -------------------------------------- | ---------------------- | --------------------------------------------------------------------------------------------- | | OpenAI | `GPTBot` | Training crawler | Collects content for model training. | | OpenAI | `OAI-SearchBot` | Search indexer | Indexes content for ChatGPT search. | | OpenAI | `ChatGPT-User` | On-demand fetcher | Fetches a page when a user’s prompt references it. | | Anthropic | `ClaudeBot` | Training crawler | Collects content for Claude model training. | | Anthropic | `Claude-SearchBot` | Search indexer | Indexes content for Claude search results. | | Anthropic | `Claude-User` | On-demand fetcher | Fetches a page for a Claude user request. | | Anthropic | `anthropic-ai`, `Claude-Web` | Training crawler | Deprecated tokens; keep in block rules for safety. | | Google | `Googlebot` | Search indexer | Search crawler; content can also surface in AI Overviews. | | Google | `Google-Extended` | Training control token | A `robots.txt` token to control Gemini and Vertex AI training. It is not a separate crawler. | | Google | `GoogleOther`, `Google-CloudVertexBot` | Crawler / fetcher | Used for research and Vertex AI fetches. | | Perplexity | `PerplexityBot` | Search indexer | Indexes content for Perplexity answers. | | Perplexity | `Perplexity-User` | On-demand fetcher | Fetches a page for a user’s Perplexity query. | | Apple | `Applebot` | Search indexer | Powers Siri and Spotlight suggestions. | | Apple | `Applebot-Extended` | Training control token | A `robots.txt` token to opt out of Apple Intelligence training. It is not a separate crawler. | | Meta | `meta-externalagent` | Training crawler | Collects content for Meta AI model training. | | Meta | `Meta-ExternalFetcher` | On-demand fetcher | Fetches a page for a user-initiated request. | | Amazon | `Amazonbot` | Crawler | Crawls for Amazon services, including AI features. | | ByteDance | `Bytespider` | Training crawler | Collects training data; has a history of inconsistent `robots.txt` compliance. | | Common Crawl | `CCBot` | Open dataset crawler | Builds a public dataset widely used for model training. | | Cohere | `cohere-ai` | Crawler | Fetches content for Cohere models. | | DuckDuckGo | `DuckAssistBot` | On-demand fetcher | Fetches a page for DuckDuckGo’s assistant. | ## Verify a bot is genuine [Section titled “Verify a bot is genuine”](#verify-a-bot-is-genuine) A user-agent string is self-reported text, so anyone can copy a known token to disguise a scraper. Before you trust, rate-limit, or report a bot based on its name, confirm the request actually comes from the stated operator. Two methods are standard: ### Published IP ranges [Section titled “Published IP ranges”](#published-ip-ranges) Some operators publish the IP addresses their bots use, so you can match the request’s source IP against the official list. OpenAI publishes JSON files for each of its bots — for example, `GPTBot` addresses at `https://openai.com/gptbot.json`. Other operators publish ranges on their crawler documentation pages. Match the request IP against the current published list before acting. ### Forward-confirmed reverse DNS [Section titled “Forward-confirmed reverse DNS”](#forward-confirmed-reverse-dns) When an operator does not publish IP ranges, use forward-confirmed reverse DNS (FCrDNS). Search engines recommend the same method to verify their crawlers: 1. Run a reverse DNS lookup on the request’s source IP to get a hostname. 2. Confirm the hostname belongs to the operator’s domain. 3. Run a forward DNS lookup on that hostname and confirm it resolves back to the original IP. A request passes only if all three steps agree. This defeats spoofing, because attackers cannot control the operator’s DNS records. ## Sources [Section titled “Sources”](#sources) For current values, check each operator’s own docs and a maintained bot directory: * [OpenAI: Overview of OpenAI crawlers](https://platform.openai.com/docs/bots) * [Anthropic: Does Anthropic crawl data from the web?](https://support.claude.com/en/articles/8896518-does-anthropic-crawl-data-from-the-web-and-how-can-site-owners-block-the-crawler) * [Perplexity: Perplexity crawlers](https://docs.perplexity.ai/guides/bots) * [Known Agents directory](https://knownagents.com/) ## Next steps [Section titled “Next steps”](#next-steps) * [Monitor AI traffic to your docs](/guides/ai-traffic/monitor/) — turn these tokens into measurable reports. * [Control AI crawler access](/guides/control-ai-access/) — use these tokens to allow or block crawlers in `robots.txt`.
# Monitor AI traffic to your docs
> Measure AI crawler and referral traffic to your documentation using server logs, CDN and edge analytics, and web analytics tools such as GA4.
Measure the AI traffic that reaches your documentation: find AI crawlers in your access data, and track human visitors who arrive from AI answer engines. The techniques are tool-agnostic and work with most hosting and analytics stacks. ## Goal [Section titled “Goal”](#goal) Produce a repeatable view of: * Which AI bots fetch your documentation, and how often. * Which pages they fetch most. * How many human visitors arrive from AI products such as ChatGPT and Perplexity. ## Prerequisites [Section titled “Prerequisites”](#prerequisites) * Access to one source of traffic data: raw server or access logs, a CDN or edge dashboard, or a web analytics tool. * The user-agent tokens you want to track. See [Identify AI bots and crawlers](/guides/ai-traffic/identify-bots/). * For verification, the ability to check source IP addresses against published ranges or reverse DNS. ## Choose where to measure [Section titled “Choose where to measure”](#choose-where-to-measure) Each data source captures a different slice of traffic. Pick the one that matches what you need. | Source | Captures | Best for | | --------------------------- | ------------------------------------------------------------ | -------------------------------------------------- | | Server and access logs | Every request, including bots that run no JavaScript | Complete crawler visibility | | CDN and edge analytics | Requests at the network edge, often with built-in bot labels | Sites behind a CDN that want low-effort dashboards | | Web analytics (such as GA4) | Human visits that execute JavaScript | AI referral traffic from real users | Caution Most AI crawlers do not execute JavaScript, so they never appear in client-side web analytics. To see crawlers, you need server logs or edge data. Use web analytics for human referral traffic, not for bot activity. ## Measure AI crawlers in server logs [Section titled “Measure AI crawlers in server logs”](#measure-ai-crawlers-in-server-logs) Server logs record the user agent and source IP of every request, which makes them the most complete source for crawler activity. 1. Confirm your access logs include the user-agent field. Common web servers log it by default in the combined log format. 2. Filter the logs for the tokens you want to track. For example, to count requests from major AI crawlers in an access log: ```bash grep -E "GPTBot|ClaudeBot|OAI-SearchBot|PerplexityBot|CCBot|Bytespider" access.log | wc -l ``` 3. Break the activity down by bot and by page to see what each crawler reads: ```bash # Requests per AI bot token grep -oE "GPTBot|ClaudeBot|OAI-SearchBot|PerplexityBot|CCBot|Bytespider" access.log \ | sort | uniq -c | sort -rn # Pages one bot requests most (field 7 is the request path in the combined log format) grep "GPTBot" access.log | awk '{print $7}' | sort | uniq -c | sort -rn | head -20 ``` 4. Verify high-volume bots are genuine before you act on the numbers. Match the source IP against the operator’s published ranges or use forward-confirmed reverse DNS, as described in [Verify a bot is genuine](/guides/ai-traffic/identify-bots/#verify-a-bot-is-genuine). ## Find AI traffic on your hosting platform [Section titled “Find AI traffic on your hosting platform”](#find-ai-traffic-on-your-hosting-platform) Your hosting platform sees every request at the edge, including bots that run no JavaScript, so it can surface AI-bot traffic even for a fully static site. Use the view that matches your platform. ### Vercel [Section titled “Vercel”](#vercel) Open **Observability → CDN Requests** (formerly Edge Requests). It breaks traffic down by individual bot and bot category, including AI crawlers and search engines, on all plans. The **AI Traffic** tab shows AI bot requests over time and the pages AI crawlers and AI assistants request most. **Firewall Observability** shows requests by user agent and IP. The **AI bots managed ruleset** lets you log or deny known AI crawlers from a list Vercel maintains. For raw access logs, stream [Log Drains](https://vercel.com/docs/log-drains) to your own store (paid). See [Bot Management](https://vercel.com/docs/bot-management). ### Netlify [Section titled “Netlify”](#netlify) Set up [Log Drains](https://docs.netlify.com/manage/monitoring/log-drains/) to stream server-level request logs to a destination such as Datadog or S3. Netlify tags known AI crawlers (`GPTBot`, `ClaudeBot`, `PerplexityBot`, and others) as `crawler;ai` in its [user-agent categories](https://docs.netlify.com/build/user-agent-categories/). It puts the category on the `Netlify-Agent-Category` request header, so you can filter AI traffic without keeping your own token list. On-demand fetchers such as `ChatGPT-User` and `Claude-User` are tagged `ai-agent;user` instead. Because this is server-side, it captures bots that client-side analytics drop. ### Cloudflare [Section titled “Cloudflare”](#cloudflare) If your site uses Cloudflare as a proxy, [AI Crawl Control](https://developers.cloudflare.com/ai-crawl-control/) (formerly AI Audit) shows which AI services access your content. It breaks them down by provider, bot type (AI data scraper, AI search crawler, archiver), and the sections they fetch. It also flags which crawlers honor your `robots.txt`. It is the most detailed AI-traffic view of the three, and you can set allow or block rules from the same screen. ### Another host or CDN [Section titled “Another host or CDN”](#another-host-or-cdn) If your platform sees requests at the edge, check its dashboard for a bot or crawler analytics view. Prefer reports that verify bots over ones that trust the user-agent string. Otherwise, fall back to server logs as described in the preceding section. ## Track AI referral traffic in web analytics [Section titled “Track AI referral traffic in web analytics”](#track-ai-referral-traffic-in-web-analytics) Referral traffic is the human side of AI traffic: visitors who click through from an AI answer. Capture it in your web analytics tool by segmenting on the referrer. 1. In your analytics tool, create a segment or filter for traffic whose source or referrer hostname matches an AI product, such as `chatgpt.com`, `perplexity.ai`, `gemini.google.com`, or `copilot.microsoft.com`. 2. Compare landing pages, engagement, and conversions for this segment against your other channels to judge whether AI citations send qualified readers. 3. Review the segment over time. The set of AI products that drive referrals changes, so revisit the hostname list each quarter. ## A note on privacy and abuse [Section titled “A note on privacy and abuse”](#a-note-on-privacy-and-abuse) * **Do not log personal data you do not need.** Access logs can contain IP addresses and other identifiers. Follow your retention and privacy policies, and anonymize where your obligations require it. * **Rate-limit abusive crawlers, not all bots.** If a verified bot fetches aggressively enough to affect performance, rate-limit or throttle it at the edge. Reserve blocking for bots you have confirmed are both unwanted and genuine. ## Verify your setup [Section titled “Verify your setup”](#verify-your-setup) You have a working monitor when you can answer, from your own data: * Which AI bots reached your docs in the last week, and how many requests each made. * Which pages those bots fetched most. * How many human visitors arrived from AI products, and where they landed. ## Related [Section titled “Related”](#related) * [Understand AI traffic to your docs](/guides/ai-traffic/understanding/) — the categories behind the numbers. * [Identify AI bots and crawlers](/guides/ai-traffic/identify-bots/) — the tokens and verification methods this guide relies on. * [Add an llms.txt file to your docs](/guides/llms-txt/add-llms-txt/) — help AI systems use your content well once you can see them.
# Understand AI traffic to your docs
> Learn what AI bots and crawlers are, the three categories of AI traffic that matter for documentation, and why measuring them helps your team.
AI systems read your documentation. Training crawlers collect it, answer engines cite it, and assistants fetch it in real time to answer user questions. Most docs teams see little of this activity. ## Why AI traffic matters for documentation [Section titled “Why AI traffic matters for documentation”](#why-ai-traffic-matters-for-documentation) Documentation is high-value text: it is structured, factual, and maintained. That makes it a prime target for AI systems that summarize products, answer technical questions, and generate code. This affects your team in three ways: * **Reach.** When an assistant answers a question using your docs, your content reaches users who never visit your site. Accurate, well-structured docs produce accurate answers. * **Cost.** Aggressive crawlers consume bandwidth and server resources. High-volume bots can affect performance and hosting costs. * **Control.** You decide which systems may use your content for training versus real-time answers. You cannot make that decision without first seeing the traffic. ## Three categories of AI traffic [Section titled “Three categories of AI traffic”](#three-categories-of-ai-traffic) Not all AI traffic is the same. Distinguishing these categories tells you what each request is for and how to respond. ### Training crawlers [Section titled “Training crawlers”](#training-crawlers) Training crawlers collect content to build the datasets that train large language models. Like search engine crawlers, they visit widely and often. But the content feeds model training, not a search index. Examples include OpenAI’s `GPTBot`, Anthropic’s `ClaudeBot`, and Common Crawl’s `CCBot`. Google and Apple use separate robots.txt tokens (`Google-Extended` and `Applebot-Extended`) to control training use of content their search crawlers already fetch. ### On-demand fetchers [Section titled “On-demand fetchers”](#on-demand-fetchers) On-demand fetchers retrieve a specific page in real time because a user asked an assistant a question that references it. The request happens at the moment of the conversation, not during bulk crawling. Examples include OpenAI’s `ChatGPT-User`, Anthropic’s `Claude-User`, and `Perplexity-User`. This traffic is low-volume and tied directly to user intent, so it is often the most valuable to allow. ### AI search indexers [Section titled “AI search indexers”](#ai-search-indexers) AI search indexers build the indexes behind answer engines and AI search features. They crawl to keep an index current, which the engine then queries to generate cited answers. Examples include OpenAI’s `OAI-SearchBot`, Anthropic’s `Claude-SearchBot`, and `PerplexityBot`. ## A fourth signal: AI referral traffic [Section titled “A fourth signal: AI referral traffic”](#a-fourth-signal-ai-referral-traffic) Beyond bots, you also receive human visitors who arrive from AI products. When an answer engine cites your docs and a user clicks through, the visit shows up in your web analytics. Its referrer is a site such as `chatgpt.com` or `perplexity.ai`. Referral traffic is not a crawler — it is a real person who found you through an AI answer. Tracking it shows whether AI citations send qualified readers to your docs. ## Monitoring versus controlling [Section titled “Monitoring versus controlling”](#monitoring-versus-controlling) Teams often confuse two distinct activities: * **Monitoring** measures who reads your docs and how often. It is read-only and never blocks anyone. * **Controlling** uses tools such as `robots.txt`, firewall rules, or edge configuration to allow or deny access. See [Control AI crawler access](/guides/control-ai-access/). `robots.txt` is a control tool, not a monitoring tool — it states your preferences but does not measure or enforce them. Compliance is voluntary, and well-behaved bots honor it while others may not. Always measure actual traffic from your logs rather than assuming your `robots.txt` rules are followed. ## Next steps [Section titled “Next steps”](#next-steps) * [Identify AI bots and crawlers](/guides/ai-traffic/identify-bots/) — match user-agent tokens to operators and verify them. * [Monitor AI traffic to your docs](/guides/ai-traffic/monitor/) — measure this traffic with logs and analytics. * [How EkLine Docs Reviewer works](/reviewer/overview/) — keep the pages these bots read accurate and consistent.
# Control AI crawler access
> Use robots.txt to control which AI crawlers can access your documentation — block training crawlers while allowing search and on-demand fetchers.
You decide which AI systems may use your documentation. The standard lever is `robots.txt`, where you allow or disallow individual crawlers by their user-agent token. ## Goal [Section titled “Goal”](#goal) Publish a `robots.txt` that opts your content out of AI model training while keeping it available to the AI search and assistant traffic that sends readers your way. ## Prerequisites [Section titled “Prerequisites”](#prerequisites) * The ability to serve a file at your site root (`https://docs.example.com/robots.txt`). * The user-agent tokens you want to target. See [Identify AI bots and crawlers](/guides/ai-traffic/identify-bots/). ## The strategy: block training, allow search and on-demand [Section titled “The strategy: block training, allow search and on-demand”](#the-strategy-block-training-allow-search-and-on-demand) AI crawlers fall into categories that the [bot reference](/guides/ai-traffic/identify-bots/) describes in full. For documentation, a common position is: * **Block training crawlers** — they consume bandwidth to build model datasets and return little direct value (for example, `GPTBot`, `ClaudeBot`, `CCBot`, `Bytespider`, `meta-externalagent`). * **Block training with opt-out tokens** — `Google-Extended` and `Applebot-Extended` opt you out of Gemini and Apple Intelligence training without affecting search. * **Allow search indexers and on-demand fetchers** — these surface your docs in AI answers and fetch pages when a user asks a question, which sends qualified readers to you (for example, `OAI-SearchBot`, `Claude-SearchBot`, `PerplexityBot`, `ChatGPT-User`, `Claude-User`). ## Copy-paste template [Section titled “Copy-paste template”](#copy-paste-template) Add these rules to the `robots.txt` at your site root, or save them as a new `robots.txt` if you have none, then adjust the lists to match your policy. Anything not listed falls through to your existing default rules. ```text # Block AI training crawlers User-agent: GPTBot User-agent: ClaudeBot User-agent: anthropic-ai User-agent: CCBot User-agent: Bytespider User-agent: meta-externalagent User-agent: Google-Extended User-agent: Applebot-Extended User-agent: cohere-ai Disallow: / # Allow AI search indexers and on-demand fetchers User-agent: OAI-SearchBot User-agent: Claude-SearchBot User-agent: PerplexityBot User-agent: ChatGPT-User User-agent: Claude-User Allow: / ``` Caution `robots.txt` states your preference; it does not enforce it. Well-behaved crawlers honor it, but some ignore it. To enforce a block, combine it with firewall or CDN rules, and verify a crawler is genuine before acting — see [Verify a bot is genuine](/guides/ai-traffic/identify-bots/#verify-a-bot-is-genuine). ## Where to put the file [Section titled “Where to put the file”](#where-to-put-the-file) `robots.txt` must live at your domain root, the same level as `sitemap.xml`. How you publish it depends on your platform: * **Static sites (Astro, Docusaurus, and others)** — place `robots.txt` in the directory served at the root, such as `public/`. * **Mintlify** — create `robots.txt` at the root of your project. It replaces the file Mintlify generates. * **Subdomains are separate** — a docs subdomain (`docs.example.com`) needs its own `robots.txt`; the root domain’s file does not apply to it. ## Verify your setup [Section titled “Verify your setup”](#verify-your-setup) 1. Confirm the file is served at the root: ```bash curl https://docs.example.com/robots.txt ``` 2. Confirm your block and allow rules read as you intend, and that the tokens match the current values in the [bot reference](/guides/ai-traffic/identify-bots/). 3. After deploying, [monitor your logs](/guides/ai-traffic/monitor/) to confirm the crawlers you blocked stop appearing — and to catch any that ignore the rules. ## Related [Section titled “Related”](#related) * [Identify AI bots and crawlers](/guides/ai-traffic/identify-bots/) — the token reference these rules depend on. * [Monitor AI traffic to your docs](/guides/ai-traffic/monitor/) — confirm your rules are working. * [Serve a Markdown version of every page](/guides/serve-markdown/) — make the content you allow as readable as possible for AI.
# Add an llms.txt file to your docs
> Create, place, and maintain an llms.txt file for your documentation, with platform-specific options and automated generation.
Publish an `llms.txt` file so large language models can use your documentation at inference time. If you are new to the standard, read [What is llms.txt?](/guides/llms-txt/what-is-llms-txt/) first. ## Goal [Section titled “Goal”](#goal) Publish a valid `llms.txt` file at the root of your documentation site and keep it in sync as your docs change. ## Prerequisites [Section titled “Prerequisites”](#prerequisites) * A documentation site you can deploy static files to. * The ability to serve a file at your site root (for example, `https://docs.example.com/llms.txt`). * A short, accurate summary of what your product or project does. ## Decide what to include [Section titled “Decide what to include”](#decide-what-to-include) `llms.txt` is a curated file, so start by choosing the pages a model most needs: * Entry points: overview, quickstart, and getting-started pages. * High-value reference: API references, configuration, and core concepts. * Leave out marketing pages, duplicate content, and low-value utility pages. Group the rest under an **Optional** section so models can skip it when context is tight. ## Create the file [Section titled “Create the file”](#create-the-file) 1. Create a file named `llms.txt` with an H1 title and a blockquote summary: ```markdown # Example Docs > Example is a tool that does X for Y. This file links the documentation > most useful to language models answering questions about it. ``` 2. Add H2 sections with curated links. Point each link at a clean Markdown version of the page where one exists, and add a short note after a colon: ```markdown ## Docs - [Quickstart](https://docs.example.com/quickstart.md): Install and run in five minutes - [Configuration](https://docs.example.com/configuration.md): All settings and defaults ## Optional - [Changelog](https://docs.example.com/changelog.md): Release history ``` 3. Deploy the file to your site root so it resolves at `https://docs.example.com/llms.txt`. ## Fastest path: generate it from your docs [Section titled “Fastest path: generate it from your docs”](#fastest-path-generate-it-from-your-docs) Writing the file by hand does not scale, and you rarely need to. If your site runs on a common docs framework, a plugin generates `llms.txt` from your existing content at build time — so it stays current with no manual work. If you run **Astro Starlight**, this is a two-step setup. Install the plugin: ```bash npm install starlight-llms-txt ``` Add it to the `starlight` plugins array in `astro.config.mjs`: ```js import starlightLlmsTxt from 'starlight-llms-txt'; // inside starlight({ ... }) plugins: [starlightLlmsTxt()], ``` The plugin also needs the `site` option in your Astro config to write absolute links, so set it to your docs URL if your config does not have it. Build the site, and the plugin serves `llms.txt` and `llms-full.txt` from your root. Other platforms have equivalent plugins: * **Docusaurus** — add [`docusaurus-plugin-llms`](https://github.com/rachfop/docusaurus-plugin-llms). Install it with `npm install docusaurus-plugin-llms --save-dev`, then add `'docusaurus-plugin-llms'` to the `plugins` array in `docusaurus.config.js`. It generates both `llms.txt` and `llms-full.txt` on build with no further configuration. * **VitePress, MkDocs, and others** — community plugins generate the file during the build. * **Any platform** — the [`llms_txt2ctx`](https://llmstxt.org/) CLI from the specification authors converts an `llms.txt` file into model context, and most static-site generators have a community generator you can add to your build. If no plugin fits your platform, write the file by hand using the [manual steps](#create-the-file) and the [copy-paste template](#copy-paste-template). ## Copy-paste template [Section titled “Copy-paste template”](#copy-paste-template) Start from this complete file, replace the placeholders, and delete any sections you do not need: ```markdown # Your Project > One or two sentences on what your project does and who it is for. > This summary is the most important line — models read it first. ## Docs - [Overview](https://docs.example.com/overview.md): What the product is and when to use it - [Quickstart](https://docs.example.com/quickstart.md): Install and run in five minutes - [Configuration](https://docs.example.com/configuration.md): All settings and defaults - [API reference](https://docs.example.com/api.md): Endpoints, parameters, and responses ## Guides - [Authentication](https://docs.example.com/guides/auth.md): Set up API keys and tokens - [Deployment](https://docs.example.com/guides/deploy.md): Ship to production ## Optional - [Changelog](https://docs.example.com/changelog.md): Release history - [FAQ](https://docs.example.com/faq.md): Common questions ``` ## Validate the file [Section titled “Validate the file”](#validate-the-file) Before you rely on it, confirm the file is correct: * It resolves at `/llms.txt` and returns plain text or Markdown, not HTML. * It starts with a single H1 and a blockquote summary. * Every link resolves, and links point to Markdown versions where you provide them. * The summary is accurate and current. ## Keep it current [Section titled “Keep it current”](#keep-it-current) An `llms.txt` file that drifts from your docs sends models to stale or missing pages. * Regenerate the file on every documentation build so it tracks new and removed pages automatically. * If you maintain it by hand, review it on a fixed cadence, such as quarterly, and after any large documentation change. * Check periodically that linked Markdown versions still resolve. ## Verify your setup [Section titled “Verify your setup”](#verify-your-setup) You are done when: * `https://your-docs-domain/llms.txt` returns a valid file with an H1 and a blockquote. * The curated links resolve and point to your highest-value pages. * The file regenerates automatically, or you review it as part of your normal docs workflow. ## Related [Section titled “Related”](#related) * [What is llms.txt?](/guides/llms-txt/what-is-llms-txt/) — the format and the standard behind this file. * [Monitor AI traffic to your docs](/guides/ai-traffic/monitor/) — measure the AI systems that read your content. * [EkLine Automations](/agent/scheduled-agents/) — put the recurring review this file needs on a fixed cadence. Working example: Potluck Docs, EkLine’s open source docs template, does this by default. See how in its [source on GitHub](https://github.com/ekline-io/potluck-docs).
# What is llms.txt?
> Understand the llms.txt proposed standard: its format, its purpose for large language models, and how it differs from robots.txt and sitemap.xml.
`llms.txt` is a proposed standard for a single Markdown file, placed at the root of your site, that gives large language models a curated map of your documentation. Jeremy Howard of Answer.AI [proposed it on 3 September 2024](https://llmstxt.org/). ## The problem it solves [Section titled “The problem it solves”](#the-problem-it-solves) When an AI assistant answers a question about your product, it often needs to read your documentation at inference time. But a full docs site is hard for a model to use. Navigation, scripts, and styling wrap each page, and the whole site is far too large to fit in a model’s context window. `llms.txt` addresses this by offering a clean, curated index. Instead of crawling and parsing your entire site, a model can read one structured file that points to the pages that matter, each described in plain language. ## How llms.txt differs from robots.txt and sitemap.xml [Section titled “How llms.txt differs from robots.txt and sitemap.xml”](#how-llmstxt-differs-from-robotstxt-and-sitemapxml) `llms.txt` is often confused with two files it sits alongside. They serve different purposes. | File | Audience | Purpose | | ------------- | --------------------- | ---------------------------------------------------------------------- | | `robots.txt` | Crawlers | Controls which paths a crawler may access. | | `sitemap.xml` | Search engines | Lists every indexable URL for discovery. | | `llms.txt` | Large language models | Provides a curated, human-readable overview for use at inference time. | The distinction is curation. `sitemap.xml` aims to be complete and lists all of your pages. `llms.txt` is selective: it highlights the content most useful to a model and leaves out the rest. ## The file format [Section titled “The file format”](#the-file-format) The specification defines a precise structure built from standard Markdown, so both people and programs can read it: 1. An **H1 heading** with the name of the project or site. This is the only required element. 2. A **blockquote** with a short summary of the project, capturing the key information needed to understand the rest of the file. 3. Zero or more **Markdown sections** of free-form detail (paragraphs, lists) with no headings. 4. Zero or more **H2 sections**, each containing a list of links. Each list item is a Markdown link, optionally followed by a colon and a note. A minimal example: ```markdown # Example project > A short description of what the project does and who it is for. Additional context about the project in plain prose, with no heading. ## Docs - [Quickstart](https://example.com/quickstart.md): Get running in five minutes - [API reference](https://example.com/api.md): Full endpoint reference ## Optional - [Changelog](https://example.com/changelog.md): Release history ``` ## Companion conventions [Section titled “Companion conventions”](#companion-conventions) Two related conventions often accompany an `llms.txt` file: * **Markdown versions of pages.** The proposal recommends serving a clean `.md` version of each page at the same URL with `.md` appended (for example, `quickstart.md`). The links in `llms.txt` point to these Markdown versions so models receive content without site chrome. See [Serve a Markdown version of every page](/guides/serve-markdown/). * **`llms-full.txt`.** Many tools also generate an `llms-full.txt` file that inlines the full text of the documentation in one file, rather than linking out. This is a widely adopted companion to `llms.txt`, not part of the original specification. ## Adoption: a realistic view [Section titled “Adoption: a realistic view”](#adoption-a-realistic-view) `llms.txt` is a community proposal, not an official or ratified standard, and adoption is still evolving. * A growing number of documentation tools generate the file automatically, and many sites now publish one. * Not every AI vendor supports it. There is ongoing public debate about how many major systems read `llms.txt` today rather than crawling sites directly. Caution Treat `llms.txt` as low-effort and forward-looking rather than guaranteed. Publishing one is cheap and positions your docs well, but do not assume a specific assistant reads it. Avoid promising that adding the file changes how any particular AI product behaves. ## Next steps [Section titled “Next steps”](#next-steps) * [Add an llms.txt file to your docs](/guides/llms-txt/add-llms-txt/) — create, place, and maintain the file.
# Stop AI assistants from recommending removed API endpoints
> Retire an API endpoint so ChatGPT, Claude, and coding agents stop recommending it: keep a removal page, mark the spec, update llms.txt, and return 410 Gone.
You removed an endpoint, but ChatGPT, Claude, and coding agents still tell developers to call it. Retire the endpoint so that any AI tool reading your docs today finds a clear answer: the endpoint is gone, and here is what replaces it. ## Why assistants recommend endpoints you removed [Section titled “Why assistants recommend endpoints you removed”](#why-assistants-recommend-endpoints-you-removed) An AI assistant answers from two places: * **What the model learned in training.** Old versions of your docs, tutorials, and forum posts that mention the endpoint. You can’t edit this. It changes only when the model is retrained. * **What it reads at answer time.** When an assistant searches the web or fetches a page, or when a coding agent calls your API, it reads your current docs and responses. You control the second source. If your current docs delete the endpoint without a trace, the old tutorials are the only pages left that mention it, so the assistant repeats them. The steps in this guide make your docs the strongest current source on the endpoint, including the fact that it’s gone. ## Goal [Section titled “Goal”](#goal) Every place an AI tool can look, including your docs pages, OpenAPI spec, `llms.txt` file, and the API itself, says the endpoint is removed and names its replacement. ## Prerequisites [Section titled “Prerequisites”](#prerequisites) * A list of the endpoints you deprecated or removed, with the replacement for each. * Write access to your docs, your OpenAPI spec, and your `llms.txt` file. * Access to your API gateway or server configuration, to set response headers and status codes. Steps 2 and 4 start during the deprecation period, while the endpoint still works. Apply the rest on the day you remove it. ## Step 1: Keep a removal page for each retired endpoint [Section titled “Step 1: Keep a removal page for each retired endpoint”](#step-1-keep-a-removal-page-for-each-retired-endpoint) Don’t delete the reference page when you remove an endpoint. Replace its content with a short removal notice at the same URL. When an assistant searches for the endpoint by name, it then finds your notice instead of a third-party tutorial. A removal page states three things: what was removed and when, what replaces it, and how to migrate. ```markdown # POST /v1/orders/{id}/refund (removed) This endpoint was removed on March 31, 2026. Requests now return `410 Gone`. Use [POST /v2/refunds](/api/refunds/) instead. ## Migrate to POST /v2/refunds | v1 request | v2 request | |----------------------------|-----------------------| | `id` path parameter | `order_id` body field | | `amount` body field | `amount` body field | ``` Put the endpoint path in the page title and first sentence. Assistants match on the exact path a developer pastes into the question. ## Step 2: Mark the endpoint as deprecated in your OpenAPI spec [Section titled “Step 2: Mark the endpoint as deprecated in your OpenAPI spec”](#step-2-mark-the-endpoint-as-deprecated-in-your-openapi-spec) While an endpoint is deprecated but still working, set `deprecated: true` on the operation and name the replacement in its description. Most reference and SDK generators flag deprecated operations, and AI tools that read your spec see the flag too. ```yaml paths: /v1/orders/{id}/refund: post: operationId: refundOrder deprecated: true summary: Refund an order (deprecated) description: > Deprecated. This endpoint stops working on March 31, 2026. Use POST /v2/refunds instead. ``` After the removal date, delete the operation from the spec and record the removal in your changelog. Keep the removal page from Step 1. ## Step 3: Tell AI agents directly in `llms.txt` [Section titled “Step 3: Tell AI agents directly in llms.txt”](#step-3-tell-ai-agents-directly-in-llmstxt) An [`llms.txt` file](/guides/llms-txt/what-is-llms-txt/) can include free-form instructions after its summary. Use them to name removed endpoints and their replacements, and label any legacy links you keep. ```markdown # Example API > Example API lets you accept payments and manage orders. When you write code for Example API, use the v2 endpoints. Never recommend POST /v1/orders/{id}/refund. It was removed on March 31, 2026. Use POST /v2/refunds instead. ## Docs - [Refunds](https://docs.example.com/api/refunds.md): Create and track refunds (v2) - [Migrate from v1 refunds](https://docs.example.com/api/migrate-refunds.md): Map removed v1 calls to v2 ## Optional - [v1 orders API](https://docs.example.com/api/v1/orders.md): (Removed) Kept for reference only ``` Stripe takes this approach. Its [`llms.txt`](https://docs.stripe.com/llms.txt) has a section of instructions for language model agents that names deprecated APIs to avoid and the APIs to use instead. ## Step 4: Make the API itself say the endpoint is going or gone [Section titled “Step 4: Make the API itself say the endpoint is going or gone”](#step-4-make-the-api-itself-say-the-endpoint-is-going-or-gone) Coding agents often run the code they write. When the API response explains the removal, the agent can correct itself. Before removal, return the standard [`Deprecation`](https://www.rfc-editor.org/rfc/rfc9745.html) and [`Sunset`](https://www.rfc-editor.org/rfc/rfc8594.html) headers with a link to your migration guide: ```http HTTP/1.1 200 OK Deprecation: @1767225599 Sunset: Tue, 31 Mar 2026 23:59:59 GMT Link: ; rel="deprecation"; type="text/html" ``` After removal, return `410 Gone` rather than `404 Not Found`, and put the replacement in the response body: ```http HTTP/1.1 410 Gone Content-Type: application/json { "error": "endpoint_removed", "message": "POST /v1/orders/{id}/refund was removed on March 31, 2026. Use POST /v2/refunds.", "docs": "https://docs.example.com/api/migrate-refunds/" } ``` A `410` tells the caller the endpoint is gone on purpose. A `404` reads as a typo or a wrong base URL, which an agent may try to work around. ## Step 5: Let AI search and fetchers read your current docs [Section titled “Step 5: Let AI search and fetchers read your current docs”](#step-5-let-ai-search-and-fetchers-read-your-current-docs) Your corrections only help if assistants can reach them. * **Allow AI search indexers and on-demand fetchers** in `robots.txt`, such as `OAI-SearchBot`, `ChatGPT-User`, `Claude-SearchBot`, `Claude-User`, and `PerplexityBot`. Blocking them leaves assistants with training data alone. See [Control AI crawler access](/guides/control-ai-access/). * **Serve a Markdown version of each page**, so fetchers read the removal notice without navigation and scripts around it. See [Serve a Markdown version of every page](/guides/serve-markdown/). ## Step 6: Remove every other mention of the endpoint [Section titled “Step 6: Remove every other mention of the endpoint”](#step-6-remove-every-other-mention-of-the-endpoint) The reference page is rarely the only place an endpoint appears. Search your docs, code samples, SDK READMEs, and help-center articles for the endpoint path and update each match. One forgotten quickstart that still calls the old endpoint is enough for an assistant to recommend it. ## Verify your setup [Section titled “Verify your setup”](#verify-your-setup) 1. Search your docs repository for the removed path. The only matches should be the removal page, the migration guide, the changelog, and `llms.txt`. 2. Call the removed endpoint and confirm it returns `410 Gone` with the replacement in the body: ```bash curl -i -X POST https://api.example.com/v1/orders/123/refund ``` 3. Ask an assistant with web search enabled how to call the removed endpoint. The answer should cite your removal page or migration guide and name the replacement. 4. After deploying, [monitor AI traffic](/guides/ai-traffic/monitor/) to confirm search and fetch bots are reading the updated pages. ## Where EkLine helps [Section titled “Where EkLine helps”](#where-ekline-helps) Removed endpoints reach AI answers because docs fall behind code at release time. EkLine Docs Agent watches your code changes, finds the pages a removal affects, and drafts the update as a pull request you review. [Keep documentation in sync with code ](/agent/keep-docs-in-sync-with-code/)How EkLine detects drift when a pull request opens and on a schedule, then drafts the docs update. [Review your OpenAPI spec ](/reviewer/configuration/openapi-review/)Lint your spec for missing descriptions and other gaps before your API docs ship. ## Related [Section titled “Related”](#related) * [What is llms.txt?](/guides/llms-txt/what-is-llms-txt/): the format behind Step 3. * [Add an llms.txt file to your docs](/guides/llms-txt/add-llms-txt/): create and maintain the file. * [Understand AI traffic to your docs](/guides/ai-traffic/understanding/): the bots that read your docs and why they matter.
# Serve a Markdown version of every page
> Serve a clean Markdown version of every documentation page so AI tools can fetch it, using per-page .md files, content negotiation, and a discovery tag.
AI assistants and crawlers read better when they receive plain Markdown instead of a rendered HTML page wrapped in navigation, scripts, and styling. Serve a clean Markdown version of each page, so any AI tool gets your content directly. That includes coding assistants, answer engines, and on-demand fetchers. Markdown versions work with the [llms.txt](/guides/llms-txt/what-is-llms-txt/) file but stand on their own: llms.txt is the *map* of your docs, and the Markdown versions are the *clean content* that map points to. ## Three mechanisms that work together [Section titled “Three mechanisms that work together”](#three-mechanisms-that-work-together) You give AI a Markdown copy of a page through three complementary mechanisms. Set up as many as your platform supports — together they cover tools that look for content in different ways. | Mechanism | What it does | Who uses it | | ----------------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------- | | **Per-page `.md` file** | Adds `.md` to any page URL to return raw Markdown (for example, `/quickstart.md`) | Tools that guess the `.md` URL, and llms.txt links | | **Content negotiation** | Returns Markdown from the *same* URL when the request sends `Accept: text/markdown` | Agents that ask for Markdown by header | | **HTML discovery tag** | A `` in the page `` | Crawlers that read the HTML first, then follow the link | ## Generate a `.md` version of each page [Section titled “Generate a .md version of each page”](#generate-a-md-version-of-each-page) Most documentation tools can emit a Markdown file for every page at build time. Pick your platform. ### Astro Starlight [Section titled “Astro Starlight”](#astro-starlight) Add the [`starlight-contextual-menu`](https://github.com/corsfix/starlight-contextual-menu) plugin. It registers a `.md` route for every page and adds a menu to open or copy the page as Markdown. ```bash npm install starlight-contextual-menu ``` astro.config.mjs ```js import starlightContextualMenu from 'starlight-contextual-menu'; // inside starlight({ ... }) plugins: [ starlightContextualMenu({ actions: ['copy', 'view', 'chatgpt', 'claude'], }), ], ``` ### Docusaurus [Section titled “Docusaurus”](#docusaurus) Add [`docusaurus-plugin-llms`](https://github.com/rachfop/docusaurus-plugin-llms), which emits a per-page `.md` file alongside `llms.txt`: ```bash npm install docusaurus-plugin-llms --save-dev ``` docusaurus.config.js ```js module.exports = { plugins: [ ['docusaurus-plugin-llms', { generateMarkdownFiles: true }], ], }; ``` ### Mintlify [Section titled “Mintlify”](#mintlify) No setup is required. Mintlify serves a Markdown version of every page automatically — append `.md` to any page URL. ### Another platform [Section titled “Another platform”](#another-platform) If your generator has no plugin, configure your build to write the raw `.md` source of each page to a predictable path (for example, `/guide/quickstart.md`), and deploy those files alongside your HTML. ## Serve Markdown on the same URL (content negotiation) [Section titled “Serve Markdown on the same URL (content negotiation)”](#serve-markdown-on-the-same-url-content-negotiation) Content negotiation returns Markdown from the page’s normal URL when a client sends an `Accept: text/markdown` header, so an agent does not need to know the `.md` path. This is configured at your **host or CDN**, not in your framework. ### Vercel [Section titled “Vercel”](#vercel) Add rewrites that map requests with `Accept: text/markdown` to the `.md` file: vercel.json ```json { "rewrites": [ { "source": "/", "has": [{ "type": "header", "key": "accept", "value": "text/markdown" }], "destination": "/index.md" }, { "source": "/:path+/", "has": [{ "type": "header", "key": "accept", "value": "text/markdown" }], "destination": "/:path+.md" } ] } ``` ### Netlify [Section titled “Netlify”](#netlify) Add an Edge Function that runs on `GET` requests whose `Accept` header contains `text/markdown`, returns the page’s Markdown, and sets `Content-Type: text/markdown` and `Vary: Accept` on the response. ### Cloudflare [Section titled “Cloudflare”](#cloudflare) If your site is proxied through Cloudflare on a Pro, Business, or Enterprise plan, enable the managed **Markdown for Agents** feature. When a request sends `Accept: text/markdown`, Cloudflare converts the page to Markdown at the edge — no code required. See [Markdown for Agents](https://developers.cloudflare.com/fundamentals/reference/markdown-for-agents/). ### Mintlify [Section titled “Mintlify”](#mintlify-1) Content negotiation is built in. A request to any page URL with `Accept: text/markdown` returns Markdown automatically. Caution When you serve Markdown from the same URL as HTML, always set `Vary: Accept` on the response so caches and CDNs store the two representations separately. ## Advertise the Markdown version in your HTML [Section titled “Advertise the Markdown version in your HTML”](#advertise-the-markdown-version-in-your-html) Add a discovery tag to each page’s `` so crawlers that load the HTML first can find the Markdown twin: ```html ``` Add it through your platform’s head or custom-head mechanism (for example, a Starlight `Head` component override, a Docusaurus head injection, or a Mintlify layout setting). Some platforms and plugins add this tag for you. ## Verify your setup [Section titled “Verify your setup”](#verify-your-setup) 1. Request the `.md` file directly and confirm it returns Markdown: ```bash curl https://docs.example.com/guide/quickstart.md ``` 2. Request the normal URL with the Markdown header and confirm content negotiation works: ```bash curl -H "Accept: text/markdown" https://docs.example.com/guide/quickstart ``` 3. View the page source and confirm the discovery tag is present: ```bash curl -s https://docs.example.com/guide/quickstart | grep 'type="text/markdown"' ``` ## Related [Section titled “Related”](#related) * [What is llms.txt?](/guides/llms-txt/what-is-llms-txt/) — the curated index that links to these Markdown versions. * [Control AI crawler access](/guides/control-ai-access/) — decide which AI systems may fetch your content. Working example: Potluck Docs, EkLine’s open source docs template, does this by default. See how in its [source on GitHub](https://github.com/ekline-io/potluck-docs).