llms.txt sounds like a spec you need to study. It isn't — it's a small Markdown file, and you can write a good one in about ten minutes. Here's every part in order, then a complete file you can paste and adapt.
1. One H1 title
The first line is a single # heading — your project or site name. This is the only strictly required part of the whole format.
# Example Docs
2. A blockquote summary
Right under the title, add a one- or two-sentence > blockquote. It's the first context a model reads, so be specific: what the thing is and who it's for.
> Example is a payments API. This file links to the docs an LLM needs to
> integrate and debug Example.
3. (Optional) a line or two of prose
You may add plain paragraphs before any section — a bit more orientation. No headings here; keep it to a sentence or two.
4. Group links under ## sections
Each section is an ## heading followed by a Markdown list. Every item is a link with an optional description after a colon.
## Docs
- [Quickstart](https://example.com/docs/quickstart): Integrate in five minutes
- [API reference](https://example.com/docs/api): Every endpoint and parameter
Two rules that matter: use absolute https:// URLs, and write descriptions for a developer or model — not marketing copy.
5. Push nice-to-haves into ## Optional
A section literally named ## Optional is the convention for secondary stuff an agent can skip when it needs a shorter context — changelogs, blog posts, extra references.
6. Host it at the root (or the path it covers)
Serve it at https://yourdomain.com/llms.txt as Content-Type: text/plain. Spec v2 also lets it live at a subpath that covers everything beneath it — /docs/llms.txt describes /docs/, and agents prefer the most specific file that applies. Big docs sites often also publish an llms-full.txt with the full expanded content.
7. Let your pages point at it
So agents don't have to guess the URL, advertise it from your pages:
<link rel="describedby" href="/llms.txt">
…or set the equivalent Link: response header once in your CDN config.
The complete file (paste & adapt)
# Example — Payments API
> Example is a payments API. This file links to the docs an LLM needs to
> integrate, test, and debug Example.
## Docs
- [Quickstart](https://example.com/docs/quickstart): Integrate in five minutes
- [Authentication](https://example.com/docs/auth): API keys and OAuth
- [API reference](https://example.com/docs/api): Every endpoint and parameter
## Examples
- [Sample app](https://example.com/examples/app): A working end-to-end integration
## Optional
- [Changelog](https://example.com/changelog): Release notes
- [Blog](https://example.com/blog): Background and deep dives
Swap in your own name, summary, and links. Keep it curated — the best few pages, not every page.
8. Validate before you ship
The one step people skip: actually checking it resolves. A file can be perfect Markdown and still point at 404s, which wastes a crawler's budget. Paste your domain into an llms.txt validator — it checks the structure, fetches every linked URL, and lists exactly what to fix. Aim for 100/100, then ship it.
That's the whole thing. Ten minutes, one small file, and your site finally tells AI models what it is instead of making them guess.
Top comments (0)