DocScout
01AUDIT02DIMENSIONS03PRICING04INDEX05GUIDE
FREE AUDIT →
Guide

Make your API docs agent-ready (2026)

A practical checklist for API documentation that AI agents and coding assistants can actually read, with a curl command to verify each item. Data comes from the DocScout Agent-Readiness Index 2026, which audited 78 public API docs on October 10–11, 2026.

Published 2026-10-11 · DocScout · ~10 min read

Why it matters

More developers now meet an API through an assistant first, whether that's Cursor, Claude Code, Codex, ChatGPT, or an agent wiring up an integration on its own. These tools don't browse like people. They fetch a URL, often without running JavaScript, cut the text to fit a context window, and then write code from what they got.

Most docs fail agents in a few common ways: the page renders client-side, the useful content is buried under navigation markup, the examples don't match the real API, or the reference points at pages that no longer exist. When that happens the assistant fills the gaps with guesses: a parameter that doesn't exist, an endpoint from an old version. Your users then file the bug against your API.

The good news is that most fixes are cheap, and they help humans and search engines too.

What we found in 78 public API docs

We ran the same version of the free DocScout audit on 78 widely used API docs: the 30 sites from our original benchmark plus 48 developer-tool companies. Each audit reads one entry URL, the site's llms.txt, and up to eight linked pages. The methodology explains what is deterministic and what is model-scored.

Signal (deterministic check) Sites Share
Publishes /llms.txt 65 / 78 83%
Publishes /llms-full.txt 35 / 78 45%
OpenAPI spec discoverable (site or company GitHub) 59 / 78 76%
All three of the above 29 / 78 37%
At least one sampled page unreadable without JavaScript 22 / 78 28%
At least one broken same-host link in the sampled pages 19 / 78 24%

A few patterns stand out:

  • llms.txt is mainstream, llms-full.txt isn't. 30 sites (38%) publish an llms.txt but no llms-full.txt, so an agent that wants the whole reference still has to crawl page by page.
  • Specs exist but are hard to find. Of the 59 sites where we found an OpenAPI spec, 12 were found only on the company's GitHub, not linked from or served by the docs site.
  • The weakest dimensions are code examples and freshness. Across the index, model-scored averages were 64/100 for code examples and 64/100 for freshness and versioning, against 76 for structure.
  • JavaScript-only reference pages hurt the most. Five sites had mostly unreadable pages and are flagged as "mostly JS-rendered" in the index. They include the two lowest scores. Their content may be excellent, but a client without a browser gets an empty shell.

The scores are estimates of agent-readiness, not a judgment of the APIs themselves. Several of the lowest-ranked docs are very good for humans in a browser.

The checklist

Each item has the reason it matters, what good looks like, and a command to check it. Replace docs.example.com with your docs host.

1. Publish /llms.txt (and /llms-full.txt)

llms.txt is a proposed convention: a markdown file at the site root with an H1 title, a short blockquote summary, and sections of links to the pages that matter, each with a one-line description. It gives agents a curated map instead of making them guess from your navigation. llms-full.txt is the companion file many sites publish with the full text of the docs in one file.

What good looks like:

  • It starts with # Product name, followed by a > summary.
  • Links point to markdown versions of pages where you have them (see item 2), with descriptions that tell an agent when to read each page.
  • It covers your real reference: authentication, errors, pagination, rate limits and every resource. A curated subset is fine, but it shouldn't miss whole sections.
  • It returns text/plain or text/markdown, not an HTML 404 page with status 200.

Verify:

curl -sI https://docs.example.com/llms.txt | grep -iE "^HTTP|content-type"
curl -s  https://docs.example.com/llms.txt | head -20
curl -sI https://docs.example.com/llms-full.txt | grep -iE "^HTTP|content-type"

A common failure: docs that mention an llms.txt but serve a 404 at that path. One large platform in our index links to /llms.txt from its developer pages, and the file returns 404. Check the exact URL you advertise.

2. Serve markdown versions of pages

HTML pages carry navigation, cookie banners, scripts and footers. On one docs site in our index, the rendered page was over 44,000 characters, mostly navigation, while the markdown version of the same page was about 13,700 characters of actual content. Agents truncate long inputs, so the chrome can push out the content entirely.

