Geodocs.dev

API Content Design for AI Consumption: Patterns for Reference Docs

ShareLinkedIn

Open this article in your favorite AI assistant for deeper analysis, summaries, or follow-up questions.

AI-ready API reference docs combine a complete OpenAPI spec, an llms.txt index, and Markdown pages built around canonical examples, exhaustive error tables, and explicit parameter schemas. The same surface should serve human developers and LLM agents through dual delivery — HTML for browsers, plain Markdown for crawlers and tool-calling agents.

TL;DR. Design API reference docs as machine-first content with a thin presentation layer. Ship an OpenAPI 3.1 spec, an llms.txt index, and per-endpoint Markdown pages that lead with a canonical request/response example, follow with a typed parameter table, and end with an exhaustive error code table. Serve .md siblings or use content negotiation so AI agents pull tokens, not pixels. (Fern, 2026; Speakeasy)

Why API docs are the highest-leverage AI content you own

AI agents have become a top consumer of API documentation. Tollbit reported that traffic from retrieval-augmented generation (RAG) bots surged 49% in early 2025, and agent traffic is now growing alongside human developer traffic. (The New Stack, 2025) Every time Cursor, Claude, ChatGPT, or Perplexity answers a question like "how do I authenticate against the X API?" it is reading a reference page, an OpenAPI schema, or an llms.txt index — not a marketing page.

For a docs team, this changes the brief. A reference page must now satisfy three readers simultaneously:

  1. A human developer scanning for a code sample.
  2. An IDE assistant (Cursor, Copilot, Continue) pulling structured context into a tool call.
  3. A retrieval system (Perplexity, ChatGPT search, Gemini, Claude with web access) extracting a snippet to cite.

If any one of those readers gets a worse experience than the other two, you lose citations, you lose generated-code accuracy, and — most expensively — agents start hallucinating endpoints that do not exist. (Fern, 2026)

The three-layer model for AI-consumable API docs

Think of AI-ready API content as three stacked layers, each strictly machine-readable, each citable on its own:

LayerFormatPrimary consumerWhy it matters
Spec layerOpenAPI 3.1 / JSON SchemaTool-calling agents, SDK generatorsUnambiguous types, enums, constraints
Index layerllms.txt, sitemap.xml, RSSCrawlers, RAG indexersDiscoverability, prioritization
Narrative layerMarkdown reference pagesHumans + LLM extractorsCitation-ready prose, examples, errors

Each layer must stay synchronized with the others. Drift between the OpenAPI spec and the Markdown reference is the single biggest cause of agent hallucinations, because agents that fall back to prose then "correct" generated code against stale parameter names. (buildwithfern.com)

Pattern 1 — Lead every endpoint with a canonical example

LLMs anchor on the first concrete artifact they see. If the first thing on /messages.create is a paragraph, the model summarizes; if the first thing is a request and a 200 response, the model imitates.

Recommended block order for every endpoint page:

  1. H1 with the endpoint verb + path: POST /v1/messages
  2. One-sentence purpose line (the canonical_question answered).
  3. Canonical request in the most common SDK language, plus a raw curl block.
  4. Canonical 200 response as a complete JSON object.
  5. Parameter table.
  6. Returned object schema.
  7. Error code table with code, http_status, description, recovery.
  8. "Common patterns" section (idempotency keys, pagination, retries).
  9. Related endpoints.

Keep examples self-contained. Every value in a request body must either be a literal or appear in a previous example on the same page — agents cannot follow reliably during a single retrieval pass. (docsbydesign.com, 2026)

Pattern 2 — Make parameter schemas exhaustive, not minimal

The MCPify and Speakeasy guidance converges on one rule: never let an LLM guess a type or an enum. (MCPify, 2026; Speakeasy)

For every parameter, document:

  • Type (string, integer, boolean, array, object).
  • Required vs optional, with the default if optional.
  • Format (uuid, iso8601, email, uri).
  • Constraints (min, max, pattern, enum).
  • Effect on the response ("if expand=author, the response includes author as a nested object").
  • Side effects ("setting dry_run=true does not consume credits").

Expose the same information in three places: in the OpenAPI spec, in a Markdown table on the reference page, and — when you generate llms.txt — as a flattened key/value list. Triplication is intentional; each consumer prefers a different surface, and each surface raises citation rate by ~10-20% in retrieval evaluations of API docs. (Fern, 2026)

Pattern 3 — Treat errors as first-class content

Generic error pages destroy agent reliability. When a model receives 400 Bad Request: invalid input, it has no recovery path. When it receives 400 invalid_recipient: recipient must be an E.164-formatted phone number; check the to field, it can self-correct on the next call.

Design every endpoint with an error table that LLMs can lift into a structured-output schema:

error_codehttp_statusWhen it firesRecovery action
invalid_recipient400to is not E.164Reformat number; retry
rate_limited429Burst over 60 req/minBackoff per Retry-After
auth_expired401API key expiredRefresh key; retry

Keep the table on the endpoint page and in the OpenAPI responses section with x-error-codes extensions. Models trained on documentation pairs use both. (nibzard/awesome-agentic-patterns)

Pattern 4 — Ship a complete OpenAPI 3.1 spec, not a sampler

OpenAPI is the de facto bridge between APIs and tool-calling LLMs. Frameworks from SnapLogic to Gravitee to Samchon's @samchon/openapi convert OpenAPI definitions directly into LLM function-calling schemas. (SnapLogic; Gravitee, 2025)

The quality bar for an LLM-grade OpenAPI document:

  • Operation IDs are verb-noun and unique (createMessage, not post_messages_v1).
  • Every operation has a one-sentence summary and a multi-sentence description.
  • Every parameter has a description and an example value.
  • All enum values are documented inline.
  • requestBody and responses reference shared components.schemas, not inline anonymous objects.
  • x-codeSamples includes ≥3 SDK languages.
  • servers lists production and sandbox URLs explicitly.

Validate continuously. Spec drift is the most common cause of generated SDK breakage and of agent code that compiles but 404s. (buildwithfern.com)

Pattern 5 — Publish an llms.txt index for the API

llms.txt is the emerging convention for telling AI tools where to find canonical content. For an API, your root llms.txt should:

  • Link to the OpenAPI spec URL as a first-class entry.
  • Link to per-endpoint Markdown versions (one URL per operation).
  • Link to a flat "all endpoints" Markdown bundle for small APIs (< 200 KB compressed).
  • Include a ## Authentication section with auth flow, scopes, and a working example request.
  • Include a ## Errors section listing every error code in the API.

Regenerate llms.txt on every breaking change. Outdated authentication flows or removed endpoints make AI tools suggest non-functional code, which is the failure mode users blame on the API, not on the docs. (Fern, 2026)

Pattern 6 — Serve dual surfaces: HTML for humans, Markdown for agents

Markdown is 80-90% more token-efficient than the equivalent HTML page. (Fern, 2026) Two production-grade patterns exist:

  • Sibling .md URLs. Every https://docs.example.com/api/messages has a sibling https://docs.example.com/api/messages.md. Cite the .md URL in llms.txt. This is the Svelte and Speakeasy pattern. (Svelte, via dev.to)
  • Content negotiation. The same URL serves HTML to browsers (Accept: text/html) and Markdown to AI clients (Accept: text/markdown). Fern auto-generates this; rolling your own requires only a CDN edge function.

Whichever you choose, ensure the Markdown surface contains the same canonical example, parameter table, and error table as the HTML surface — never a stripped-down version. Agents that fall back to HTML when Markdown is incomplete are unable to cite either.

Pattern 7 — Optimize for direct citation, not pageviews

