SR
Usage

Headless

API endpoints for serving LLMify Markdown from a headless frontend.


When your frontend is rendered by a separate app (Nuxt, Next, Astro, …) instead of Craft, enable headlessMode. LLMify then generates Markdown by fetching your front-end URLs and exposes it through the API endpoints below, so your frontend can pull the content and re-serve it under its own domain.

Note

The auto-serve, bot detection and discovery-tag features rely on Craft rendering the frontend and are disabled in headless mode. Your frontend is responsible for serving llms.txt, the .md pages and the discovery tag. See the example implementation.

Authentication

The API is only available while headlessMode is enabled, otherwise every endpoint returns 403.

Protection with a token is optional:

  • No token configured (default): the endpoints are reachable without authentication. The content they expose (llms.txt, page Markdown) is public anyway.
  • Token configured via the apiToken setting: every request must send it in the X-Llmify-Token header. Requests with a missing or wrong token return 403.
curl -H "X-Llmify-Token: <your-token>" \
  "https://cms.example.com/actions/llmify/api/llms-txt"

llms.txt

Returns the llms.txt content for a site.

GET /actions/llmify/api/llms-txt?site=<handle|id>
ParameterRequiredDescription
siteNoSite handle or id. Defaults to the primary site.

Responses

StatusMeaning
200text/markdown body
400Unknown site
404No content available for the site
curl "https://cms.example.com/actions/llmify/api/llms-txt?site=default"

llms-full.txt

Returns the llms-full.txt content for a site. Identical interface to llms.txt.

GET /actions/llmify/api/llms-full-txt?site=<handle|id>
curl "https://cms.example.com/actions/llmify/api/llms-full-txt?site=default"

page

Returns the pre-generated Markdown for a single page, identified by its URI. The response includes front matter, and only pages whose section is enabled are served. This is the recommended way to serve individual .md files, as it reads the stored Markdown without re-converting.

GET /actions/llmify/api/page?uri=<uri>&site=<handle|id>
ParameterRequiredDescription
uriYesThe Craft URI of the page, e.g. blog, news/my-post. The home page is stored under __home__.
siteNoSite handle or id. Defaults to the primary site.

Responses

StatusMeaning
200text/markdown body (with front matter)
400Missing uri or unknown site
404No Markdown stored for the URI
curl "https://cms.example.com/actions/llmify/api/page?uri=blog&site=default"

convert

Fetches a front-end URL and returns its converted Markdown on the fly, without persisting it or adding front matter. Use this for ad-hoc conversion; prefer page for serving stored pages.

POST /actions/llmify/api/convert
Content-Type: application/json

{ "url": "https://www.example.com/blog/my-post" }
ParameterRequiredDescription
urlYesThe front-end URL to fetch and convert.
Caution

The target url must resolve to one of your configured site Base URL hosts (SSRF guard). Other hosts return 403.

Responses

StatusMeaning
200text/markdown body
400Missing or invalid url
403url host is not an allowed site host
404URL could not be fetched
405Method other than POST
curl -X POST "https://cms.example.com/actions/llmify/api/convert" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.example.com/blog/my-post"}'

Example Implementation

The llmify-headless-showcase repository shows a complete Nuxt integration: server routes that proxy llms.txt / llms-full.txt, serve individual .md pages via the page endpoint, and inject the discovery <link> tag.


Copyright © 2026 Samuel Reichör