Markdown for Agents
Accept: text/markdown and converts the origin HTML into Content-Type: text/markdown; charset=utf-8 in real time. [1][2]Markdown for Agents is a Cloudflare edge content-negotiation feature that converts origin HTML pages into structured Markdown on the fly when an HTTP client requests Accept: text/markdown, reducing markup token overhead for AI agents. [1] Announced in Beta by Celso Martinho and Will Allen on 2026-02-12, Markdown for Agents is Generally Available as of 2026-11-09, with conversion analytics, logs, a playground, and traces. [2][3] When a request includes text/markdown in Accept, Cloudflare fetches the origin HTML, converts it to Markdown, and serves Content-Type: text/markdown; charset=utf-8 with Vary: Accept (preserving existing origin Vary dimensions so caches separate HTML and Markdown variants). If the origin omits a content-signal header, Cloudflare attaches the default policy Content-Signal: ai-train=yes, search=yes, ai-input=yes. [1] An October 9, 2026 update moved conversion to an in-process streaming engine at the edge, raising the decompressed HTML limit from 2 MiB to 6 MiB (6,291,456 bytes) while removing Content-Length, x-markdown-tokens, and x-original-tokens from converted responses. [4]
Problem and scope
AI agents require structured data from a Web built for human browsers, where raw HTML spends tokens on markup with no semantic value: a Markdown heading (## About Us) costs roughly 3 tokens compared with 12–15 tokens for its HTML equivalent before navigation and script tags. Cloudflare's February 2026 launch blog post measured 16,180 tokens in HTML versus 3,150 tokens when converted to Markdown—an 80% reduction in token usage. [1][2] Instead of requiring agents to parse raw HTML or origins to maintain separate scraping endpoints, Cloudflare intercepts Accept: text/markdown requests at the CDN edge, strips layout boilerplate during pre-processing, and emits structured Markdown with extracted <meta> YAML frontmatter and preserved JSON-LD blocks. [1] Edge conversion applies only to HTML responses up to 6 MiB (6,291,456 bytes) after decompression on paid Pro, Business, Enterprise, and SSL for SaaS zones; for other document types or client-side rendering, Cloudflare points applications to Workers AI AI.toMarkdown() or the Browser Run /markdown endpoint. [1]
February 2026 launch-era negotiation sequence (from the introductory blog post)
Accept: text/markdown. Cloudflare fetches the origin HTML and returns content-type: text/markdown; charset=utf-8 with vary: accept, x-markdown-tokens: 725, and content-signal: ai-train=yes, search=yes, ai-input=yes. This diagram reflects the February 2026 launch-era blog specimen (including x-markdown-tokens in the sample header block). [2]February 2026 launch-era request and response specimen
curl https://developers.cloudflare.com/fundamentals/reference/markdown-for-agents/ \
-H "Accept: text/markdown"
HTTP/2 200
date: Wed, 11 Feb 2026 11:44:48 GMT
content-type: text/markdown; charset=utf-8
content-length: 2899
vary: accept
x-markdown-tokens: 725
content-signal: ai-train=yes, search=yes, ai-input=yes
---
title: Markdown for Agents · Cloudflare Agents docs
---
## What is Markdown for Agents
The ability to parse and convert HTML to Markdown has become foundational for AI.
Accept negotiation, response headers, and static Markdown siblings
On an enabled zone, Markdown for Agents is content negotiation: the client names text/markdown in Accept, and Cloudflare converts origin HTML before responding. Cloudflare's developer docs also publish that same Markdown at a static sibling path and list pages from llms.txt. [1][5]
- Accept negotiation: The client adds
Acceptwithtext/markdownas one option. Cloudflare fetches the original HTML from the origin and converts it to Markdown before responding. The documented request header isAccept: text/markdown, illustrated withcurland a Workersfetchexample that reads the response body viaconst markdown = await r.text(). [1] - Default Content-Signal policy, launch token header, and origin HTML trust boundary: If an origin already sets a
content-signalheader, Markdown for Agents preserves that value; when an origin omitscontent-signal, Cloudflare attaches the permissive defaultContent-Signal: ai-train=yes, search=yes, ai-input=yes(so origins whoserobots.txtrestricts training must send an explicitcontent-signalheader to override it). The February 2026 launch sample also included an estimated token count header (x-markdown-tokens: 725) before token headers were removed in October 2026. Because Cloudflare fetches HTML from the origin and strips only non-content markup (headers,footers,navigation,scripts,styles) rather than auditing semantic equivalence with browser HTML, an origin varying responses by request headers can serve agent-specific text (cautioned against in content-negotiation guidance warning that negotiated Markdown is not a place to tell agents something the page does not tell people), and agent harnesses treat response bodies as untrusted data rather than instructions. [1][2][6][7] - Static Markdown siblings: Request
/$page/index.md, such as/docs-for-agents/index.md, or sendAccept: text/markdown. Both return the same Markdown, powered by Markdown for Agents.llms.txtlists products, for example/workers/llms.txt, andllms-full.txt(including/workers/llms-full.txt) holds the full docs for offline indexing. [5] - Plans and Workers AI: Dashboard setup requires a Pro or Business plan, and the feature is available at no cost on Pro, Business, Enterprise, and SSL for SaaS plans. When Markdown for Agents is not available from the content source, Cloudflare documents two alternatives: Workers AI
AI.toMarkdown()converts multiple document types and supports summarization, and the Browser Run/markdownendpoint converts a dynamic page after rendering it in a real browser. [1]
Streaming conversion limits, Vary caching, and Free-plan workarounds
On 9 October 2026 Cloudflare's edge converter moved to an in-process streaming engine and raised its HTML size cap. Negotiated Markdown responses carry Vary: Accept, which separates HTML and Markdown in caches that key on Vary. Because the edge converter is not available on the Free plan and Cloudflare's Free cache stores a single variant per URL regardless of Vary, Free-plan operators serving Markdown from their own origin must split the cache key or publish distinct .md URLs. [4][8]
- Streaming size limit: Since the
2026-10-09streaming engine update, HTML is processed as it arrives rather than buffered for a separate conversion service. The decompressed cap is 6 MiB (6,291,456 bytes), up from 2 MiB (2,097,152 bytes), measured after decompression; that earlier 2 MiB (2,097,152 bytes) origin response limit dated from2026-02-16, when Cloudflare raised it from 1 MB.x-markdown-tokensandx-original-tokensare no longer sent, andContent-Lengthis removed because the body is streamed. [4][9] - Stripped HTML and frontmatter: Pre-processing strips headers, footers, navigation, scripts, and styles. Separately, Cloudflare's own developer-docs build pipeline removes
script,style, andlinktags and turns interactiveTabscomponents into unordered lists. YAML frontmatter is emitted only when a supported meta tag exists, usingtitle,description, andimagewhen those fields have values. JSON-LD remains a fencedjsonblock when present. [1][5] - Vary across plan tiers: Edge-converted responses include
AcceptinVary(preserving any originVarydimensions) so caches can store separate Markdown and HTML variants. By default Cloudflare does not considerVaryvalues in caching decisions, with exceptions forvary: accept-encoding, for images, and for the Cache RulesVarysetting, which must be turned on. Cloudflare's edge Markdown for Agents converter requires a paid zone (dashboard setup names Pro or Business, with availability on Pro, Business, Enterprise, and SSL for SaaS) and is not available on the Free plan. [1][6][8] - Origin-served Markdown on Free-plan zones: Operators on the Free plan can negotiate
Accept: text/markdownat their own origin (such as Caddytry_files {path}index.md {path}/index.mdsendingVary: Accept), but Cloudflare's Free cache stores one variant per URL regardless ofVary—serving cached HTML to Markdown clients or cached Markdown to browsers. A Free-plan Transform Rule (up to 10 rules, running at phase 3 before cache lookup at phase 19) that rewritesAccept: text/markdownrequests with query parameter_fmt=md(turning/blog/into/blog/?_fmt=md) splits the cache into two entries; direct static URLs (such as origin{path}/index.mdfiles, analogous to Cloudflare's own docs/$page/index.mdsibling paths) do not depend onVary. [5][8]
Adoption and ecosystem
Origins & documentation hosts serving text/markdown
| Actor | Role | Status | Negotiation header, token count & scope | Source |
|---|---|---|---|---|
| Cloudflare (Edge network, Developer Docs & Blog) | Edge network & documentation | Live (HTTP 200) · checked 2026-11-04 | Per-zone edge conversion (Accept: text/markdown -> text/markdown; charset=utf-8, content-signal: ai-train=yes, search=yes, ai-input=yes); live on Docs and Blog. | Cloudflare, Markdown for Agents (modified 2026-10-09; fetched 2026-11-04) [1] · Celso Martinho and Will Allen, Introducing Markdown for Agents (2026-02-12; fetched 2026-11-04) [2][3] |
| Read the Docs | Docs platform & host | Live (HTTP 200) · checked 2026-11-03 | Enabled automatically across hosted docs; live Accept: text/markdown probe returns text/markdown; charset=utf-8 (vary: Accept-Encoding, accept). | Read the Docs, Markdown for AI agents [16] · Read the Docs stable docs (fetched 2026-11-03) [17] · Cloudflare, More efficient Markdown for Agents conversion (2026-10-09) [4] |
| Zep | Product site | Live (HTTP 200) · checked 2026-11-03 | Negotiated text/markdown; charset=utf-8 with content-signal: ai-train=yes, search=yes, ai-input=yes (server: cloudflare). | Zep (fetched 2026-11-03) [18] |
| Taskade | Product site | Live (HTTP 200) · checked 2026-11-03 | Negotiated text/markdown; charset=utf-8 with content-signal: ai-train=yes, search=yes, ai-input=yes (server: cloudflare). | Taskade (fetched 2026-11-03) [19] |
| Replicate | Product site | Live (HTTP 200) · checked 2026-11-03 | HTTP/2 200 text/markdown; charset=utf-8 with vary: Accept-Encoding, accept via server: cloudflare. | Replicate (fetched 2026-11-03) [20] |
| PlanetScale | Product site | Live (HTTP 200) · checked 2026-11-03 | HTTP/2 200 text/markdown; charset=utf-8 with vary: accept-encoding, accept via server: cloudflare. | PlanetScale (fetched 2026-11-03) [21] |
| Cursor (Docs) | Developer documentation (cursor.com/docs) | Live (HTTP 200) · checked 2026-11-04 | HTTP 200 content-type: text/markdown; charset=utf-8, vary: Accept, link: </llms.txt>; rel="describedby". | cursor.com/docs [22] |
| Mintlify | Documentation platform | Supported · checked 2026-11-06 | Returns Markdown for Accept: text/markdown or Accept: text/plain. | Mintlify, Markdown export [23] |
Coding agents, harnesses & SDK tools
| Actor | Role | Status | Accept: text/markdown behavior & surface | Source |
|---|---|---|---|---|
| Anthropic Claude Code | Coding agent | Observed fetching · as of 2026-02-19 | WebFetch (v2.1.38) sends Accept: text/markdown, text/html, */* in Checkly's 2026-02-19 test. | Anthropic, Tools reference [24] · Stefan Judis, Checkly (2026-02-19) [25] |
| Cursor | Coding agent | Observed fetching · as of 2026-02-19 | Cursor 2.4.28 WebFetch sends Accept: text/markdown,text/html;q=0.9,application/xhtml+xml;q=0.8,application/xml;q=0.7,image/webp;q=0.6,*/*;q=0.5. | Stefan Judis, Checkly (2026-02-19) [25] |
| OpenCode | Coding agent | Observed fetching · checked 2026-10-30 | webfetch defaults to Markdown with text/markdown;q=1.0 above text/html;q=0.7. | OpenCode, Tools [7] · OpenCode, webfetch.ts [26] |
| Cloudflare Agents SDK | SDK tool | Supported · as of 2026-10-12 | Agents SDK web_fetch tool requests Markdown directly from supporting sites (2026-10-12). | Cloudflare, AI Changelog: web_fetch tool (2026-10-12) [27] |
| Gemini CLI | Coding agent | Development · checked 2026-11-04 | Floating main branch sends text/markdown, text/plain;q=0.9, application/json;q=0.9, text/html;q=0.8 ahead of */*;q=0.5; released 0.28.2 sent Accept: */*. | google-gemini/gemini-cli (web-fetch.ts) [28] · Checkly (Feb 2026 study) [25] |
| Copilot Chat (VS Code) | Coding agent | Observed fetching · as of 2026-06-22 | Sends q-valued Accept: text/markdown (verified 2026-06-22). | AcceptMarkdown client matrix [29] |
| Copilot CLI | Coding agent | Observed fetching · as of 2026-06-22 | Sends Accept: text/markdown, text/html, */* (verified 2026-06-22). | AcceptMarkdown client matrix [29] |
| Microsoft Copilot | Coding agent | Observed fetching · as of 2026-06-22 | Sends Accept: text/markdown, text/html, */* (verified 2026-06-22). | AcceptMarkdown client matrix [29] |
| OpenClaw | Coding agent | Observed fetching · as of 2026-05-04 | Sends Accept: text/markdown (verified 2026-05-04). | AcceptMarkdown client matrix [29] |
| Codex CLI | Coding agent | Partial · as of 2026-04-18 | Partial: follows an alternate text/markdown link (verified 2026-04-18). | AcceptMarkdown client matrix [29] |
Content-negotiation scanner
| Actor | Role | Status | Checks | Source |
|---|---|---|---|---|
| AcceptMarkdown scanner | Negotiation checker | Listed · checked 2026-11-06 | Checks Accept: text/markdown, Vary: Accept, status 406, and q values. | AcceptMarkdown checker [30] |
Ecosystem censuses
- Checkly State of AI Agent Content Negotiation (2026-02-19) (as of 2026-02-19): In Stefan Judis's February 19, 2026 Checkly content-negotiation test of seven coding agents, 3 out of 7 agents (Claude Code, Cursor, and OpenCode) requested text/markdown in their Accept header, whereas OpenAI Codex, Gemini CLI, GitHub Copilot, and Windsurf requested only HTML or wildcard media types. [25]
- AcceptMarkdown client matrix (as of 2026-06-22): The AcceptMarkdown client matrix (last updated 2026-06-22) records Claude Code, Copilot Chat (VS Code), Copilot CLI, Cursor, Microsoft Copilot, OpenClaw, and OpenCode as sending Accept: text/markdown, marks Codex CLI as Partial, and lists Aider, ChatGPT (browse), Claude.ai, Cline, Devin, Gemini (web app), Gemini CLI, Grok, Perplexity, v0, Windsurf, and Zed as fetching only HTML. [29]
See also
- Open Knowledge Format (Complements) — Markdown for Agents converts HTML when Accept includes text/markdown; OKF stores Markdown files.
- Read protocols — Category index for
readstandards. - HTML DOM & RSS vs Accept: text/markdown & OKF (classic vs agentic) — head-to-head comparison
- Open Knowledge Format vs Markdown for Agents — head-to-head comparison
- Markdown for Agents vs llms.txt — head-to-head comparison
References
- Cloudflare, Markdown for Agents, modified 2026-10-09; fetched 2026-11-04 — https://developers.cloudflare.com/fundamentals/reference/markdown-for-agents/
- Celso Martinho and Will Allen (Cloudflare), Introducing Markdown for Agents, published 2026-02-12; modified 2026-07-15; fetched 2026-11-04 — https://blog.cloudflare.com/markdown-for-agents/
- Cloudflare, Markdown for Agents analytics and tracing, published 2026-11-09 — https://developers.cloudflare.com/changelog/post/2026-11-09-markdown-for-agents-observability/
- Cloudflare, More efficient Markdown for Agents conversion, published 2026-10-09 — https://developers.cloudflare.com/changelog/post/2026-10-09-markdown-for-agents-in-process-conversion/
- Cloudflare, AI consumability, last updated 20 August 2026; fetched 2026-11-06 — https://developers.cloudflare.com/style-guide/how-we-docs/ai-consumability
- Good for Bots, How to serve Markdown to AI agents with content negotiation, published 2026-10-03 — https://goodforbots.com/guides/markdown-negotiation
- OpenCode, Tools, checked 2026-10-30 — https://opencode.ai/v2/docs/tools/
- Michael Olson, Markdown for Agents on the Cloudflare Free Plan, February 2026; fetched 2026-11-06 — https://mwolson.org/blog/2026-02-14-markdown-for-agents-on-cloudflare-free-plan
- Cloudflare, Content encoding support for Markdown for Agents and other improvements, published 2026-02-16 — https://developers.cloudflare.com/changelog/post/2026-02-16-markdown-for-agents-improvements/
- R. Fielding, M. Nottingham, and J. Reschke (IETF), RFC 9110: HTTP Semantics, published June 2022 — https://www.rfc-editor.org/rfc/rfc9110.html
- S. Leonard (Penango, Inc. / IETF), RFC 7763: The text/markdown Media Type, published March 2016 — https://www.rfc-editor.org/rfc/rfc7763.html
- Jeremy Howard, The /llms.txt file, v2, published 2024-09-03; modified 2026-08-10; HTTP last-modified 2026-09-24 — https://llmstxt.org
- Vercel and Ora, Make your site readable by AI agents | Vercel Knowledge Base, published 2026-08-28; updated 2026-09-03; fetched 2026-10-30 — https://vercel.com/kb/guide/make-your-site-readable-by-ai-agents
- Cloudflare, Giving users choice with Cloudflare's new Content Signals Policy, published 2025-09-24; modified 2026-07-15 — https://blog.cloudflare.com/content-signals-policy/
- M. Koster, G. Illyes, H. Zeller, and L. Sassman (IETF), RFC 9309: Robots Exclusion Protocol, published September 2022 — https://www.rfc-editor.org/rfc/rfc9309.html
- Read the Docs, Markdown for AI agents, checked 2026-10-30 — https://docs.readthedocs.com/platform/latest/reference/markdown-for-agents.html
- Read the Docs, Read the Docs: documentation simplified, fetched 2026-11-03 — https://docs.readthedocs.com/platform/stable/
- Zep, Zep | The unified context layer for enterprise data, fetched 2026-11-03 — https://www.getzep.com/
- Taskade, Turn Business Processes Into Live Apps | Taskade Genesis, fetched 2026-11-03 — https://www.taskade.com/
- Replicate, Run and fine-tune models. Deploy custom models. All with one line of code., fetched 2026-11-03 — https://replicate.com/
- PlanetScale, PlanetScale - the world’s fastest and most scalable cloud hosting for Vitess, Neki, and Postgres, fetched 2026-11-03 — https://planetscale.com/
- Cursor (Docs), cursor.com/docs, checked 2026-11-04 — https://cursor.com/docs
- Mintlify, Markdown export, fetched 2026-11-06 — https://www.mintlify.com/docs/ai/markdown-export
- Anthropic, Tools reference, checked 2026-10-30 — https://code.claude.com/docs/en/tools-reference
- Stefan Judis (Checkly), The Current State of Content Negotiation for AI Agents (Feb 2026), published 2026-02-19 — https://www.checklyhq.com/blog/state-of-ai-agent-content-negotation/
- OpenCode, webfetch.ts, checked 2026-10-30 — https://raw.githubusercontent.com/anomalyco/opencode/dev/packages/core/src/tool/plugin/webfetch.ts
- Cloudflare, AI Changelog: New web_fetch tool in the Agents SDK, 2026-10-12 — https://developers.cloudflare.com/changelog/product-group/ai/
- Gemini CLI, google-gemini/gemini-cli (web-fetch.ts), checked 2026-11-04 — https://raw.githubusercontent.com/google-gemini/gemini-cli/main/packages/core/src/tools/web-fetch.ts
- AcceptMarkdown, AI agent support matrix, last updated 2026-06-22; fetched 2026-11-06 — https://acceptmarkdown.com/status
- AcceptMarkdown, Accept: text/markdown checker, fetched 2026-11-06 — https://acceptmarkdown.com/