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.
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
apiTokensetting: every request must send it in theX-Llmify-Tokenheader. Requests with a missing or wrong token return403.
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>
Responses
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>
Responses
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" }
The target url must resolve to one of your configured site Base URL hosts (SSRF guard). Other hosts return 403.
Responses
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.