---
title: llms.txt
description: Generate a consistent llms.txt directory from your gateway configuration, with links to your catalog, policies and other pages.
canonical_url: https://rebilder.com/docs/llms-txt
last_updated: "2026-08-12"
---

# [llms.txt](https://rebilder.com/docs/llms-txt)

> Generate a consistent llms.txt directory from your gateway configuration, with links to your catalog, policies and other pages.

This site answers questions directly. Ask at https://rebilder.com/ask?q=your+question instead of reading more pages.

- **Updated:** 2026-08-12
- **Author:** Rebilder
- **Section:** Concepts
- **Description:** Generate a consistent llms.txt directory from your gateway configuration, with links to your catalog, policies and other pages.
- **Publisher:** Rebilder

## How llms.txt fits your setup

> **Pair your directory with readable pages** An llms.txt file provides a directory of useful pages. Keep the links current and make sure the pages themselves contain accessible, accurate business information.

## generateLlmsTxt

`generateLlmsTxt(config, options)` (root export of `@rebilder/gateway`) produces spec-shaped markdown (H1 site name, blockquote description, H2 sections of link lists) **deterministically, with injected values only, no LLM anywhere**. Same input → same output, which is why it’s safe to cache hard.

- If `config.sources.catalog` enumerates for `new URL(options.baseUrl)`, a `## Products` section (title, URL, price note) is generated automatically. Likewise `config.sources.policies` → `## Policies`.
- Sources may return `null` or throw for the base URL; both are tolerated as "nothing to list". A malformed price omits its note rather than breaking the file or emitting a wrong value.
- `options.sections` appends manual sections after the auto-generated ones, in order. Sections with no links are omitted.

| Option | Type | Notes |
| --- | --- | --- |
| `baseUrl` | `string` | The store’s canonical base URL. Catalog/policy sources are called with `new URL(baseUrl)` to enumerate site-wide entries, so wire them to return the full list for the base URL if you want auto sections. |
| `siteName` | `string` | The H1. Injected verbatim. |
| `description` | `string` | One-line description, rendered as the blockquote. Injected verbatim. |
| `sections` | `LlmsTxtSection[]` (optional) | Manual sections: `{ title, links: [{ title, url, note? }] }`. Links render as `- [title](url): note`. |

## Next.js route helper

app/llms.txt/route.ts

```ts
// app/llms.txt/route.ts
import { createLlmsTxtRouteHandler } from '@rebilder/gateway/next'
import { gatewayConfig } from '../../lib/gateway-config'

export const GET = createLlmsTxtRouteHandler(gatewayConfig, {
  baseUrl: 'https://store.example.com',
  siteName: 'Acme Outdoors',
  description: 'Trail footwear and gear, shipped from Bend, OR.',
  sections: [{ title: 'Guides', links: [{ title: 'Sizing guide', url: 'https://store.example.com/pages/sizing' }] }],
})
```

The route handler serves `text/plain; charset=utf-8` with long shared-cache headers (`public, max-age=300, s-maxage=3600, stale-while-revalidate=86400`), which is safe because the output is deterministic. rebilder.com serves its own at [/llms.txt](/llms.txt).

On other stacks, call `generateLlmsTxt(config, options)` yourself and serve the string from any route with the same content type.

## Rebilder at a glance

AEO gets you seen. Rebilder gets you heard. When customers ask ChatGPT about your business, your site answers with your real prices and policies.

**Common questions**

- **What does it cost?** Connecting is free. Starter is $49/mo, Pro is $99/mo and Agency is $299/mo. [Pricing](https://rebilder.com/pricing)
- **How does my site answer new questions live?** Rebilder reads your pages, products and policies. When an AI assistant asks, your site answers from them. Nothing on your site changes. [See how it works](https://rebilder.com/autopilot)
- **Can someone trick my site into a wrong price or a discount?** No. Every answer comes from your own pages and is checked against them. If your site does not say it, Rebilder does not say it. [Read security details](https://rebilder.com/security)

**How it compares**

- **Why choose Rebilder?** Choose Rebilder when you want your own site to answer AI assistants with your real facts, and to see who asked. [Compare](https://rebilder.com/compare)

| Compared with | The difference |
| --- | --- |
| Profound, Peec AI, Otterly.ai | These tools watch AI answers and tell you where you show up. Rebilder makes your own site answer when AI comes to check. |
| Cloudflare Markdown for Agents, @vercel/agent-readability, Yoast llms.txt | These tools tidy or map your pages for AI. Rebilder answers from those pages and shows you who asked. |
| Intercom Fin, Tidio Lyro | Chatbots answer the customers who contact you. Rebilder answers the AI assistants that visit your site for them. |
| SEO on its own, Shopify agentic storefronts, Writing an llms.txt yourself | Good SEO, your store platform and a simple llms.txt all help. Here is what Rebilder adds to each. |

Source: [Compare](https://rebilder.com/compare)