On AI search engines, the unit of value is not a session — it is a citation. Direct-citation patterns for API docs:

  • Stable URLs forever. Never reorganize endpoint paths in docs. Use redirects, not deletions.
  • Heading anchors are the citation target. Use predictable anchors (#errors, #rate-limits, #pagination).
  • Each endpoint page has a unique and description. Avoid global titles like "API reference."</li> <li>Add Article or TechArticle JSON-LD with headline, dateModified, author, and about.</li> <li>Date every page. AI engines downweight undated technical content during freshness ranking.</li> </ul> <p>These signals are the same ones that lift documentation in Perplexity and ChatGPT search results, and they map directly to the GEO citation_readiness: reviewed standard.</p> <h2 id="anti-patterns-to-remove-from-your-reference-docs">Anti-patterns to remove from your reference docs</h2> <ul> <li>Tabs that hide languages. A tabbed Python/JS/curl widget renders as one language to most crawlers; expose all three as visible code blocks.</li> <li>"Try it" widgets without static fallbacks. If the canonical request lives in a JS widget, it is invisible to retrieval.</li> <li>Marketing copy on reference pages. "Lightning-fast," "developer-first," and "world-class" cost tokens and dilute extraction.</li> <li>Fragmented authentication docs. Every endpoint page should restate, in two sentences, how to authenticate, with a link to the canonical auth page.</li> <li>Numeric error codes without slugs. error: 1027 is unparseable; error: invalid_recipient (1027) is.</li> <li>Implicit defaults. "Defaults to a reasonable value" is the worst phrase in API docs. Always state the literal default.</li> </ul> <h2 id="quality-checklist-before-publishing-an-endpoint-page">Quality checklist before publishing an endpoint page</h2> <ul> <li>[ ] H1 includes verb and path.</li> <li>[ ] First non-heading block is a complete request example.</li> <li>[ ] Second block is a complete 200 response.</li> <li>[ ] Parameter table includes type, required, default, constraints, example.</li> <li>[ ] Every enum value is listed and described.</li> <li>[ ] Error table covers every documented error_code.</li> <li>[ ] OpenAPI operationId matches the page URL slug.</li> <li>[ ] Markdown sibling (.md) is published and reachable.</li> <li>[ ] Page is listed in llms.txt.</li> <li>[ ] dateModified is current.</li> </ul> <h2 id="related-geodocs-references">Related Geodocs references</h2> <ul> <li>llms.txt Reference: Specification, Format, and Examples</li> <li>Markdown Optimization for AI Parsers</li> <li>AI Agent Content Specification</li> <li>JSON-LD for AI Search: Complete Guide</li> <li>Answer Format Patterns for AI Systems</li> </ul> <h2 id="faq">FAQ</h2> <h3 id="q-do-i-still-need-html-docs-if-i-publish-openapi-plus-markdown">Q: Do I still need HTML docs if I publish OpenAPI plus Markdown?</h3> <p>Yes. Human developers expect a navigable HTML reference, and search engines still rank HTML pages for long-tail discovery. Treat HTML as the presentation of the same Markdown source — never as a separate content surface. The OpenAPI + Markdown + HTML stack is a single pipeline, not three projects.</p> <h3 id="q-should-i-use-mcp-or-openapi-for-tool-calling-agents">Q: Should I use MCP or OpenAPI for tool-calling agents?</h3> <p>For most teams, OpenAPI first, MCP optional. OpenAPI already describes your API completely, integrates with every LLM provider's function-calling format, and works for both human developers and agents. MCP is useful when you want to expose stateful, agent-specific operations that do not exist in your public REST surface. (Bin Wang, 2025)</p> <h3 id="q-how-long-should-an-endpoint-reference-page-be">Q: How long should an endpoint reference page be?</h3> <p>For a typical CRUD endpoint, 400-900 words including code blocks. Long enough to include a canonical example, parameter table, error table, and one common pattern; short enough that an LLM can ingest the full page in a single retrieval chunk (≈ 4k tokens). Endpoints with rich behavior (webhooks, streaming, file upload) can run longer and should split into sub-pages.</p> <h3 id="q-how-often-should-i-regenerate-llms-txt">Q: How often should I regenerate llms.txt?</h3> <p>Regenerate on every release that changes endpoints, parameters, authentication, or error codes. For minor copy edits, a daily or weekly scheduled rebuild is sufficient. Test by loading the file into Cursor or Claude and asking specific questions about your API; if the answer is wrong, the file is wrong. (Fern, 2026)</p> <h3 id="q-how-do-i-measure-whether-ai-ready-api-docs-are-working">Q: How do I measure whether AI-ready API docs are working?</h3> <p>Track three metrics: citation rate (how often Perplexity, ChatGPT, and Gemini cite your reference pages for relevant queries), agent task success rate (have an internal eval that asks Claude or GPT-5 to perform 50 representative API tasks against your docs), and SDK accuracy (rate of compilable, runnable code generated by Cursor or Copilot from your docs). All three should be tracked monthly and compared against your last spec change.</p></div><div style="margin-top:64px"><h2 style="font-size:18px;font-weight:600;margin-bottom:16px;padding-bottom:8px;border-bottom:1px solid var(--border-default)">Related Articles</h2><div style="display:grid;grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));gap:16px"><a style="text-decoration:none" data-related-article="404-page-ai-crawler-handling" data-related-position="1" href="/technical/404-page-ai-crawler-handling"><div class="card"><span class="badge badge-green" style="margin-bottom:8px">guide</span><h3 style="font-size:15px;font-weight:600;color:var(--text-heading);margin-bottom:4px">404 Page AI Crawler Handling: Avoiding Citation Loss During Migrations</h3><p style="font-size:13px;color:var(--text-secondary);line-height:1.5">Migration playbook for keeping AI citations during URL changes — hard 404 vs soft 404, 410 Gone, redirect chains, sitemap cleanup, and refetch monitoring.</p></div></a><a style="text-decoration:none" data-related-article="accept-encoding-for-ai-crawlers" data-related-position="2" href="/technical/accept-encoding-for-ai-crawlers"><div class="card"><span class="badge badge-green" style="margin-bottom:8px">specification</span><h3 style="font-size:15px;font-weight:600;color:var(--text-heading);margin-bottom:4px">Accept-Encoding (Brotli, Gzip) for AI Crawlers</h3><p style="font-size:13px;color:var(--text-secondary);line-height:1.5">Specification for serving Brotli, gzip, and zstd to AI crawlers via Accept-Encoding negotiation: which bots support which codecs, fallback rules, and Vary handling.</p></div></a><a style="text-decoration:none" data-related-article="accept-language-and-ai-language-detection" data-related-position="3" href="/technical/accept-language-and-ai-language-detection"><div class="card"><span class="badge badge-green" style="margin-bottom:8px">specification</span><h3 style="font-size:15px;font-weight:600;color:var(--text-heading);margin-bottom:4px">Accept-Language and AI Language Detection</h3><p style="font-size:13px;color:var(--text-secondary);line-height:1.5">Specification for Accept-Language negotiation and html lang attribution that lets AI crawlers detect locale correctly without cross-locale citation leaks.</p></div></a></div></div></article><div style="padding-left:40px" class="toc-sidebar"><nav style="position:sticky;top:88px;font-size:13px;line-height:1.6;max-height:calc(100vh - 100px);overflow-y:auto"><div style="font-family:var(--font-mono);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:2px;color:var(--color-cool-gray);margin-bottom:12px">On this page</div><a href="#why-api-docs-are-the-highest-leverage-ai-content-you-own" style="display:block;padding:4px 0;padding-left:0;color:var(--text-secondary);text-decoration:none;transition:color 0.15s ease;border-left:none">Why API docs are the highest-leverage AI content you own</a><a href="#the-three-layer-model-for-ai-consumable-api-docs" style="display:block;padding:4px 0;padding-left:0;color:var(--text-secondary);text-decoration:none;transition:color 0.15s ease;border-left:none">The three-layer model for AI-consumable API docs</a><a href="#pattern-1-lead-every-endpoint-with-a-canonical-example" style="display:block;padding:4px 0;padding-left:0;color:var(--text-secondary);text-decoration:none;transition:color 0.15s ease;border-left:none">Pattern 1 — Lead every endpoint with a canonical example</a><a href="#pattern-2-make-parameter-schemas-exhaustive-not-minimal" style="display:block;padding:4px 0;padding-left:0;color:var(--text-secondary);text-decoration:none;transition:color 0.15s ease;border-left:none">Pattern 2 — Make parameter schemas exhaustive, not minimal</a><a href="#pattern-3-treat-errors-as-first-class-content" style="display:block;padding:4px 0;padding-left:0;color:var(--text-secondary);text-decoration:none;transition:color 0.15s ease;border-left:none">Pattern 3 — Treat errors as first-class content</a><a href="#pattern-4-ship-a-complete-openapi-3-1-spec-not-a-sampler" style="display:block;padding:4px 0;padding-left:0;color:var(--text-secondary);text-decoration:none;transition:color 0.15s ease;border-left:none">Pattern 4 — Ship a complete OpenAPI 3.1 spec, not a sampler</a><a href="#pattern-5-publish-an-llms-txt-index-for-the-api" style="display:block;padding:4px 0;padding-left:0;color:var(--text-secondary);text-decoration:none;transition:color 0.15s ease;border-left:none">Pattern 5 — Publish an llms.txt index for the API</a><a href="#pattern-6-serve-dual-surfaces-html-for-humans-markdown-for-agents" style="display:block;padding:4px 0;padding-left:0;color:var(--text-secondary);text-decoration:none;transition:color 0.15s ease;border-left:none">Pattern 6 — Serve dual surfaces: HTML for humans, Markdown for agents</a><a href="#pattern-7-optimize-for-direct-citation-not-pageviews" style="display:block;padding:4px 0;padding-left:0;color:var(--text-secondary);text-decoration:none;transition:color 0.15s ease;border-left:none">Pattern 7 — Optimize for direct citation, not pageviews</a><a href="#anti-patterns-to-remove-from-your-reference-docs" style="display:block;padding:4px 0;padding-left:0;color:var(--text-secondary);text-decoration:none;transition:color 0.15s ease;border-left:none">Anti-patterns to remove from your reference docs</a><a href="#quality-checklist-before-publishing-an-endpoint-page" style="display:block;padding:4px 0;padding-left:0;color:var(--text-secondary);text-decoration:none;transition:color 0.15s ease;border-left:none">Quality checklist before publishing an endpoint page</a><a href="#related-geodocs-references" style="display:block;padding:4px 0;padding-left:0;color:var(--text-secondary);text-decoration:none;transition:color 0.15s ease;border-left:none">Related Geodocs references</a><a href="#faq" style="display:block;padding:4px 0;padding-left:0;color:var(--text-secondary);text-decoration:none;transition:color 0.15s ease;border-left:none">FAQ</a><a href="#q-do-i-still-need-html-docs-if-i-publish-openapi-plus-markdown" style="display:block;padding:4px 0;padding-left:16px;color:var(--text-secondary);text-decoration:none;transition:color 0.15s ease;border-left:1px solid var(--border-default)">Q: Do I still need HTML docs if I publish OpenAPI plus Markdown?</a><a href="#q-should-i-use-mcp-or-openapi-for-tool-calling-agents" style="display:block;padding:4px 0;padding-left:16px;color:var(--text-secondary);text-decoration:none;transition:color 0.15s ease;border-left:1px solid var(--border-default)">Q: Should I use MCP or OpenAPI for tool-calling agents?</a><a href="#q-how-long-should-an-endpoint-reference-page-be" style="display:block;padding:4px 0;padding-left:16px;color:var(--text-secondary);text-decoration:none;transition:color 0.15s ease;border-left:1px solid var(--border-default)">Q: How long should an endpoint reference page be?</a><a href="#q-how-often-should-i-regenerate-llms-txt" style="display:block;padding:4px 0;padding-left:16px;color:var(--text-secondary);text-decoration:none;transition:color 0.15s ease;border-left:1px solid var(--border-default)">Q: How often should I regenerate llms.txt?</a><a href="#q-how-do-i-measure-whether-ai-ready-api-docs-are-working" style="display:block;padding:4px 0;padding-left:16px;color:var(--text-secondary);text-decoration:none;transition:color 0.15s ease;border-left:1px solid var(--border-default)">Q: How do I measure whether AI-ready API docs are working?</a></nav></div></div><style> @media (max-width: 1024px) { .toc-sidebar { display: none !important; } } @media (min-width: 1025px) { article { /* override grid for 3-col with TOC */ } } .article-tag-link:hover { border-color: var(--color-dark-green) !important; color: var(--text-primary) !important; background: rgba(0, 237, 100, 0.06) !important; } </style></main><section style="padding:64px 24px;background:var(--bg-surface);border-top:1px solid var(--border-subtle)"><div style="max-width:520px;margin:0 auto;text-align:center"><div style="font-family:var(--font-mono);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:2px;color:var(--color-dark-green);margin-bottom:12px">Stay Updated</div><h2 style="font-family:var(--font-display);font-size:clamp(1.25rem, 3vw, 1.75rem);font-weight:400;color:var(--text-heading);margin-bottom:8px;line-height:1.3">GEO & AI Search Insights</h2><p style="font-size:14px;color:var(--text-secondary);line-height:1.7;margin-bottom:24px">New articles, framework updates, and industry analysis. No spam, unsubscribe anytime.</p><form style="display:flex;flex-wrap:wrap;gap:8px;max-width:420px;margin:0 auto"><input type="email" placeholder="your@email.com" required="" style="flex:1;min-width:200px;padding:12px 16px;border-radius:var(--radius-pill);border:1px solid var(--border-default);background:var(--bg-page);color:var(--text-primary);font-family:var(--font-body);font-size:14px;outline:none;transition:border-color 0.2s ease" value=""/><button type="submit" class="btn btn-primary" style="padding:12px 24px;font-size:14px;opacity:1">Subscribe</button></form></div></section><footer style="background:var(--color-forest-black);border-top:1px solid var(--color-teal-gray);padding:64px 24px 32px"><div style="max-width:1200px;margin:0 auto"><div style="display:grid;grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));gap:48px;margin-bottom:48px"><div><div style="margin-bottom:16px"><img alt="Geodocs.dev" loading="lazy" width="140" height="32" decoding="async" data-nimg="1" style="color:transparent;height:24px;width:auto" src="/geodocs-logo-dark.svg"/></div><p style="font-size:13px;color:var(--color-cool-gray);line-height:1.6;max-width:220px">Structured knowledge for AI search visibility. The canonical reference for GEO, AEO, and AI search optimization.</p></div><div><h4 style="font-family:var(--font-mono);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:2px;color:var(--color-mongodb-green);margin-bottom:16px">Learn</h4><ul style="list-style:none;display:flex;flex-direction:column;gap:10px"><li><a class="footer-link" href="/geo/what-is-geo">What Is GEO?</a></li><li><a class="footer-link" href="/aeo/what-is-aeo">What Is AEO?</a></li><li><a class="footer-link" href="/geo/geo-vs-seo">GEO vs SEO</a></li><li><a class="footer-link" href="/reference/geo-aeo-glossary">GEO Glossary</a></li></ul></div><div><h4 style="font-family:var(--font-mono);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:2px;color:var(--color-mongodb-green);margin-bottom:16px">Build</h4><ul style="list-style:none;display:flex;flex-direction:column;gap:10px"><li><a class="footer-link" href="/technical/llms-txt">llms.txt Reference</a></li><li><a class="footer-link" href="/technical/how-to-create-llms-txt">Create llms.txt</a></li><li><a class="footer-link" href="/technical/structured-data-for-ai-search">Structured Data</a></li><li><a class="footer-link" href="/technical/ai-txt">ai.txt Reference</a></li></ul></div><div><h4 style="font-family:var(--font-mono);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:2px;color:var(--color-mongodb-green);margin-bottom:16px">Strategy</h4><ul style="list-style:none;display:flex;flex-direction:column;gap:10px"><li><a class="footer-link" href="/strategy/ai-visibility-measurement">AI Visibility</a></li><li><a class="footer-link" href="/strategy/geo-content-strategy">Content Strategy</a></li><li><a class="footer-link" href="/strategy/geo-roi-framework">GEO ROI</a></li><li><a class="footer-link" href="/aeo/aeo-content-checklist">AEO Checklist</a></li></ul></div><div><h4 style="font-family:var(--font-mono);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:2px;color:var(--color-mongodb-green);margin-bottom:16px">Resources</h4><ul style="list-style:none;display:flex;flex-direction:column;gap:10px"><li><a class="footer-link" href="https://github.com/Geodocs-dev">GitHub</a></li><li><a class="footer-link" href="/contact">Contact</a></li><li><a class="footer-link" href="/tags">Tags</a></li><li><a class="footer-link" href="/sitemap.xml">Sitemap</a></li><li><a class="footer-link" href="/llms.txt">llms.txt</a></li><li><a class="footer-link" href="/ai.txt">ai.txt</a></li></ul></div></div><div style="border-top:1px solid var(--color-teal-gray);padding-top:24px;display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:16px"><p style="font-size:12px;color:var(--color-cool-gray)">© <!-- -->2026<!-- --> Geodocs.dev. <!-- -->All rights reserved.</p><p style="font-size:12px;color:var(--color-cool-gray)"><a href="mailto:contact@geodocs.dev" class="footer-link">contact@geodocs.dev</a> · <!-- -->Built for humans and AI agents.</p></div></div><style> .footer-link { font-size: 13px; color: var(--color-silver-teal); text-decoration: none; transition: color 0.2s ease; } .footer-link:hover { color: var(--color-white); } </style></footer><!--$--><!--/$--><script> (function(){ var s=document.createElement('script'); s.src='https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.min.js'; s.defer=true; s.onload=function(){ var isDark=document.documentElement.getAttribute('data-theme')==='dark'; mermaid.initialize({startOnLoad:true,theme:isDark?'dark':'default',securityLevel:'loose'}); mermaid.run(); }; document.head.appendChild(s); })(); </script><script src="/_next/static/chunks/0_k5kz-r4593u.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[86402,[\"/_next/static/chunks/0ld4q8u-25eux.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"/_next/static/chunks/0xf6s51ok42m_.js\",\"/_next/static/chunks/148t.fhegq9f1.js\",\"/_next/static/chunks/05cra..ka3fzk.js\"],\"GTMNoScript\"]\n3:I[59919,[\"/_next/static/chunks/0ld4q8u-25eux.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"/_next/static/chunks/0xf6s51ok42m_.js\",\"/_next/static/chunks/148t.fhegq9f1.js\",\"/_next/static/chunks/05cra..ka3fzk.js\"],\"ThemeProvider\"]\n4:\"$Sreact.suspense\"\n5:I[86402,[\"/_next/static/chunks/0ld4q8u-25eux.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"/_next/static/chunks/0xf6s51ok42m_.js\",\"/_next/static/chunks/148t.fhegq9f1.js\",\"/_next/static/chunks/05cra..ka3fzk.js\"],\"PostHogPageView\"]\n6:I[39756,[\"/_next/static/chunks/0ld4q8u-25eux.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"/_next/static/chunks/0xf6s51ok42m_.js\",\"/_next/static/chunks/148t.fhegq9f1.js\",\"/_next/static/chunks/05cra..ka3fzk.js\"],\"default\"]\n7:I[37457,[\"/_next/static/chunks/0ld4q8u-25eux.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"/_next/static/chunks/0xf6s51ok42m_.js\",\"/_next/static/chunks/148t.fhegq9f1.js\",\"/_next/static/chunks/05cra..ka3fzk.js\"],\"default\"]\n9:I[35264,[\"/_next/static/chunks/0ld4q8u-25eux.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"/_next/static/chunks/0xf6s51ok42m_.js\",\"/_next/static/chunks/148t.fhegq9f1.js\",\"/_next/static/chunks/05cra..ka3fzk.js\"],\"AlgoliaSearchDialog\"]\na:I[56414,[\"/_next/static/chunks/0ld4q8u-25eux.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"/_next/static/chunks/0xf6s51ok42m_.js\",\"/_next/static/chunks/148t.fhegq9f1.js\",\"/_next/static/chunks/05cra..ka3fzk.js\"],\"GeolifyAIDialog\"]\nb:I[86402,[\"/_next/static/chunks/0ld4q8u-25eux.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"/_next/static/chunks/0xf6s51ok42m_.js\",\"/_next/static/chunks/148t.fhegq9f1.js\",\"/_next/static/chunks/05cra..ka3fzk.js\"],\"Analytics\"]\nd:I[97367,[\"/_next/static/chunks/0ld4q8u-25eux.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"/_next/static/chunks/0xf6s51ok42m_.js\",\"/_next/static/chunks/148t.fhegq9f1.js\",\"/_next/static/chunks/05cra..ka3fzk.js\"],\"OutletBoundary\"]\n10:I[97367,[\"/_next/static/chunks/0ld4q8u-25eux.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"/_next/static/chunks/0xf6s51ok42m_.js\",\"/_next/static/chunks/148t.fhegq9f1.js\",\"/_next/static/chunks/05cra..ka3fzk.js\"],\"ViewportBoundary\"]\n12:I[97367,[\"/_next/static/chunks/0ld4q8u-25eux.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"/_next/static/chunks/0xf6s51ok42m_.js\",\"/_next/static/chunks/148t.fhegq9f1.js\",\"/_next/static/chunks/05cra..ka3fzk.js\"],\"MetadataBoundary\"]\n14:I[63491,[\"/_next/static/chunks/0ld4q8u-25eux.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"/_next/static/chunks/0xf6s51ok42m_.js\",\"/_next/static/chunks/148t.fhegq9f1.js\",\"/_next/static/chunks/05cra..ka3fzk.js\",\"/_next/static/chunks/0z~59b-n8nq5n.js\"],\"default\"]\n:HL[\"/_next/static/chunks/0hbz95bqplbsv.css\",\"style\"]\n:HL[\"https://fonts.googleapis.com/css2?family=DM+Serif+Text\u0026family=Plus+Jakarta+Sans:wght@300;400;500;600;700\u0026family=Source+Code+Pro:wght@400;500;600\u0026display=swap\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"technical\",\"api-content-design-for-ai-consumption-patterns\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"technical\",{\"children\":[[\"slug\",\"api-content-design-for-ai-consumption-patterns\",\"d\",null],{\"children\":[\"__PAGE__\",{}]}]}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0hbz95bqplbsv.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0ld4q8u-25eux.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-2\",{\"src\":\"/_next/static/chunks/0xf6s51ok42m_.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-3\",{\"src\":\"/_next/static/chunks/148t.fhegq9f1.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-4\",{\"src\":\"/_next/static/chunks/05cra..ka3fzk.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"(function(){try{var t=localStorage.getItem('geodocs-theme');if(t==='dark'){document.documentElement.setAttribute('data-theme','dark')}else{document.documentElement.setAttribute('data-theme','light')}}catch(e){}})()\"}}],[\"$\",\"link\",null,{\"rel\":\"icon\",\"href\":\"/favicon.ico\",\"sizes\":\"any\"}],[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.googleapis.com\"}],[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.gstatic.com\",\"crossOrigin\":\"anonymous\"}],[\"$\",\"link\",null,{\"href\":\"https://fonts.googleapis.com/css2?family=DM+Serif+Text\u0026family=Plus+Jakarta+Sans:wght@300;400;500;600;700\u0026family=Source+Code+Pro:wght@400;500;600\u0026display=swap\",\"rel\":\"stylesheet\"}]]}],[\"$\",\"body\",null,{\"children\":[[\"$\",\"$L2\",null,{}],[\"$\",\"$L3\",null,{\"children\":[[\"$\",\"$4\",null,{\"fallback\":null,\"children\":[\"$\",\"$L5\",null,{}]}],[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[\"$L8\",[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}],[\"$\",\"$L9\",null,{}],[\"$\",\"$La\",null,{}]]}],[\"$\",\"$Lb\",null,{}],[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n(function(){\\n var s=document.createElement('script');\\n s.src='https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.min.js';\\n s.defer=true;\\n s.onload=function(){\\n var isDark=document.documentElement.getAttribute('data-theme')==='dark';\\n mermaid.initialize({startOnLoad:true,theme:isDark?'dark':'default',securityLevel:'loose'});\\n mermaid.run();\\n };\\n document.head.appendChild(s);\\n})();\\n\"}}]]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[\"$Lc\",[[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0immojv~8w4~6.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"$Ld\",null,{\"children\":[\"$\",\"$4\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@e\"}]}]]}],{},null,false,null]},null,false,\"$@f\"]},null,false,\"$@f\"]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L10\",null,{\"children\":\"$L11\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L12\",null,{\"children\":[\"$\",\"$4\",null,{\"name\":\"Next.Metadata\",\"children\":\"$L13\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$14\",[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0hbz95bqplbsv.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"NIAK0ez3QwYT5WEUUjWPI\"}\n"])</script><script>self.__next_f.push([1,"15:[]\nf:\"$W15\"\n"])</script><script>self.__next_f.push([1,"16:I[2971,[\"/_next/static/chunks/0ld4q8u-25eux.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"/_next/static/chunks/0xf6s51ok42m_.js\",\"/_next/static/chunks/148t.fhegq9f1.js\",\"/_next/static/chunks/05cra..ka3fzk.js\",\"/_next/static/chunks/0immojv~8w4~6.js\"],\"Header\"]\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"$L16\",null,{\"lang\":\"en\",\"dict\":{\"nav\":{\"startHere\":\"Start Here\",\"geo\":\"GEO\",\"aeo\":\"AEO\",\"technical\":\"Technical\",\"strategy\":\"Strategy\",\"reference\":\"Reference\",\"tools\":\"Tools\",\"search\":\"Search docs...\",\"askGeolifyAI\":\"Ask GeolifyAI\",\"beta\":\"Beta\"},\"home\":{\"tagline\":\"The Canonical Knowledge System\",\"headline\":\"Structured knowledge for\",\"headlineHighlight\":\"AI search visibility\",\"subtitle\":\"GEO, AEO, and AI search optimization — defined, structured, and operationalized. Built for SEO professionals, developers, content teams, and AI agents.\",\"ctaPrimary\":\"Start with GEO\",\"ctaSecondary\":\"Read llms.txt spec\",\"trustSignals\":{\"answerFirst\":\"Answer-first content\",\"aiCitable\":\"AI-citable definitions\",\"machineReadable\":\"Machine-readable specs\",\"openFree\":\"Open \u0026 free\"},\"essentialReading\":\"Essential Reading\",\"geoPlaybooks\":\"GEO Playbooks\",\"playbooksSubtitle\":\"Canonical definitions, comparisons, and implementation guides. Start here to build your GEO foundation.\",\"readArticle\":\"Read article\",\"operatorsToolkit\":\"Operator's Toolkit\",\"technicalStandards\":\"Technical Standards for AI Search\",\"technicalSubtitle\":\"Implementation specs, file standards, and measurement frameworks. Everything you need to make your content AI-ready.\",\"knowledgeMap\":\"Knowledge Map\",\"browseBySection\":\"Browse by Section\",\"browseSubtitle\":\"Every concept has one canonical page. Explore the knowledge graph organized by domain.\",\"aiNativeDoc\":\"AI-Native Documentation\",\"builtForHumans\":\"Built for humans.\",\"readableByAI\":\"Readable by AI.\",\"aiNativeSubtitle\":\"Every page on geodocs.dev includes AI summary blocks, structured frontmatter, and machine-readable specs. Our content is designed to be cited by AI systems worldwide.\",\"aiContentSpec\":\"AI Content Spec\",\"viewLlmsTxt\":\"View llms.txt\"},\"sections\":{\"geo\":{\"title\":\"GEO - Generative Engine Optimization\",\"description\":\"Guides, definitions, and frameworks for optimizing content visibility in AI-generated answers.\"},\"aeo\":{\"title\":\"AEO - Answer Engine Optimization\",\"description\":\"How to structure content so AI systems can extract and cite direct answers.\"},\"technical\":{\"title\":\"Technical Implementation\",\"description\":\"llms.txt, ai.txt, structured data, and other technical specs for AI search readiness.\"},\"strategy\":{\"title\":\"Strategy \u0026 Frameworks\",\"description\":\"Business frameworks for AI search visibility — ROI, measurement, and content planning.\"},\"reference\":{\"title\":\"Reference\",\"description\":\"Glossary, cheatsheets, and canonical definitions for GEO/AEO terminology.\"},\"tools\":{\"title\":\"Tools \u0026 Platforms\",\"description\":\"Evaluations, comparisons, and stack recommendations for AI search optimization tools.\"},\"case-studies\":{\"title\":\"Case Studies\",\"description\":\"Evidence-based examples with real data — before/after results and industry applications.\"},\"ai-agents\":{\"title\":\"AI Agents\",\"description\":\"Machine-readable specs and documentation designed specifically for AI parsers and bots.\"}},\"article\":{\"minRead\":\"{min} min read\",\"words\":\"{count} words\",\"updated\":\"Updated {date}\",\"relatedArticles\":\"Related Articles\",\"onThisPage\":\"On this page\",\"topics\":\"Topics\",\"copy\":\"Copy\",\"copied\":\"Copied!\"},\"tags\":{\"browseByTopic\":\"Browse by Topic\",\"exploreTopics\":\"Explore {count} topics across all GEO, AEO, and AI search optimization articles.\",\"articlesTaggedWith\":\"{count} article tagged with \\\"{tag}\\\"|{count} articles tagged with \\\"{tag}\\\"\"},\"newsletter\":{\"stayUpdated\":\"Stay Updated\",\"title\":\"GEO \u0026 AI Search Insights\",\"description\":\"New articles, framework updates, and industry analysis. No spam, unsubscribe anytime.\",\"placeholder\":\"your@email.com\",\"subscribe\":\"Subscribe\",\"success\":\"You're subscribed! We'll keep you updated.\",\"error\":\"Something went wrong. Please try again.\"},\"footer\":{\"learn\":\"Learn\",\"build\":\"Build\",\"strategy\":\"Strategy\",\"resources\":\"Resources\",\"description\":\"Structured knowledge for AI search visibility. The canonical reference for GEO, AEO, and AI search optimization.\",\"allRightsReserved\":\"All rights reserved.\",\"builtForHumansAndAI\":\"Built for humans and AI agents.\"},\"common\":{\"articles\":\"articles\",\"article\":\"article\",\"page\":\"Page {current} of {total}\",\"noArticles\":\"No published articles in this section yet.\",\"checkBackSoon\":\"Content is being actively developed. Check back soon.\",\"loadingArticles\":\"Loading articles…\",\"prev\":\"← Prev\",\"next\":\"Next →\",\"goHome\":\"Go home\",\"startWithGEO\":\"Start with GEO\"},\"notFound\":{\"label\":\"404 - Page Not Found\",\"title\":\"This page doesn't exist yet.\",\"description\":\"The content you're looking for may be in development. Geodocs.dev is actively building the canonical knowledge base for GEO and AEO.\"},\"error\":{\"title\":\"Something went wrong\",\"description\":\"An unexpected error occurred. Our team has been notified.\",\"tryAgain\":\"Try Again\"},\"contact\":{\"getInTouch\":\"Get In Touch\",\"contactUs\":\"Contact Us\",\"heroDescription\":\"Have a question about GEO, AEO, or AI search optimization? Want to collaborate or contribute? We'd love to hear from you.\",\"name\":\"Name\",\"email\":\"Email\",\"subject\":\"Subject\",\"subjectPlaceholder\":\"What is this about?\",\"namePlaceholder\":\"Your name\",\"message\":\"Message\",\"messagePlaceholder\":\"Tell us more...\",\"sendMessage\":\"Send Message\",\"sending\":\"Sending...\",\"messageSent\":\"Message sent!\",\"thankYou\":\"Thank you for reaching out. We'll get back to you within 1-2 business days.\",\"sendAnother\":\"Send another message\",\"emailDirectly\":\"Or email us directly at\",\"validationName\":\"Please enter your name.\",\"validationEmail\":\"Please enter a valid email address.\",\"validationMessage\":\"Please enter a message (at least 10 characters).\",\"networkError\":\"Network error. Please try again.\",\"genericError\":\"Something went wrong. Please try again.\"},\"languagePicker\":{\"label\":\"Language\"}}}],\"$L17\",\"$L18\"]\n"])</script><script>self.__next_f.push([1,"19:I[22016,[\"/_next/static/chunks/0ld4q8u-25eux.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"/_next/static/chunks/0xf6s51ok42m_.js\",\"/_next/static/chunks/148t.fhegq9f1.js\",\"/_next/static/chunks/05cra..ka3fzk.js\",\"/_next/static/chunks/0immojv~8w4~6.js\"],\"\"]\n1a:I[5500,[\"/_next/static/chunks/0ld4q8u-25eux.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"/_next/static/chunks/0xf6s51ok42m_.js\",\"/_next/static/chunks/148t.fhegq9f1.js\",\"/_next/static/chunks/05cra..ka3fzk.js\",\"/_next/static/chunks/0immojv~8w4~6.js\"],\"Image\"]\n17:[\"$\",\"main\",null,{\"style\":{\"minHeight\":\"60vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"textAlign\":\"center\",\"padding\":\"80px 24px\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"var(--font-mono)\",\"fontSize\":11,\"fontWeight\":600,\"textTransform\":\"uppercase\",\"letterSpacing\":3,\"color\":\"var(--color-cool-gray)\",\"marginBottom\":16},\"children\":\"404 - Page Not Found\"}],[\"$\",\"h1\",null,{\"style\":{\"fontFamily\":\"var(--font-display)\",\"fontSize\":\"clamp(2rem, 4vw, 3rem)\",\"fontWeight\":400,\"color\":\"var(--color-forest-black)\",\"marginBottom\":16},\"children\":\"This page doesn't exist yet.\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":16,\"color\":\"var(--color-cool-gray)\",\"lineHeight\":1.7,\"maxWidth\":480,\"margin\":\"0 auto 32px\"},\"children\":\"The content you're looking for may be in development. Geodocs.dev is actively building the canonical knowledge base for GEO and AEO.\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"flex\",\"justifyContent\":\"center\",\"gap\":12},\"children\":[[\"$\",\"$L19\",null,{\"href\":\"/\",\"className\":\"btn btn-primary\",\"children\":\"Go home\"}],[\"$\",\"$L19\",null,{\"href\":\"/geo/what-is-geo\",\"className\":\"btn btn-outline\",\"children\":\"Start with GEO\"}]]}]]}]}]\n"])</script><script>self.__next_f.push([1,"18:[\"$\",\"footer\",null,{\"style\":{\"background\":\"var(--color-forest-black)\",\"borderTop\":\"1px solid var(--color-teal-gray)\",\"padding\":\"64px 24px 32px\"},\"children\":[[\"$\",\"div\",null,{\"style\":{\"maxWidth\":1200,\"margin\":\"0 auto\"},\"children\":[[\"$\",\"div\",null,{\"style\":{\"display\":\"grid\",\"gridTemplateColumns\":\"repeat(auto-fit, minmax(180px, 1fr))\",\"gap\":48,\"marginBottom\":48},\"children\":[[\"$\",\"div\",null,{\"children\":[[\"$\",\"div\",null,{\"style\":{\"marginBottom\":16},\"children\":[\"$\",\"$L1a\",null,{\"src\":\"/geodocs-logo-dark.svg\",\"alt\":\"Geodocs.dev\",\"width\":140,\"height\":32,\"style\":{\"height\":24,\"width\":\"auto\"}}]}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":13,\"color\":\"var(--color-cool-gray)\",\"lineHeight\":1.6,\"maxWidth\":220},\"children\":\"Structured knowledge for AI search visibility. The canonical reference for GEO, AEO, and AI search optimization.\"}]]}],[[\"$\",\"div\",\"Learn\",{\"children\":[[\"$\",\"h4\",null,{\"style\":{\"fontFamily\":\"var(--font-mono)\",\"fontSize\":11,\"fontWeight\":600,\"textTransform\":\"uppercase\",\"letterSpacing\":2,\"color\":\"var(--color-mongodb-green)\",\"marginBottom\":16},\"children\":\"Learn\"}],[\"$\",\"ul\",null,{\"style\":{\"listStyle\":\"none\",\"display\":\"flex\",\"flexDirection\":\"column\",\"gap\":10},\"children\":[[\"$\",\"li\",\"/geo/what-is-geo\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/geo/what-is-geo\",\"className\":\"footer-link\",\"children\":\"What Is GEO?\"}]}],[\"$\",\"li\",\"/aeo/what-is-aeo\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/aeo/what-is-aeo\",\"className\":\"footer-link\",\"children\":\"What Is AEO?\"}]}],[\"$\",\"li\",\"/geo/geo-vs-seo\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/geo/geo-vs-seo\",\"className\":\"footer-link\",\"children\":\"GEO vs SEO\"}]}],[\"$\",\"li\",\"/reference/geo-aeo-glossary\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/reference/geo-aeo-glossary\",\"className\":\"footer-link\",\"children\":\"GEO Glossary\"}]}]]}]]}],[\"$\",\"div\",\"Build\",{\"children\":[[\"$\",\"h4\",null,{\"style\":{\"fontFamily\":\"var(--font-mono)\",\"fontSize\":11,\"fontWeight\":600,\"textTransform\":\"uppercase\",\"letterSpacing\":2,\"color\":\"var(--color-mongodb-green)\",\"marginBottom\":16},\"children\":\"Build\"}],[\"$\",\"ul\",null,{\"style\":{\"listStyle\":\"none\",\"display\":\"flex\",\"flexDirection\":\"column\",\"gap\":10},\"children\":[[\"$\",\"li\",\"/technical/llms-txt\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/technical/llms-txt\",\"className\":\"footer-link\",\"children\":\"llms.txt Reference\"}]}],[\"$\",\"li\",\"/technical/how-to-create-llms-txt\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/technical/how-to-create-llms-txt\",\"className\":\"footer-link\",\"children\":\"Create llms.txt\"}]}],[\"$\",\"li\",\"/technical/structured-data-for-ai-search\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/technical/structured-data-for-ai-search\",\"className\":\"footer-link\",\"children\":\"Structured Data\"}]}],[\"$\",\"li\",\"/technical/ai-txt\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/technical/ai-txt\",\"className\":\"footer-link\",\"children\":\"ai.txt Reference\"}]}]]}]]}],[\"$\",\"div\",\"Strategy\",{\"children\":[[\"$\",\"h4\",null,{\"style\":{\"fontFamily\":\"var(--font-mono)\",\"fontSize\":11,\"fontWeight\":600,\"textTransform\":\"uppercase\",\"letterSpacing\":2,\"color\":\"var(--color-mongodb-green)\",\"marginBottom\":16},\"children\":\"Strategy\"}],[\"$\",\"ul\",null,{\"style\":{\"listStyle\":\"none\",\"display\":\"flex\",\"flexDirection\":\"column\",\"gap\":10},\"children\":[[\"$\",\"li\",\"/strategy/ai-visibility-measurement\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/strategy/ai-visibility-measurement\",\"className\":\"footer-link\",\"children\":\"AI Visibility\"}]}],[\"$\",\"li\",\"/strategy/geo-content-strategy\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/strategy/geo-content-strategy\",\"className\":\"footer-link\",\"children\":\"Content Strategy\"}]}],[\"$\",\"li\",\"/strategy/geo-roi-framework\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/strategy/geo-roi-framework\",\"className\":\"footer-link\",\"children\":\"GEO ROI\"}]}],[\"$\",\"li\",\"/aeo/aeo-content-checklist\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/aeo/aeo-content-checklist\",\"className\":\"footer-link\",\"children\":\"AEO Checklist\"}]}]]}]]}],[\"$\",\"div\",\"Resources\",{\"children\":[[\"$\",\"h4\",null,{\"style\":{\"fontFamily\":\"var(--font-mono)\",\"fontSize\":11,\"fontWeight\":600,\"textTransform\":\"uppercase\",\"letterSpacing\":2,\"color\":\"var(--color-mongodb-green)\",\"marginBottom\":16},\"children\":\"Resources\"}],[\"$\",\"ul\",null,{\"style\":{\"listStyle\":\"none\",\"display\":\"flex\",\"flexDirection\":\"column\",\"gap\":10},\"children\":[[\"$\",\"li\",\"https://github.com/Geodocs-dev\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"https://github.com/Geodocs-dev\",\"className\":\"footer-link\",\"children\":\"GitHub\"}]}],[\"$\",\"li\",\"/contact\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/contact\",\"className\":\"footer-link\",\"children\":\"Contact\"}]}],[\"$\",\"li\",\"/tags\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/tags\",\"className\":\"footer-link\",\"children\":\"Tags\"}]}],[\"$\",\"li\",\"/sitemap.xml\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/sitemap.xml\",\"className\":\"footer-link\",\"children\":\"Sitemap\"}]}],\"$L1b\",\"$L1c\"]}]]}]]]}],\"$L1d\"]}],\"$L1e\"]}]\n"])</script><script>self.__next_f.push([1,"1b:[\"$\",\"li\",\"/llms.txt\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/llms.txt\",\"className\":\"footer-link\",\"children\":\"llms.txt\"}]}]\n1c:[\"$\",\"li\",\"/ai.txt\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/ai.txt\",\"className\":\"footer-link\",\"children\":\"ai.txt\"}]}]\n1d:[\"$\",\"div\",null,{\"style\":{\"borderTop\":\"1px solid var(--color-teal-gray)\",\"paddingTop\":24,\"display\":\"flex\",\"justifyContent\":\"space-between\",\"alignItems\":\"center\",\"flexWrap\":\"wrap\",\"gap\":16},\"children\":[[\"$\",\"p\",null,{\"style\":{\"fontSize\":12,\"color\":\"var(--color-cool-gray)\"},\"children\":[\"© \",2026,\" Geodocs.dev. \",\"All rights reserved.\"]}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":12,\"color\":\"var(--color-cool-gray)\"},\"children\":[[\"$\",\"a\",null,{\"href\":\"mailto:contact@geodocs.dev\",\"className\":\"footer-link\",\"children\":\"contact@geodocs.dev\"}],\" · \",\"Built for humans and AI agents.\"]}]]}]\n1e:[\"$\",\"style\",null,{\"children\":\"\\n .footer-link {\\n font-size: 13px;\\n color: var(--color-silver-teal);\\n text-decoration: none;\\n transition: color 0.2s ease;\\n }\\n .footer-link:hover {\\n color: var(--color-white);\\n }\\n \"}]\n"])</script><script>self.__next_f.push([1,"1f:I[43937,[\"/_next/static/chunks/0ld4q8u-25eux.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"/_next/static/chunks/0xf6s51ok42m_.js\",\"/_next/static/chunks/148t.fhegq9f1.js\",\"/_next/static/chunks/05cra..ka3fzk.js\",\"/_next/static/chunks/0immojv~8w4~6.js\"],\"ArticleTracker\"]\n20:T51b,{\"@context\":\"https://schema.org\",\"@type\":\"TechArticle\",\"mainEntityOfPage\":{\"@type\":\"WebPage\",\"@id\":\"https://geodocs.dev/technical/api-content-design-for-ai-consumption-patterns\"},\"headline\":\"API Content Design for AI Consumption: Patterns for Reference Docs\",\"description\":\"Design patterns for API reference documentation that AI agents can parse, cite, and call: canonical examples, error tables, parameter schemas, and dual human/LLM delivery.\",\"image\":\"https://geodocs.dev/geodocs-logo-dark.png\",\"url\":\"https://geodocs.dev/technical/api-content-design-for-ai-consumption-patterns\",\"author\":{\"@type\":\"Person\",\"name\":\"Geodocs Research Team\"},\"publisher\":{\"@type\":\"Organization\",\"name\":\"Geodocs.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://geodocs.dev/geodocs-logo-dark.png\"}},\"datePublished\":\"2026-04-29\",\"dateModified\":\"2026-04-29\",\"keywords\":\"API documentation for AI consumption, LLM-friendly API docs, AI-ready API reference, OpenAPI for LLM tool calling, llms.txt for API documentation, API docs for AI agents\",\"about\":[{\"@type\":\"Thing\",\"name\":\"OpenAPI\"},{\"@type\":\"Thing\",\"name\":\"llms.txt\"},{\"@type\":\"Thing\",\"name\":\"JSON Schema\"},{\"@type\":\"Thing\",\"name\":\"MCP\"},{\"@type\":\"Thing\",\"name\":\"RAG\"},{\"@type\":\"Thing\",\"name\":\"Speakeasy\"},{\"@type\":\"Thing\",\"name\":\"Fern\"},{\"@type\":\"Thing\",\"name\":\"Svelte\"}]}21:T9a4,"])</script><script>self.__next_f.push([1,"{\"@context\":\"https://schema.org\",\"@type\":\"FAQPage\",\"mainEntity\":[{\"@type\":\"Question\",\"name\":\"Do I still need HTML docs if I publish OpenAPI plus Markdown?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Yes. Human developers expect a navigable HTML reference, and search engines still rank HTML pages for long-tail discovery. Treat HTML as the presentation of the same Markdown source — never as a separate content surface. The OpenAPI + Markdown + HTML stack is a single pipeline, not three projects.\"}},{\"@type\":\"Question\",\"name\":\"Should I use MCP or OpenAPI for tool-calling agents?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"For most teams, OpenAPI first, MCP optional. OpenAPI already describes your API completely, integrates with every LLM provider's function-calling format, and works for both human developers and agents. MCP is useful when you want to expose stateful, agent-specific operations that do not exist in your public REST surface. (Bin Wang, 2025)\"}},{\"@type\":\"Question\",\"name\":\"How long should an endpoint reference page be?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"For a typical CRUD endpoint, 400-900 words including code blocks. Long enough to include a canonical example, parameter table, error table, and one common pattern; short enough that an LLM can ingest the full page in a single retrieval chunk (≈ 4k tokens). Endpoints with rich behavior (webhooks, streaming, file upload) can run longer and should split into sub-pages.\"}},{\"@type\":\"Question\",\"name\":\"How often should I regenerate llms.txt?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Regenerate on every release that changes endpoints, parameters, authentication, or error codes. For minor copy edits, a daily or weekly scheduled rebuild is sufficient. Test by loading the file into Cursor or Claude and asking specific questions about your API; if the answer is wrong, the file is wrong. (Fern, 2026)\"}},{\"@type\":\"Question\",\"name\":\"How do I measure whether AI-ready API docs are working?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Track three metrics: citation rate (how often Perplexity, ChatGPT, and Gemini cite your reference pages for relevant queries), agent task success rate (have an internal eval that asks Claude or GPT-5 to perform 50 representative API tasks against your docs), and SDK accuracy (rate of compilable, runnable code generated by Cursor or Copilot from your docs). All three should be tracked monthly and compared against your last spec change.\"}}]}"])</script><script>self.__next_f.push([1,"c:[[\"$\",\"$L16\",null,{\"lang\":\"en\",\"dict\":\"$8:0:props:dict\"}],[[\"$\",\"main\",null,{\"style\":{\"minHeight\":\"70vh\"},\"children\":[[\"$\",\"$L1f\",null,{\"meta\":{\"slug\":\"api-content-design-for-ai-consumption-patterns\",\"section\":\"technical\",\"content_type\":\"guide\",\"difficulty\":\"advanced\",\"primary_audience\":\"api-technical-writers\",\"secondary_audiences\":[\"developer-relations\",\"backend-engineers\",\"devtools-product-managers\"],\"word_count\":2018,\"reading_time_min\":11,\"has_code_snippet\":false,\"has_table\":true,\"citation_readiness\":\"reviewed\",\"series\":\"technical-foundations-for-ai-search\",\"series_order\":4}}],[[\"$\",\"script\",null,{\"type\":\"application/ld+json\",\"dangerouslySetInnerHTML\":{\"__html\":\"$20\"}}],[\"$\",\"script\",null,{\"type\":\"application/ld+json\",\"dangerouslySetInnerHTML\":{\"__html\":\"{\\\"@context\\\":\\\"https://schema.org\\\",\\\"@type\\\":\\\"BreadcrumbList\\\",\\\"itemListElement\\\":[{\\\"@type\\\":\\\"ListItem\\\",\\\"position\\\":1,\\\"name\\\":\\\"Home\\\",\\\"item\\\":\\\"https://geodocs.dev\\\"},{\\\"@type\\\":\\\"ListItem\\\",\\\"position\\\":2,\\\"name\\\":\\\"TECHNICAL\\\",\\\"item\\\":\\\"https://geodocs.dev/technical\\\"},{\\\"@type\\\":\\\"ListItem\\\",\\\"position\\\":3,\\\"name\\\":\\\"API Content Design for AI Consumption: Patterns for Reference Docs\\\",\\\"item\\\":\\\"https://geodocs.dev/technical/api-content-design-for-ai-consumption-patterns\\\"}]}\"}}],[\"$\",\"script\",null,{\"type\":\"application/ld+json\",\"dangerouslySetInnerHTML\":{\"__html\":\"$21\"}}],\"$L22\",\"$L23\"]]}],\"$L24\"],\"$L25\"]\n"])</script><script>self.__next_f.push([1,"26:I[23150,[\"/_next/static/chunks/0ld4q8u-25eux.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"/_next/static/chunks/0xf6s51ok42m_.js\",\"/_next/static/chunks/148t.fhegq9f1.js\",\"/_next/static/chunks/05cra..ka3fzk.js\",\"/_next/static/chunks/0immojv~8w4~6.js\"],\"ShareButtons\"]\n27:I[47654,[\"/_next/static/chunks/0ld4q8u-25eux.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"/_next/static/chunks/0xf6s51ok42m_.js\",\"/_next/static/chunks/148t.fhegq9f1.js\",\"/_next/static/chunks/05cra..ka3fzk.js\",\"/_next/static/chunks/0immojv~8w4~6.js\"],\"ExploreWithAI\"]\n2b:I[11181,[\"/_next/static/chunks/0ld4q8u-25eux.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"/_next/static/chunks/0xf6s51ok42m_.js\",\"/_next/static/chunks/148t.fhegq9f1.js\",\"/_next/static/chunks/05cra..ka3fzk.js\",\"/_next/static/chunks/0immojv~8w4~6.js\"],\"Newsletter\"]\n28:T3a13,"])</script><script>self.__next_f.push([1,"\u003cdiv class=\"ai-summary\"\u003e\u003cp\u003eAI-ready API reference docs combine a complete OpenAPI spec, an llms.txt index, and Markdown pages built around canonical examples, exhaustive error tables, and explicit parameter schemas. The same surface should serve human developers and LLM agents through dual delivery — HTML for browsers, plain Markdown for crawlers and tool-calling agents.\u003c/p\u003e\u003c/div\u003e\n\u003cp\u003eTL;DR. Design API reference docs as machine-first content with a thin presentation layer. Ship an OpenAPI 3.1 spec, an llms.txt index, and per-endpoint Markdown pages that lead with a canonical request/response example, follow with a typed parameter table, and end with an exhaustive error code table. Serve .md siblings or use content negotiation so AI agents pull tokens, not pixels. (Fern, 2026; Speakeasy)\u003c/p\u003e\n\u003ch2 id=\"why-api-docs-are-the-highest-leverage-ai-content-you-own\"\u003eWhy API docs are the highest-leverage AI content you own\u003c/h2\u003e\n\u003cp\u003eAI agents have become a top consumer of API documentation. Tollbit reported that traffic from retrieval-augmented generation (RAG) bots surged 49% in early 2025, and agent traffic is now growing alongside human developer traffic. (The New Stack, 2025) Every time Cursor, Claude, ChatGPT, or Perplexity answers a question like \"how do I authenticate against the X API?\" it is reading a reference page, an OpenAPI schema, or an llms.txt index — not a marketing page.\u003c/p\u003e\n\u003cp\u003eFor a docs team, this changes the brief. A reference page must now satisfy three readers simultaneously:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003eA human developer scanning for a code sample.\u003c/li\u003e\n\u003cli\u003eAn IDE assistant (Cursor, Copilot, Continue) pulling structured context into a tool call.\u003c/li\u003e\n\u003cli\u003eA retrieval system (Perplexity, ChatGPT search, Gemini, Claude with web access) extracting a snippet to cite.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eIf any one of those readers gets a worse experience than the other two, you lose citations, you lose generated-code accuracy, and — most expensively — agents start hallucinating endpoints that do not exist. (Fern, 2026)\u003c/p\u003e\n\u003ch2 id=\"the-three-layer-model-for-ai-consumable-api-docs\"\u003eThe three-layer model for AI-consumable API docs\u003c/h2\u003e\n\u003cp\u003eThink of AI-ready API content as three stacked layers, each strictly machine-readable, each citable on its own:\u003c/p\u003e\n\u003cdiv class=\"table-responsive\"\u003e\u003ctable\u003e\u003cthead\u003e\u003ctr\u003e\u003cth\u003eLayer\u003c/th\u003e\u003cth\u003eFormat\u003c/th\u003e\u003cth\u003ePrimary consumer\u003c/th\u003e\u003cth\u003eWhy it matters\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd\u003eSpec layer\u003c/td\u003e\u003ctd\u003eOpenAPI 3.1 / JSON Schema\u003c/td\u003e\u003ctd\u003eTool-calling agents, SDK generators\u003c/td\u003e\u003ctd\u003eUnambiguous types, enums, constraints\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003eIndex layer\u003c/td\u003e\u003ctd\u003ellms.txt, sitemap.xml, RSS\u003c/td\u003e\u003ctd\u003eCrawlers, RAG indexers\u003c/td\u003e\u003ctd\u003eDiscoverability, prioritization\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003eNarrative layer\u003c/td\u003e\u003ctd\u003eMarkdown reference pages\u003c/td\u003e\u003ctd\u003eHumans + LLM extractors\u003c/td\u003e\u003ctd\u003eCitation-ready prose, examples, errors\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/div\u003e\n\u003cp\u003eEach layer must stay synchronized with the others. Drift between the OpenAPI spec and the Markdown reference is the single biggest cause of agent hallucinations, because agents that fall back to prose then \"correct\" generated code against stale parameter names. (buildwithfern.com)\u003c/p\u003e\n\u003ch2 id=\"pattern-1-lead-every-endpoint-with-a-canonical-example\"\u003ePattern 1 — Lead every endpoint with a canonical example\u003c/h2\u003e\n\u003cp\u003eLLMs anchor on the first concrete artifact they see. If the first thing on /messages.create is a paragraph, the model summarizes; if the first thing is a request and a 200 response, the model imitates.\u003c/p\u003e\n\u003cp\u003eRecommended block order for every endpoint page:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003eH1 with the endpoint verb + path: POST /v1/messages\u003c/li\u003e\n\u003cli\u003eOne-sentence purpose line (the canonical_question answered).\u003c/li\u003e\n\u003cli\u003eCanonical request in the most common SDK language, plus a raw curl block.\u003c/li\u003e\n\u003cli\u003eCanonical 200 response as a complete JSON object.\u003c/li\u003e\n\u003cli\u003eParameter table.\u003c/li\u003e\n\u003cli\u003eReturned object schema.\u003c/li\u003e\n\u003cli\u003eError code table with code, http_status, description, recovery.\u003c/li\u003e\n\u003cli\u003e\"Common patterns\" section (idempotency keys, pagination, retries).\u003c/li\u003e\n\u003cli\u003eRelated endpoints.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eKeep examples self-contained. Every value in a request body must either be a literal or appear in a previous example on the same page — agents cannot follow \u003csee Authentication page\u003e reliably during a single retrieval pass. (docsbydesign.com, 2026)\u003c/p\u003e\n\u003ch2 id=\"pattern-2-make-parameter-schemas-exhaustive-not-minimal\"\u003ePattern 2 — Make parameter schemas exhaustive, not minimal\u003c/h2\u003e\n\u003cp\u003eThe MCPify and Speakeasy guidance converges on one rule: never let an LLM guess a type or an enum. (MCPify, 2026; Speakeasy)\u003c/p\u003e\n\u003cp\u003eFor every parameter, document:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eType (string, integer, boolean, array\u003cstring\u003e, object).\u003c/li\u003e\n\u003cli\u003eRequired vs optional, with the default if optional.\u003c/li\u003e\n\u003cli\u003eFormat (uuid, iso8601, email, uri).\u003c/li\u003e\n\u003cli\u003eConstraints (min, max, pattern, enum).\u003c/li\u003e\n\u003cli\u003eEffect on the response (\"if expand=author, the response includes author as a nested object\").\u003c/li\u003e\n\u003cli\u003eSide effects (\"setting dry_run=true does not consume credits\").\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eExpose the same information in three places: in the OpenAPI spec, in a Markdown table on the reference page, and — when you generate llms.txt — as a flattened key/value list. Triplication is intentional; each consumer prefers a different surface, and each surface raises citation rate by ~10-20% in retrieval evaluations of API docs. (Fern, 2026)\u003c/p\u003e\n\u003ch2 id=\"pattern-3-treat-errors-as-first-class-content\"\u003ePattern 3 — Treat errors as first-class content\u003c/h2\u003e\n\u003cp\u003eGeneric error pages destroy agent reliability. When a model receives 400 Bad Request: invalid input, it has no recovery path. When it receives 400 invalid_recipient: recipient must be an E.164-formatted phone number; check the to field, it can self-correct on the next call.\u003c/p\u003e\n\u003cp\u003eDesign every endpoint with an error table that LLMs can lift into a structured-output schema:\u003c/p\u003e\n\u003cdiv class=\"table-responsive\"\u003e\u003ctable\u003e\u003cthead\u003e\u003ctr\u003e\u003cth\u003eerror_code\u003c/th\u003e\u003cth\u003ehttp_status\u003c/th\u003e\u003cth\u003eWhen it fires\u003c/th\u003e\u003cth\u003eRecovery action\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd\u003einvalid_recipient\u003c/td\u003e\u003ctd\u003e400\u003c/td\u003e\u003ctd\u003eto is not E.164\u003c/td\u003e\u003ctd\u003eReformat number; retry\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003erate_limited\u003c/td\u003e\u003ctd\u003e429\u003c/td\u003e\u003ctd\u003eBurst over 60 req/min\u003c/td\u003e\u003ctd\u003eBackoff per Retry-After\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003eauth_expired\u003c/td\u003e\u003ctd\u003e401\u003c/td\u003e\u003ctd\u003eAPI key expired\u003c/td\u003e\u003ctd\u003eRefresh key; retry\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/div\u003e\n\u003cp\u003eKeep the table on the endpoint page and in the OpenAPI responses section with x-error-codes extensions. Models trained on documentation pairs use both. (nibzard/awesome-agentic-patterns)\u003c/p\u003e\n\u003ch2 id=\"pattern-4-ship-a-complete-openapi-3-1-spec-not-a-sampler\"\u003ePattern 4 — Ship a complete OpenAPI 3.1 spec, not a sampler\u003c/h2\u003e\n\u003cp\u003eOpenAPI is the de facto bridge between APIs and tool-calling LLMs. Frameworks from SnapLogic to Gravitee to Samchon's @samchon/openapi convert OpenAPI definitions directly into LLM function-calling schemas. (SnapLogic; Gravitee, 2025)\u003c/p\u003e\n\u003cp\u003eThe quality bar for an LLM-grade OpenAPI document:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eOperation IDs are verb-noun and unique (createMessage, not post_messages_v1).\u003c/li\u003e\n\u003cli\u003eEvery operation has a one-sentence summary and a multi-sentence description.\u003c/li\u003e\n\u003cli\u003eEvery parameter has a description and an example value.\u003c/li\u003e\n\u003cli\u003eAll enum values are documented inline.\u003c/li\u003e\n\u003cli\u003erequestBody and responses reference shared components.schemas, not inline anonymous objects.\u003c/li\u003e\n\u003cli\u003ex-codeSamples includes ≥3 SDK languages.\u003c/li\u003e\n\u003cli\u003eservers lists production and sandbox URLs explicitly.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eValidate continuously. Spec drift is the most common cause of generated SDK breakage and of agent code that compiles but 404s. (buildwithfern.com)\u003c/p\u003e\n\u003ch2 id=\"pattern-5-publish-an-llms-txt-index-for-the-api\"\u003ePattern 5 — Publish an llms.txt index for the API\u003c/h2\u003e\n\u003cp\u003ellms.txt is the emerging convention for telling AI tools where to find canonical content. For an API, your root llms.txt should:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eLink to the OpenAPI spec URL as a first-class entry.\u003c/li\u003e\n\u003cli\u003eLink to per-endpoint Markdown versions (one URL per operation).\u003c/li\u003e\n\u003cli\u003eLink to a flat \"all endpoints\" Markdown bundle for small APIs (\u003c 200 KB compressed).\u003c/li\u003e\n\u003cli\u003eInclude a ## Authentication section with auth flow, scopes, and a working example request.\u003c/li\u003e\n\u003cli\u003eInclude a ## Errors section listing every error code in the API.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eRegenerate llms.txt on every breaking change. Outdated authentication flows or removed endpoints make AI tools suggest non-functional code, which is the failure mode users blame on the API, not on the docs. (Fern, 2026)\u003c/p\u003e\n\u003ch2 id=\"pattern-6-serve-dual-surfaces-html-for-humans-markdown-for-agents\"\u003ePattern 6 — Serve dual surfaces: HTML for humans, Markdown for agents\u003c/h2\u003e\n\u003cp\u003eMarkdown is 80-90% more token-efficient than the equivalent HTML page. (Fern, 2026) Two production-grade patterns exist:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eSibling .md URLs. Every https://docs.example.com/api/messages has a sibling https://docs.example.com/api/messages.md. Cite the .md URL in llms.txt. This is the Svelte and Speakeasy pattern. (Svelte, via dev.to)\u003c/li\u003e\n\u003cli\u003eContent negotiation. The same URL serves HTML to browsers (Accept: text/html) and Markdown to AI clients (Accept: text/markdown). Fern auto-generates this; rolling your own requires only a CDN edge function.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eWhichever you choose, ensure the Markdown surface contains the same canonical example, parameter table, and error table as the HTML surface — never a stripped-down version. Agents that fall back to HTML when Markdown is incomplete are unable to cite either.\u003c/p\u003e\n\u003ch2 id=\"pattern-7-optimize-for-direct-citation-not-pageviews\"\u003ePattern 7 — Optimize for direct citation, not pageviews\u003c/h2\u003e\n\u003cp\u003eOn AI search engines, the unit of value is not a session — it is a citation. Direct-citation patterns for API docs:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eStable URLs forever. Never reorganize endpoint paths in docs. Use redirects, not deletions.\u003c/li\u003e\n\u003cli\u003eHeading anchors are the citation target. Use predictable anchors (#errors, #rate-limits, #pagination).\u003c/li\u003e\n\u003cli\u003eEach endpoint page has a unique \u003ctitle\u003e and description. Avoid global titles like \"API reference.\"\u003c/li\u003e\n\u003cli\u003eAdd Article or TechArticle JSON-LD with headline, dateModified, author, and about.\u003c/li\u003e\n\u003cli\u003eDate every page. AI engines downweight undated technical content during freshness ranking.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eThese signals are the same ones that lift documentation in Perplexity and ChatGPT search results, and they map directly to the GEO citation_readiness: reviewed standard.\u003c/p\u003e\n\u003ch2 id=\"anti-patterns-to-remove-from-your-reference-docs\"\u003eAnti-patterns to remove from your reference docs\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eTabs that hide languages. A tabbed Python/JS/curl widget renders as one language to most crawlers; expose all three as visible code blocks.\u003c/li\u003e\n\u003cli\u003e\"Try it\" widgets without static fallbacks. If the canonical request lives in a JS widget, it is invisible to retrieval.\u003c/li\u003e\n\u003cli\u003eMarketing copy on reference pages. \"Lightning-fast,\" \"developer-first,\" and \"world-class\" cost tokens and dilute extraction.\u003c/li\u003e\n\u003cli\u003eFragmented authentication docs. Every endpoint page should restate, in two sentences, how to authenticate, with a link to the canonical auth page.\u003c/li\u003e\n\u003cli\u003eNumeric error codes without slugs. error: 1027 is unparseable; error: invalid_recipient (1027) is.\u003c/li\u003e\n\u003cli\u003eImplicit defaults. \"Defaults to a reasonable value\" is the worst phrase in API docs. Always state the literal default.\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"quality-checklist-before-publishing-an-endpoint-page\"\u003eQuality checklist before publishing an endpoint page\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e[ ] H1 includes verb and path.\u003c/li\u003e\n\u003cli\u003e[ ] First non-heading block is a complete request example.\u003c/li\u003e\n\u003cli\u003e[ ] Second block is a complete 200 response.\u003c/li\u003e\n\u003cli\u003e[ ] Parameter table includes type, required, default, constraints, example.\u003c/li\u003e\n\u003cli\u003e[ ] Every enum value is listed and described.\u003c/li\u003e\n\u003cli\u003e[ ] Error table covers every documented error_code.\u003c/li\u003e\n\u003cli\u003e[ ] OpenAPI operationId matches the page URL slug.\u003c/li\u003e\n\u003cli\u003e[ ] Markdown sibling (.md) is published and reachable.\u003c/li\u003e\n\u003cli\u003e[ ] Page is listed in llms.txt.\u003c/li\u003e\n\u003cli\u003e[ ] dateModified is current.\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"related-geodocs-references\"\u003eRelated Geodocs references\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003ellms.txt Reference: Specification, Format, and Examples\u003c/li\u003e\n\u003cli\u003eMarkdown Optimization for AI Parsers\u003c/li\u003e\n\u003cli\u003eAI Agent Content Specification\u003c/li\u003e\n\u003cli\u003eJSON-LD for AI Search: Complete Guide\u003c/li\u003e\n\u003cli\u003eAnswer Format Patterns for AI Systems\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"faq\"\u003eFAQ\u003c/h2\u003e\n\u003ch3 id=\"q-do-i-still-need-html-docs-if-i-publish-openapi-plus-markdown\"\u003eQ: Do I still need HTML docs if I publish OpenAPI plus Markdown?\u003c/h3\u003e\n\u003cp\u003eYes. Human developers expect a navigable HTML reference, and search engines still rank HTML pages for long-tail discovery. Treat HTML as the presentation of the same Markdown source — never as a separate content surface. The OpenAPI + Markdown + HTML stack is a single pipeline, not three projects.\u003c/p\u003e\n\u003ch3 id=\"q-should-i-use-mcp-or-openapi-for-tool-calling-agents\"\u003eQ: Should I use MCP or OpenAPI for tool-calling agents?\u003c/h3\u003e\n\u003cp\u003eFor most teams, OpenAPI first, MCP optional. OpenAPI already describes your API completely, integrates with every LLM provider's function-calling format, and works for both human developers and agents. MCP is useful when you want to expose stateful, agent-specific operations that do not exist in your public REST surface. (Bin Wang, 2025)\u003c/p\u003e\n\u003ch3 id=\"q-how-long-should-an-endpoint-reference-page-be\"\u003eQ: How long should an endpoint reference page be?\u003c/h3\u003e\n\u003cp\u003eFor a typical CRUD endpoint, 400-900 words including code blocks. Long enough to include a canonical example, parameter table, error table, and one common pattern; short enough that an LLM can ingest the full page in a single retrieval chunk (≈ 4k tokens). Endpoints with rich behavior (webhooks, streaming, file upload) can run longer and should split into sub-pages.\u003c/p\u003e\n\u003ch3 id=\"q-how-often-should-i-regenerate-llms-txt\"\u003eQ: How often should I regenerate llms.txt?\u003c/h3\u003e\n\u003cp\u003eRegenerate on every release that changes endpoints, parameters, authentication, or error codes. For minor copy edits, a daily or weekly scheduled rebuild is sufficient. Test by loading the file into Cursor or Claude and asking specific questions about your API; if the answer is wrong, the file is wrong. (Fern, 2026)\u003c/p\u003e\n\u003ch3 id=\"q-how-do-i-measure-whether-ai-ready-api-docs-are-working\"\u003eQ: How do I measure whether AI-ready API docs are working?\u003c/h3\u003e\n\u003cp\u003eTrack three metrics: citation rate (how often Perplexity, ChatGPT, and Gemini cite your reference pages for relevant queries), agent task success rate (have an internal eval that asks Claude or GPT-5 to perform 50 representative API tasks against your docs), and SDK accuracy (rate of compilable, runnable code generated by Cursor or Copilot from your docs). All three should be tracked monthly and compared against your last spec change.\u003c/p\u003e"])</script><script>self.__next_f.push([1,"22:[\"$\",\"div\",null,{\"style\":{\"display\":\"grid\",\"gridTemplateColumns\":\"1fr min(var(--content-max-width), 100%) 1fr\",\"gap\":0,\"maxWidth\":1200,\"margin\":\"0 auto\",\"padding\":\"48px 24px 80px\"},\"children\":[[\"$\",\"div\",null,{}],[\"$\",\"article\",null,{\"children\":[[\"$\",\"h1\",null,{\"style\":{\"fontFamily\":\"var(--font-display)\",\"fontSize\":\"clamp(1.75rem, 4vw, 2.5rem)\",\"fontWeight\":400,\"lineHeight\":1.2,\"color\":\"var(--text-heading)\",\"marginBottom\":16},\"children\":\"API Content Design for AI Consumption: Patterns for Reference Docs\"}],[\"$\",\"div\",null,{\"className\":\"metadata-bar\",\"style\":{\"marginBottom\":24},\"children\":[[\"$\",\"span\",null,{\"className\":\"metadata-bar__tag metadata-bar__tag--section\",\"children\":\"technical\"}],[\"$\",\"span\",null,{\"className\":\"metadata-bar__tag\",\"children\":\"guide\"}],[\"$\",\"span\",null,{\"className\":\"metadata-bar__tag\",\"children\":\"advanced\"}],[\"$\",\"span\",null,{\"className\":\"metadata-bar__dot\"}],[\"$\",\"span\",null,{\"children\":[11,\" min read\"]}],[\"$\",\"span\",null,{\"className\":\"metadata-bar__dot\"}],[\"$\",\"span\",null,{\"children\":[\"2,018\",\" words\"]}],[[\"$\",\"span\",null,{\"className\":\"metadata-bar__dot\"}],[\"$\",\"span\",null,{\"children\":[\"Updated\",\" \",\"Apr 2026\"]}]]]}],[\"$\",\"$L26\",null,{\"title\":\"API Content Design for AI Consumption: Patterns for Reference Docs\",\"url\":\"https://geodocs.dev/technical/api-content-design-for-ai-consumption-patterns\"}],[\"$\",\"$L27\",null,{\"title\":\"API Content Design for AI Consumption: Patterns for Reference Docs\",\"url\":\"https://geodocs.dev/technical/api-content-design-for-ai-consumption-patterns\",\"section\":\"technical\",\"slug\":\"api-content-design-for-ai-consumption-patterns\"}],[\"$\",\"div\",null,{\"className\":\"prose\",\"dangerouslySetInnerHTML\":{\"__html\":\"$28\"}}],\"$L29\",false]}],\"$L2a\"]}]\n"])</script><script>self.__next_f.push([1,"23:[\"$\",\"style\",null,{\"children\":\"\\n @media (max-width: 1024px) {\\n .toc-sidebar { display: none !important; }\\n }\\n @media (min-width: 1025px) {\\n article {\\n /* override grid for 3-col with TOC */\\n }\\n }\\n .article-tag-link:hover {\\n border-color: var(--color-dark-green) !important;\\n color: var(--text-primary) !important;\\n background: rgba(0, 237, 100, 0.06) !important;\\n }\\n \"}]\n24:[\"$\",\"$L2b\",null,{\"dict\":\"$8:0:props:dict:newsletter\"}]\n"])</script><script>self.__next_f.push([1,"25:[\"$\",\"footer\",null,{\"style\":{\"background\":\"var(--color-forest-black)\",\"borderTop\":\"1px solid var(--color-teal-gray)\",\"padding\":\"64px 24px 32px\"},\"children\":[[\"$\",\"div\",null,{\"style\":{\"maxWidth\":1200,\"margin\":\"0 auto\"},\"children\":[[\"$\",\"div\",null,{\"style\":{\"display\":\"grid\",\"gridTemplateColumns\":\"repeat(auto-fit, minmax(180px, 1fr))\",\"gap\":48,\"marginBottom\":48},\"children\":[[\"$\",\"div\",null,{\"children\":[[\"$\",\"div\",null,{\"style\":{\"marginBottom\":16},\"children\":[\"$\",\"$L1a\",null,{\"src\":\"/geodocs-logo-dark.svg\",\"alt\":\"Geodocs.dev\",\"width\":140,\"height\":32,\"style\":{\"height\":24,\"width\":\"auto\"}}]}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":13,\"color\":\"var(--color-cool-gray)\",\"lineHeight\":1.6,\"maxWidth\":220},\"children\":\"Structured knowledge for AI search visibility. The canonical reference for GEO, AEO, and AI search optimization.\"}]]}],[[\"$\",\"div\",\"Learn\",{\"children\":[[\"$\",\"h4\",null,{\"style\":{\"fontFamily\":\"var(--font-mono)\",\"fontSize\":11,\"fontWeight\":600,\"textTransform\":\"uppercase\",\"letterSpacing\":2,\"color\":\"var(--color-mongodb-green)\",\"marginBottom\":16},\"children\":\"Learn\"}],[\"$\",\"ul\",null,{\"style\":{\"listStyle\":\"none\",\"display\":\"flex\",\"flexDirection\":\"column\",\"gap\":10},\"children\":[[\"$\",\"li\",\"/geo/what-is-geo\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/geo/what-is-geo\",\"className\":\"footer-link\",\"children\":\"What Is GEO?\"}]}],[\"$\",\"li\",\"/aeo/what-is-aeo\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/aeo/what-is-aeo\",\"className\":\"footer-link\",\"children\":\"What Is AEO?\"}]}],[\"$\",\"li\",\"/geo/geo-vs-seo\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/geo/geo-vs-seo\",\"className\":\"footer-link\",\"children\":\"GEO vs SEO\"}]}],[\"$\",\"li\",\"/reference/geo-aeo-glossary\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/reference/geo-aeo-glossary\",\"className\":\"footer-link\",\"children\":\"GEO Glossary\"}]}]]}]]}],[\"$\",\"div\",\"Build\",{\"children\":[[\"$\",\"h4\",null,{\"style\":{\"fontFamily\":\"var(--font-mono)\",\"fontSize\":11,\"fontWeight\":600,\"textTransform\":\"uppercase\",\"letterSpacing\":2,\"color\":\"var(--color-mongodb-green)\",\"marginBottom\":16},\"children\":\"Build\"}],[\"$\",\"ul\",null,{\"style\":{\"listStyle\":\"none\",\"display\":\"flex\",\"flexDirection\":\"column\",\"gap\":10},\"children\":[[\"$\",\"li\",\"/technical/llms-txt\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/technical/llms-txt\",\"className\":\"footer-link\",\"children\":\"llms.txt Reference\"}]}],[\"$\",\"li\",\"/technical/how-to-create-llms-txt\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/technical/how-to-create-llms-txt\",\"className\":\"footer-link\",\"children\":\"Create llms.txt\"}]}],[\"$\",\"li\",\"/technical/structured-data-for-ai-search\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/technical/structured-data-for-ai-search\",\"className\":\"footer-link\",\"children\":\"Structured Data\"}]}],[\"$\",\"li\",\"/technical/ai-txt\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/technical/ai-txt\",\"className\":\"footer-link\",\"children\":\"ai.txt Reference\"}]}]]}]]}],[\"$\",\"div\",\"Strategy\",{\"children\":[[\"$\",\"h4\",null,{\"style\":{\"fontFamily\":\"var(--font-mono)\",\"fontSize\":11,\"fontWeight\":600,\"textTransform\":\"uppercase\",\"letterSpacing\":2,\"color\":\"var(--color-mongodb-green)\",\"marginBottom\":16},\"children\":\"Strategy\"}],[\"$\",\"ul\",null,{\"style\":{\"listStyle\":\"none\",\"display\":\"flex\",\"flexDirection\":\"column\",\"gap\":10},\"children\":[[\"$\",\"li\",\"/strategy/ai-visibility-measurement\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/strategy/ai-visibility-measurement\",\"className\":\"footer-link\",\"children\":\"AI Visibility\"}]}],[\"$\",\"li\",\"/strategy/geo-content-strategy\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/strategy/geo-content-strategy\",\"className\":\"footer-link\",\"children\":\"Content Strategy\"}]}],[\"$\",\"li\",\"/strategy/geo-roi-framework\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/strategy/geo-roi-framework\",\"className\":\"footer-link\",\"children\":\"GEO ROI\"}]}],[\"$\",\"li\",\"/aeo/aeo-content-checklist\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/aeo/aeo-content-checklist\",\"className\":\"footer-link\",\"children\":\"AEO Checklist\"}]}]]}]]}],[\"$\",\"div\",\"Resources\",{\"children\":[[\"$\",\"h4\",null,{\"style\":{\"fontFamily\":\"var(--font-mono)\",\"fontSize\":11,\"fontWeight\":600,\"textTransform\":\"uppercase\",\"letterSpacing\":2,\"color\":\"var(--color-mongodb-green)\",\"marginBottom\":16},\"children\":\"Resources\"}],[\"$\",\"ul\",null,{\"style\":{\"listStyle\":\"none\",\"display\":\"flex\",\"flexDirection\":\"column\",\"gap\":10},\"children\":[[\"$\",\"li\",\"https://github.com/Geodocs-dev\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"https://github.com/Geodocs-dev\",\"className\":\"footer-link\",\"children\":\"GitHub\"}]}],[\"$\",\"li\",\"/contact\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/contact\",\"className\":\"footer-link\",\"children\":\"Contact\"}]}],[\"$\",\"li\",\"/tags\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/tags\",\"className\":\"footer-link\",\"children\":\"Tags\"}]}],[\"$\",\"li\",\"/sitemap.xml\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/sitemap.xml\",\"className\":\"footer-link\",\"children\":\"Sitemap\"}]}],\"$L2c\",\"$L2d\"]}]]}]]]}],\"$L2e\"]}],\"$L2f\"]}]\n"])</script><script>self.__next_f.push([1,"29:[\"$\",\"div\",null,{\"style\":{\"marginTop\":64},\"children\":[[\"$\",\"h2\",null,{\"style\":{\"fontSize\":18,\"fontWeight\":600,\"marginBottom\":16,\"paddingBottom\":8,\"borderBottom\":\"1px solid var(--border-default)\"},\"children\":\"Related Articles\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"grid\",\"gridTemplateColumns\":\"repeat(auto-fill, minmax(280px, 1fr))\",\"gap\":16},\"children\":[[\"$\",\"$L19\",\"404-page-ai-crawler-handling\",{\"href\":\"/technical/404-page-ai-crawler-handling\",\"style\":{\"textDecoration\":\"none\"},\"data-related-article\":\"404-page-ai-crawler-handling\",\"data-related-position\":1,\"children\":[\"$\",\"div\",null,{\"className\":\"card\",\"children\":[[\"$\",\"span\",null,{\"className\":\"badge badge-green\",\"style\":{\"marginBottom\":8},\"children\":\"guide\"}],[\"$\",\"h3\",null,{\"style\":{\"fontSize\":15,\"fontWeight\":600,\"color\":\"var(--text-heading)\",\"marginBottom\":4},\"children\":\"404 Page AI Crawler Handling: Avoiding Citation Loss During Migrations\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":13,\"color\":\"var(--text-secondary)\",\"lineHeight\":1.5},\"children\":\"Migration playbook for keeping AI citations during URL changes — hard 404 vs soft 404, 410 Gone, redirect chains, sitemap cleanup, and refetch monitoring.\"}]]}]}],[\"$\",\"$L19\",\"accept-encoding-for-ai-crawlers\",{\"href\":\"/technical/accept-encoding-for-ai-crawlers\",\"style\":{\"textDecoration\":\"none\"},\"data-related-article\":\"accept-encoding-for-ai-crawlers\",\"data-related-position\":2,\"children\":[\"$\",\"div\",null,{\"className\":\"card\",\"children\":[[\"$\",\"span\",null,{\"className\":\"badge badge-green\",\"style\":{\"marginBottom\":8},\"children\":\"specification\"}],[\"$\",\"h3\",null,{\"style\":{\"fontSize\":15,\"fontWeight\":600,\"color\":\"var(--text-heading)\",\"marginBottom\":4},\"children\":\"Accept-Encoding (Brotli, Gzip) for AI Crawlers\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":13,\"color\":\"var(--text-secondary)\",\"lineHeight\":1.5},\"children\":\"Specification for serving Brotli, gzip, and zstd to AI crawlers via Accept-Encoding negotiation: which bots support which codecs, fallback rules, and Vary handling.\"}]]}]}],[\"$\",\"$L19\",\"accept-language-and-ai-language-detection\",{\"href\":\"/technical/accept-language-and-ai-language-detection\",\"style\":{\"textDecoration\":\"none\"},\"data-related-article\":\"accept-language-and-ai-language-detection\",\"data-related-position\":3,\"children\":[\"$\",\"div\",null,{\"className\":\"card\",\"children\":[[\"$\",\"span\",null,{\"className\":\"badge badge-green\",\"style\":{\"marginBottom\":8},\"children\":\"specification\"}],[\"$\",\"h3\",null,{\"style\":{\"fontSize\":15,\"fontWeight\":600,\"color\":\"var(--text-heading)\",\"marginBottom\":4},\"children\":\"Accept-Language and AI Language Detection\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":13,\"color\":\"var(--text-secondary)\",\"lineHeight\":1.5},\"children\":\"Specification for Accept-Language negotiation and html lang attribution that lets AI crawlers detect locale correctly without cross-locale citation leaks.\"}]]}]}]]}]]}]\n"])</script><script>self.__next_f.push([1,"2a:[\"$\",\"div\",null,{\"style\":{\"paddingLeft\":40},\"className\":\"toc-sidebar\",\"children\":[\"$\",\"nav\",null,{\"style\":{\"position\":\"sticky\",\"top\":88,\"fontSize\":13,\"lineHeight\":1.6,\"maxHeight\":\"calc(100vh - 100px)\",\"overflowY\":\"auto\"},\"children\":[[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"var(--font-mono)\",\"fontSize\":10,\"fontWeight\":600,\"textTransform\":\"uppercase\",\"letterSpacing\":2,\"color\":\"var(--color-cool-gray)\",\"marginBottom\":12},\"children\":\"On this page\"}],[[\"$\",\"a\",\"why-api-docs-are-the-highest-leverage-ai-content-you-own\",{\"href\":\"#why-api-docs-are-the-highest-leverage-ai-content-you-own\",\"style\":{\"display\":\"block\",\"padding\":\"4px 0\",\"paddingLeft\":0,\"color\":\"var(--text-secondary)\",\"textDecoration\":\"none\",\"transition\":\"color 0.15s ease\",\"borderLeft\":\"none\"},\"children\":\"Why API docs are the highest-leverage AI content you own\"}],[\"$\",\"a\",\"the-three-layer-model-for-ai-consumable-api-docs\",{\"href\":\"#the-three-layer-model-for-ai-consumable-api-docs\",\"style\":{\"display\":\"block\",\"padding\":\"4px 0\",\"paddingLeft\":0,\"color\":\"var(--text-secondary)\",\"textDecoration\":\"none\",\"transition\":\"color 0.15s ease\",\"borderLeft\":\"none\"},\"children\":\"The three-layer model for AI-consumable API docs\"}],[\"$\",\"a\",\"pattern-1-lead-every-endpoint-with-a-canonical-example\",{\"href\":\"#pattern-1-lead-every-endpoint-with-a-canonical-example\",\"style\":{\"display\":\"block\",\"padding\":\"4px 0\",\"paddingLeft\":0,\"color\":\"var(--text-secondary)\",\"textDecoration\":\"none\",\"transition\":\"color 0.15s ease\",\"borderLeft\":\"none\"},\"children\":\"Pattern 1 — Lead every endpoint with a canonical example\"}],[\"$\",\"a\",\"pattern-2-make-parameter-schemas-exhaustive-not-minimal\",{\"href\":\"#pattern-2-make-parameter-schemas-exhaustive-not-minimal\",\"style\":{\"display\":\"block\",\"padding\":\"4px 0\",\"paddingLeft\":0,\"color\":\"var(--text-secondary)\",\"textDecoration\":\"none\",\"transition\":\"color 0.15s ease\",\"borderLeft\":\"none\"},\"children\":\"Pattern 2 — Make parameter schemas exhaustive, not minimal\"}],[\"$\",\"a\",\"pattern-3-treat-errors-as-first-class-content\",{\"href\":\"#pattern-3-treat-errors-as-first-class-content\",\"style\":{\"display\":\"block\",\"padding\":\"4px 0\",\"paddingLeft\":0,\"color\":\"var(--text-secondary)\",\"textDecoration\":\"none\",\"transition\":\"color 0.15s ease\",\"borderLeft\":\"none\"},\"children\":\"Pattern 3 — Treat errors as first-class content\"}],[\"$\",\"a\",\"pattern-4-ship-a-complete-openapi-3-1-spec-not-a-sampler\",{\"href\":\"#pattern-4-ship-a-complete-openapi-3-1-spec-not-a-sampler\",\"style\":{\"display\":\"block\",\"padding\":\"4px 0\",\"paddingLeft\":0,\"color\":\"var(--text-secondary)\",\"textDecoration\":\"none\",\"transition\":\"color 0.15s ease\",\"borderLeft\":\"none\"},\"children\":\"Pattern 4 — Ship a complete OpenAPI 3.1 spec, not a sampler\"}],[\"$\",\"a\",\"pattern-5-publish-an-llms-txt-index-for-the-api\",{\"href\":\"#pattern-5-publish-an-llms-txt-index-for-the-api\",\"style\":{\"display\":\"block\",\"padding\":\"4px 0\",\"paddingLeft\":0,\"color\":\"var(--text-secondary)\",\"textDecoration\":\"none\",\"transition\":\"color 0.15s ease\",\"borderLeft\":\"none\"},\"children\":\"Pattern 5 — Publish an llms.txt index for the API\"}],[\"$\",\"a\",\"pattern-6-serve-dual-surfaces-html-for-humans-markdown-for-agents\",{\"href\":\"#pattern-6-serve-dual-surfaces-html-for-humans-markdown-for-agents\",\"style\":{\"display\":\"block\",\"padding\":\"4px 0\",\"paddingLeft\":0,\"color\":\"var(--text-secondary)\",\"textDecoration\":\"none\",\"transition\":\"color 0.15s ease\",\"borderLeft\":\"none\"},\"children\":\"Pattern 6 — Serve dual surfaces: HTML for humans, Markdown for agents\"}],[\"$\",\"a\",\"pattern-7-optimize-for-direct-citation-not-pageviews\",{\"href\":\"#pattern-7-optimize-for-direct-citation-not-pageviews\",\"style\":{\"display\":\"block\",\"padding\":\"4px 0\",\"paddingLeft\":0,\"color\":\"var(--text-secondary)\",\"textDecoration\":\"none\",\"transition\":\"color 0.15s ease\",\"borderLeft\":\"none\"},\"children\":\"Pattern 7 — Optimize for direct citation, not pageviews\"}],[\"$\",\"a\",\"anti-patterns-to-remove-from-your-reference-docs\",{\"href\":\"#anti-patterns-to-remove-from-your-reference-docs\",\"style\":{\"display\":\"block\",\"padding\":\"4px 0\",\"paddingLeft\":0,\"color\":\"var(--text-secondary)\",\"textDecoration\":\"none\",\"transition\":\"color 0.15s ease\",\"borderLeft\":\"none\"},\"children\":\"Anti-patterns to remove from your reference docs\"}],\"$L30\",\"$L31\",\"$L32\",\"$L33\",\"$L34\",\"$L35\",\"$L36\",\"$L37\"]]}]}]\n"])</script><script>self.__next_f.push([1,"2c:[\"$\",\"li\",\"/llms.txt\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/llms.txt\",\"className\":\"footer-link\",\"children\":\"llms.txt\"}]}]\n2d:[\"$\",\"li\",\"/ai.txt\",{\"children\":[\"$\",\"$L19\",null,{\"href\":\"/ai.txt\",\"className\":\"footer-link\",\"children\":\"ai.txt\"}]}]\n2e:[\"$\",\"div\",null,{\"style\":{\"borderTop\":\"1px solid var(--color-teal-gray)\",\"paddingTop\":24,\"display\":\"flex\",\"justifyContent\":\"space-between\",\"alignItems\":\"center\",\"flexWrap\":\"wrap\",\"gap\":16},\"children\":[[\"$\",\"p\",null,{\"style\":{\"fontSize\":12,\"color\":\"var(--color-cool-gray)\"},\"children\":[\"© \",2026,\" Geodocs.dev. \",\"All rights reserved.\"]}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":12,\"color\":\"var(--color-cool-gray)\"},\"children\":[[\"$\",\"a\",null,{\"href\":\"mailto:contact@geodocs.dev\",\"className\":\"footer-link\",\"children\":\"contact@geodocs.dev\"}],\" · \",\"Built for humans and AI agents.\"]}]]}]\n2f:[\"$\",\"style\",null,{\"children\":\"\\n .footer-link {\\n font-size: 13px;\\n color: var(--color-silver-teal);\\n text-decoration: none;\\n transition: color 0.2s ease;\\n }\\n .footer-link:hover {\\n color: var(--color-white);\\n }\\n \"}]\n"])</script><script>self.__next_f.push([1,"30:[\"$\",\"a\",\"quality-checklist-before-publishing-an-endpoint-page\",{\"href\":\"#quality-checklist-before-publishing-an-endpoint-page\",\"style\":{\"display\":\"block\",\"padding\":\"4px 0\",\"paddingLeft\":0,\"color\":\"var(--text-secondary)\",\"textDecoration\":\"none\",\"transition\":\"color 0.15s ease\",\"borderLeft\":\"none\"},\"children\":\"Quality checklist before publishing an endpoint page\"}]\n31:[\"$\",\"a\",\"related-geodocs-references\",{\"href\":\"#related-geodocs-references\",\"style\":{\"display\":\"block\",\"padding\":\"4px 0\",\"paddingLeft\":0,\"color\":\"var(--text-secondary)\",\"textDecoration\":\"none\",\"transition\":\"color 0.15s ease\",\"borderLeft\":\"none\"},\"children\":\"Related Geodocs references\"}]\n32:[\"$\",\"a\",\"faq\",{\"href\":\"#faq\",\"style\":{\"display\":\"block\",\"padding\":\"4px 0\",\"paddingLeft\":0,\"color\":\"var(--text-secondary)\",\"textDecoration\":\"none\",\"transition\":\"color 0.15s ease\",\"borderLeft\":\"none\"},\"children\":\"FAQ\"}]\n33:[\"$\",\"a\",\"q-do-i-still-need-html-docs-if-i-publish-openapi-plus-markdown\",{\"href\":\"#q-do-i-still-need-html-docs-if-i-publish-openapi-plus-markdown\",\"style\":{\"display\":\"block\",\"padding\":\"4px 0\",\"paddingLeft\":16,\"color\":\"var(--text-secondary)\",\"textDecoration\":\"none\",\"transition\":\"color 0.15s ease\",\"borderLeft\":\"1px solid var(--border-default)\"},\"children\":\"Q: Do I still need HTML docs if I publish OpenAPI plus Markdown?\"}]\n34:[\"$\",\"a\",\"q-should-i-use-mcp-or-openapi-for-tool-calling-agents\",{\"href\":\"#q-should-i-use-mcp-or-openapi-for-tool-calling-agents\",\"style\":{\"display\":\"block\",\"padding\":\"4px 0\",\"paddingLeft\":16,\"color\":\"var(--text-secondary)\",\"textDecoration\":\"none\",\"transition\":\"color 0.15s ease\",\"borderLeft\":\"1px solid var(--border-default)\"},\"children\":\"Q: Should I use MCP or OpenAPI for tool-calling agents?\"}]\n35:[\"$\",\"a\",\"q-how-long-should-an-endpoint-reference-page-be\",{\"href\":\"#q-how-long-should-an-endpoint-reference-page-be\",\"style\":{\"display\":\"block\",\"padding\":\"4px 0\",\"paddingLeft\":16,\"color\":\"var(--text-secondary)\",\"textDecoration\":\"none\",\"transition\":\"color 0.15s ease\",\"borderLeft\":\"1px solid var(--border-default)\"},\"children\":\"Q: How long should an endpoint reference page be?\"}]\n36:[\"$\",\"a\",\"q-how-often-should-i-regenerate-llms-txt\",{\"href\":\"#q-how-often-should-i-regenerate-llms-txt\",\"style\":{\"display\":\"block\",\"padding\":\"4px 0\",\"paddingLeft\":16,\"color\":\"var(--text-secondary)\",\"textDecoration\":\"none\",\"transition\":\"color 0.15s ease\",\"borderLeft\":\"1px solid var(--border-default)\"},\"children\":\"Q: How often should I regenerate llms.txt?\"}]\n37:[\"$\",\"a\",\"q-how-do-i-measure-whether-ai-ready-api-docs-are-working\",{\"href\":\"#q-how-do-i-measure-whether-ai-ready-api-docs-are-working\",\"style\":{\"display\":\"block\",\"padding\":\"4px 0\",\"paddingLeft\":16,\"color\":\"var(--text-secondary)\",\"textDecoration\":\"none\",\"transition\":\"color 0.15s ease\",\"borderLeft\":\"1px solid var(--border-default)\"},\"children\":\"Q: How do I measure whether AI-ready API docs are working?\"}]\n"])</script><script>self.__next_f.push([1,"11:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"38:I[27201,[\"/_next/static/chunks/0ld4q8u-25eux.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"/_next/static/chunks/0xf6s51ok42m_.js\",\"/_next/static/chunks/148t.fhegq9f1.js\",\"/_next/static/chunks/05cra..ka3fzk.js\"],\"IconMark\"]\ne:null\n"])</script><script>self.__next_f.push([1,"13:[[\"$\",\"title\",\"0\",{\"children\":\"API Content Design for AI Consumption: Patterns for Reference Docs | Geodocs.dev\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Design patterns for API reference documentation that AI agents can parse, cite, and call: canonical examples, error tables, parameter schemas, and dual human/LLM delivery.\"}],[\"$\",\"meta\",\"2\",{\"name\":\"keywords\",\"content\":\"API documentation for AI consumption,LLM-friendly API docs,AI-ready API reference,OpenAPI for LLM tool calling,llms.txt for API documentation,API docs for AI agents\"}],[\"$\",\"link\",\"3\",{\"rel\":\"canonical\",\"href\":\"https://geodocs.dev/technical/api-content-design-for-ai-consumption-patterns\"}],[\"$\",\"link\",\"4\",{\"rel\":\"alternate\",\"hrefLang\":\"en\",\"href\":\"https://geodocs.dev/technical/api-content-design-for-ai-consumption-patterns\"}],[\"$\",\"link\",\"5\",{\"rel\":\"alternate\",\"hrefLang\":\"x-default\",\"href\":\"https://geodocs.dev/technical/api-content-design-for-ai-consumption-patterns\"}],[\"$\",\"meta\",\"6\",{\"property\":\"og:title\",\"content\":\"API Content Design for AI Consumption: Patterns for Reference Docs\"}],[\"$\",\"meta\",\"7\",{\"property\":\"og:description\",\"content\":\"Design patterns for API reference documentation that AI agents can parse, cite, and call: canonical examples, error tables, parameter schemas, and dual human/LLM delivery.\"}],[\"$\",\"meta\",\"8\",{\"property\":\"og:type\",\"content\":\"article\"}],[\"$\",\"meta\",\"9\",{\"property\":\"article:published_time\",\"content\":\"2026-04-29\"}],[\"$\",\"meta\",\"10\",{\"property\":\"article:modified_time\",\"content\":\"2026-04-29\"}],[\"$\",\"meta\",\"11\",{\"property\":\"article:author\",\"content\":\"Geodocs Research Team\"}],[\"$\",\"meta\",\"12\",{\"name\":\"twitter:card\",\"content\":\"summary_large_image\"}],[\"$\",\"meta\",\"13\",{\"name\":\"twitter:title\",\"content\":\"API Content Design for AI Consumption: Patterns for Reference Docs\"}],[\"$\",\"meta\",\"14\",{\"name\":\"twitter:description\",\"content\":\"Design patterns for API reference documentation that AI agents can parse, cite, and call: canonical examples, error tables, parameter schemas, and dual human/LLM delivery.\"}],[\"$\",\"link\",\"15\",{\"rel\":\"shortcut icon\",\"href\":\"/favicon.ico\"}],[\"$\",\"link\",\"16\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.0zl.ysuv3a32n.ico\",\"sizes\":\"48x48\",\"type\":\"image/x-icon\"}],[\"$\",\"link\",\"17\",{\"rel\":\"icon\",\"href\":\"/favicon.ico\"}],[\"$\",\"link\",\"18\",{\"rel\":\"apple-touch-icon\",\"href\":\"/favicon.ico\"}],[\"$\",\"$L38\",\"19\",{}]]\n"])</script></body></html>