Two widely used patterns:

  • A .md URL for every page, e.g. /api/charges → /api/charges.md. Stripe and Railway both serve this. Many docs platforms (Mintlify, Fern, some Docusaurus setups) can generate it.
  • Content negotiation: return markdown when the request sends Accept: text/markdown, and include Vary: Accept so caches don't mix the two versions (see MDN on Vary).

Also advertise it in the HTML: <link rel="alternate" type="text/markdown" href="/api/charges.md">.

Verify:

curl -sI https://docs.example.com/api/charges.md | grep -iE "^HTTP|content-type"
curl -s -D - -o /dev/null -H "Accept: text/markdown" https://docs.example.com/api/charges | grep -iE "content-type|vary"

You want 200, content-type: text/markdown, and vary: Accept on the negotiated response.

3. Publish your OpenAPI spec, and link it

An OpenAPI document is the most precise thing you can give an agent: every path, method, parameter, type and response, in a format tools can load directly. Many companies maintain one for SDK generation but never link it from the docs.

What good looks like:

  • Served from the docs or API host at a stable URL (/openapi.json or /openapi.yaml are the most guessable).
  • Linked from the API reference, from llms.txt, and from the HTML head with <link rel="service-desc" href="/openapi.json">.
  • Optionally listed in an RFC 9727 API catalog at /.well-known/api-catalog.
  • Complete. A spec that covers half the endpoints teaches agents that the other half doesn't exist.

GraphQL APIs: publish the schema (SDL or introspection result) at a stable URL and link it the same way.

Verify:

for p in /openapi.json /openapi.yaml /.well-known/api-catalog; do
  printf "%s " "$p"; curl -s -o /dev/null -w "%{http_code} %{content_type}\n" "https://docs.example.com$p"
done
curl -s https://docs.example.com/llms.txt | grep -iE "openapi|swagger"

4. Make code examples match the spec

Agents copy examples. If an example uses a renamed parameter, an old path, or a JSON body with a trailing comma, the agent reproduces the bug. In our index, code examples were the lowest-scoring dimension together with freshness: 64/100 on average.

What good looks like:

  • Every endpoint page has at least one complete request (curl plus one or two SDK languages) and a real response.
  • Code blocks have language tags (```bash, ```python), so tools can tell code from prose.
  • Examples are generated from, or tested against, the spec in CI: the method, path and parameter names match, and JSON bodies parse.
  • Examples include error handling for the cases users actually hit (401, 404, 429).

Verify (a quick sanity check, not a full test):

# Every path used in curl examples on a page should exist in the spec
curl -s https://docs.example.com/api/charges.md | grep -oE "curl[^\n]*https://api\.example\.com[^ \"']*" | sort -u
curl -s https://docs.example.com/openapi.json | jq -r '.paths | keys[]' | head -50

The DocScout Fix Report does this check across your whole site: it parses curl, JavaScript and Python snippets and compares methods, paths, parameters and JSON bodies with your spec.

5. Document errors so agents can recover

Agents retry, back off and fix their input based on what your error docs say. "400 Bad Request" with no detail leaves them guessing.

What good looks like:

  • A single errors page that lists every status and machine-readable error code, what causes it, and how to fix it.
  • The error response format documented with an example. RFC 9457 problem details is a good standard to adopt.
  • Rate limits stated as numbers, with the headers you return (Retry-After, remaining quota) and a retry example.
  • Authentication explained end to end: where to get a key, which header to use, what an expired or wrong key returns.

Verify:

curl -s https://docs.example.com/llms.txt | grep -iE "error|rate limit|auth"
curl -s -i https://api.example.com/v1/does-not-exist | head -20   # is the error body documented?

6. Render content on the server

28% of the sites in our index had at least one sampled page that returned little or no text without JavaScript. To a fetcher that doesn't run a browser, which describes many agents and most crawlers, a client-rendered reference page is empty.

What good looks like: the HTML response already contains the headings, parameter tables and code samples. Static generation or server-side rendering both work. Interactive explorers are fine as long as the plain content is in the HTML too.

Verify:

