# How to create an llms.txt file

> A practical, step-by-step guide to writing a spec-compliant llms.txt file: the H1 title, summary, sections, links, and where to host it.

An llms.txt file takes about ten minutes to write. This guide walks through every part, in order, and ends with a file you can paste and adapt.

## 1. Start with the H1 title

The first line must be a single H1 — the name of your project or site. It is the *only* strictly required element of the format.

```
# Acme Docs
```

## 2. Add a blockquote summary

Right under the title, add a one- or two-sentence blockquote. This is the context a language model reads first, so make it specific: what the site is and who it's for.

```
> Acme is a payments API. This file links to the docs an LLM needs to integrate and debug Acme.
```

## 3. (Optional) Add a few lines of prose

Before any section heading you may add plain paragraphs with extra orientation. Don't use headings here — keep it to a sentence or two.

## 4. Group your links under H2 sections

Each section is an H2 heading followed by a markdown list. Every item is a link with an optional description after a colon.

```
## Docs

- [Quickstart](https://acme.com/docs/quickstart): Integrate in five minutes
- [API reference](https://acme.com/docs/api): Every endpoint and parameter

## Examples

- [Sample app](https://acme.com/examples/app): A working end-to-end example
```

Use **absolute https URLs**, and keep descriptions focused on what a developer or model needs — not marketing copy.

## 5. Use the "Optional" section for nice-to-haves

A section named `## Optional` is the convention for secondary information — links an agent can skip when a shorter context is needed. Put changelogs, blog posts, and secondary references here.

## 6. Host it at the root — or at the path it covers

Serve the file at `https://yourdomain.com/llms.txt` with `Content-Type: text/plain`. It can also live at a subpath, covering the pages under it: `/docs/llms.txt` describes everything in `/docs/`, and agents prefer the most specific file that applies (see [what changed in spec v2](/guide/llms-txt-v2-what-changed)). Large sites often also publish a [llms-full.txt](/guide/llms-full-txt) with the full expanded content.

## 7. Let pages point at it

So agents don't have to guess the URL, advertise the file from your pages with `<link rel="describedby" href="/llms.txt">` — or the equivalent `Link:` response header, which you can set once in your CDN config.

## 8. Validate before you ship

Paste your domain into the [validator](/). It checks the structure, confirms every link actually resolves, and lists exactly what to fix. Aim for 100/100.
