Goal
Publish a single Markdown file at https://yourdomain.com/llms.txt that tells AI agents: who you are, what the product does, and which URLs to prefer. This guide walks through a complete first file in about thirty minutes.
Validate any time with the free llms.txt Validator — paste mode or fetch URL.
Step 1 — Decide the audience
Write for a model that has never heard of you. Avoid internal codenames without explanation. Prefer:
- Product name people search for
- One-sentence category (“billing API for Indian SaaS”)
- Who should use the primary docs links
Step 2 — Write the H1 and summary
Create a file named llms.txt locally:
# Northwind API
> Northwind API is a REST platform for inventory and order data used by mid-market retailers.
Rules:
- First non-empty line must be
# Title - Put the elevator pitch in a
>blockquote, not a second heading - Keep the summary scannable (1–3 sentences)
Step 3 — Optional intro paragraph
Still without extra headings, add a short paragraph if agents need grounding:
Prefer official docs over marketplace blog posts. Authentication always uses API keys issued in the dashboard.
Step 4 — Add H2 sections with absolute links
Pick 2–4 section names (Docs, API, Examples, Policies, etc.). Under each, only use list items with Markdown links:
## Docs
- [Quickstart](https://docs.northwind.example/quickstart): Install SDK and first GET
- [Authentication](https://docs.northwind.example/auth): API keys and scopes
- [Rate limits](https://docs.northwind.example/limits): Quotas and headers
## Optional
- [Changelog](https://docs.northwind.example/changelog): Release notes
- [Blog](https://northwind.example/blog): Product stories
Notes after the colon are optional but useful. Put skippable content under ## Optional.
Step 5 — Validate
Open the llms.txt Validator:
- Paste the full file, or use Fetch URL once it is on staging.
- Fix every error (missing H1, list items without links,
###headings). - Fix warnings when practical (relative URLs, missing summary, huge size).
- Confirm stats: sections, absolute link count, Optional detected.
Step 6 — Deploy to the root
Copy the file to the web root of your host:
- Static hosts:
public/llms.txtorstatic/llms.txt - WordPress: often theme root or a plugin that serves root files
- Cloudflare Pages / Netlify / Vercel: include in the published output directory
Ensure it is not blocked in robots.txt. You can still mention the path; just do not Disallow /llms.txt under User-agent: *.
Ideal response headers when you control them:
Content-Type: text/plain; charset=utf-8
Step 7 — Verify live
curl -sS -D- https://yourdomain.com/llms.txt -o /tmp/llms.txt | head
You want HTTP 200 and a body that starts with # . Then run Fetch URL in the validator against your production domain.
Step 8 — Maintain
- Re-check after doc migrations so links do not 404
- Keep size sane; grow long text in llms-full.txt
- Align crawler blocks separately with the robots.txt Generator
Starter template
# Your Product Name
> One or two sentences: what you sell and who it is for.
How agents should use this file: prefer Docs first; treat Optional as background.
## Docs
- [Getting Started](https://example.com/docs/start): First successful setup
- [Core Concepts](https://example.com/docs/concepts): Mental model of the product
## API
- [Reference](https://example.com/docs/api): Endpoints and schemas
## Optional
- [Status](https://status.example.com/): Uptime and incidents
- [Blog](https://example.com/blog): Announcements
Paste this into the validator, swap in your URLs, and publish. For tone, size, and section-naming tips beyond the minimum, continue with llms.txt best practices.