# Should print real content (endpoint names, parameters), not just a loading shell
curl -sL -A "Mozilla/5.0" https://docs.example.com/api/charges | sed -e 's/<[^>]*>//g' | tr -s ' \n' | head -c 1500

If the output is mostly script tags or "Loading…", agents see the same thing.

7. No broken links or soft 404s

24% of sites had at least one broken same-host link among the handful of pages we sampled, and the real number across a full site is usually higher. Agents follow links literally. A link to a moved page that returns 404, or that redirects to a generic "page not found" with status 200 (a soft 404, see Google's documentation on HTTP errors), sends them to a dead end and wastes context.

What good looks like:

  • Moved pages return a 301 to the new location, and removed pages return a real 404.
  • Raw hrefs in the server-rendered HTML resolve, not just the ones your client-side router rewrites. Several sites in our index had links that work when clicked in the app but return 404 when fetched directly.
  • A link checker runs in CI against the built site.

Verify:

# Status of every same-host link on one page
curl -sL https://docs.example.com/api | grep -oE 'href="/[^"#]*"' | cut -d'"' -f2 | sort -u | \
  while read p; do printf "%s %s\n" "$(curl -s -o /dev/null -w "%{http_code}" "https://docs.example.com$p")" "$p"; done | grep -v "^200"
# Soft 404: a nonsense URL must return 404, not 200
curl -s -o /dev/null -w "%{http_code}\n" https://docs.example.com/this-page-does-not-exist-xyz

8. Version and date everything

Agents are trained on snapshots, and your docs are their best chance to see what changed. Freshness and versioning averaged 64/100 in our index, tied with code examples for the lowest score.

What good looks like:

  • The current API version is visible on reference pages and in the spec's info.version.
  • A changelog with dated entries, ideally in a consistent format such as Keep a Changelog, linked from llms.txt.
  • Deprecations name the replacement and the removal date.
  • Pages show a "last updated" date.

Verify:

curl -s https://docs.example.com/openapi.json | jq -r '.info.version'
curl -s https://docs.example.com/llms.txt | grep -iE "changelog|release notes|versioning"

Quick reference

# Item One-line check
1 llms.txt + llms-full.txt curl -sI <host>/llms.txt returns 200 and text
2 Markdown pages <page>.md or Accept: text/markdown returns markdown + Vary: Accept
3 OpenAPI published and linked <host>/openapi.json returns 200 and is referenced in llms.txt
4 Examples match the spec paths in curl examples ⊆ `jq '.paths
5 Error docs one errors page, all codes, recovery steps, rate limits as numbers
6 Server-rendered curl output contains real content
7 No broken links / soft 404s nonsense URL returns 404; no non-200 internal links
8 Versioning info.version set; dated changelog linked

Check your docs in a minute

You can run all of the checks above by hand with the commands in this guide. Or run the free DocScout audit on your docs URL. It runs the deterministic checks (llms.txt, llms-full.txt, OpenAPI discovery across your site and GitHub, live link checks, readability without JavaScript) and returns a score across six dimensions plus the top three issues, each with evidence. No signup.

When you're happy with the result, add the agent-ready badge to your docs or README. It shows your latest score and links to your audit.

For a full-site version, the Fix Report crawls 50–200 pages, validates every code example against your spec, and gives you a prioritized fix list with copy-ready prompts for Cursor, Claude Code and Codex.

Sources

  • llms.txt proposal: llmstxt.org
  • OpenAPI Specification 3.1.0: spec.openapis.org/oas/v3.1.0
  • RFC 9727, api-catalog: rfc-editor.org/rfc/rfc9727
  • RFC 9457, Problem Details for HTTP APIs: rfc-editor.org/rfc/rfc9457
  • HTTP Vary header: MDN
  • Soft 404s: Google Search Central, HTTP status codes and network errors
  • Changelog format: Keep a Changelog 1.1.0
  • Data: DocScout Agent-Readiness Index 2026 (JSON), audited October 10–11, 2026
DocScout

LLM-readiness audits for API documentation.

ProductFree auditPricingFix Report
LegalTerms of ServicePrivacy PolicyRefund Policy
Contacthola@getdocscout.comContact pageAgent-Readiness IndexGuide: agent-ready docsAboutAPI reference
© 2026 DocScoutGETDOCSCOUT.COM