Developers

llms.txt Validator API

A free JSON API to validate an llms.txt, generate a starter file, and wire llms.txt checks into CI — the same engine that powers this site. No API key required.

Base URL & conventions

Validate a live URL

curl "https://llms-txt-validator.dev/api/validate?url=example.com&source=my-app"

Returns the full analysis:

{
  "ok": true,
  "target": "https://example.com/llms.txt",
  "report": {
    "scores": { "overall": 92, "structure": 100, "links": 88, "bestPractices": 90 },
    "findings": [ { "severity": "warning", "title": "…", "detail": "…", "recommendation": "…" } ]
  },
  "linkStats": { "total": 12, "ok": 11, "broken": 1, "redirect": 0, "skipped": 0 },
  "companions": [ { "name": "llms-full.txt", "present": true } ]
}

When the file is missing the response is { "ok": false, "missing": true } (a 0/100 verdict); an unreachable site returns { "error": "…" } with a status-aware message (e.g. a 429/403 explains a CDN/WAF block).

Validate pasted content (no fetch)

Validate a file you already hold — ideal for CI, before publishing:

curl -X POST "https://llms-txt-validator.dev/api/validate?source=my-ci" \
  --data-urlencode "content@llms.txt"

Accepts a content form field or a raw text/plain body (1 MiB cap). Same response shape as above.

Generate a starter file

curl "https://llms-txt-validator.dev/api/generate?url=example.com&source=my-app"

Returns { "input": "…", "content": "<scaffolded llms.txt>" } built from the homepage and sitemap, or { "input": "…", "error": "…" }. Always curate the result before publishing.

Use it in CI

Fail a build when your published llms.txt drops below a score threshold. Any CI system with curl and jq:

score=$(curl -fsS "https://llms-txt-validator.dev/api/validate?url=$SITE&source=ci" \
  | jq -r '.report.scores.overall // 0')
echo "llms.txt score: $score"
[ "$score" -ge 80 ] || { echo "below threshold"; exit 1; }

Or validate the file in your repo before it ships:

curl -fsS -X POST "https://llms-txt-validator.dev/api/validate?source=ci" \
  --data-urlencode "content@public/llms.txt" | jq '.report.scores.overall'

GitHub Actions

name: llms.txt
on: [push]
jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Validate llms.txt
        run: |
          score=$(curl -fsS -X POST \
            "https://llms-txt-validator.dev/api/validate?source=gh-actions" \
            --data-urlencode "content@public/llms.txt" \
            | jq -r '.report.scores.overall // 0')
          echo "score=$score"
          [ "$score" -ge 80 ] || exit 1

A ready-made composite action lives in the project repository under github-action/ if you prefer uses:.

Agent protocols

The same validator is callable by AI agents:

Validate a site →