# Generate

Generate `llms.txt` and/or `llms-full.txt` for any public website.

Prefer a UI? Generate in the free web [llms.txt generator](/generator) — no API key needed.

```text
POST /api/v1/generate
```

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `url` | string | yes | The site to generate from. A bare domain (`example.com`) or full URL. |
| `fileType` | string | no | `"llms"`, `"llms-full"`, or `"both"`. Defaults to `"both"`. |
| `instructions` | string | no | Guidance to embed in the file's "Instructions for LLM Agents" block. |

```bash
curl https://llms-txt.io/api/v1/generate \
  -X POST \
  -H "x-api-key: $LLMSTXT_KEY" \
  -H "content-type: application/json" \
  -d '{
    "url": "https://example.com",
    "fileType": "both",
    "instructions": "Always link to /docs before answering setup questions."
  }'
```

## Response

```json
{
  "url": "https://example.com",
  "domain": "example.com",
  "fileType": "both",
  "llmsTxt": "# Example\n\n> A one-line summary…",
  "llmsFullTxt": "# Example\n\n## Page title\n…",
  "llmEnhanced": true,
  "note": null
}
```

| Field | Description |
| --- | --- |
| `llmsTxt` | The concise index file (null if you only asked for `llms-full`). |
| `llmsFullTxt` | The full concatenated markdown (null if you only asked for `llms`). |
| `llmEnhanced` | Whether AI wrote the summary and link descriptions. |
| `note` | Any caveat about the run (e.g. a plan downgrade — see below). |

## How it works

The endpoint runs the full pipeline server-side in one request: it discovers your pages (sitemap, navigation), crawls the important ones, and — when enabled — uses a model to write a grounded summary and per-link descriptions. `llms-full.txt` is assembled from the cleaned page text.

::callout{type="note"}
Generation is **synchronous**: the request returns when both files are ready. Large sites can take up to a couple of minutes.
::

## Plan gating for llms-full.txt

`llms-full.txt` is available on **Starter and above**. On the Free plan:

- An explicit `"fileType": "llms-full"` returns **403** with an upgrade hint.
- The default `"both"` quietly degrades to `"llms"` and sets `note` explaining why.

### How many pages llms-full.txt includes

`llms-full.txt` inlines your documentation pages, and **how many it covers scales with your plan**:

| Plan | Pages in llms-full.txt |
| --- | --- |
| Free | — (API returns `llms.txt` only) |
| Starter | up to 50 |
| Pro | up to 100 |
| Business | up to 100 |

Pages are selected documentation-first (the index's docs and main sections, sorted for a coherent read), so the cap keeps the most relevant pages. Sites with fewer pages than the cap simply include everything they have.

## Errors

| Status | Meaning |
| --- | --- |
| `400` | Missing/invalid `url`, or an invalid `fileType`. |
| `401` | Missing or invalid API key. |
| `403` | `llms-full` requested on a plan without it. |
| `429` | Monthly quota or per-minute rate limit reached. |
| `403`/`500` | The target site blocked access or could not be reached. |

See [Rate limits & errors](/docs/api/rate-limits-and-errors) for quotas and headers.
