NewAgent-ready skill for Claude Code, Cursor and Codex →
AgentsReady
Guides · As of

How to serve markdown to AI agents

Serving markdown for agents means returning a clean markdown version of a page when a client asks for it with an Accept: text/markdown header, from the same URL, with Content-Type: text/markdown and Vary: Accept so caches keep the two versions apart. Agents read markdown with far fewer tokens than HTML: Vercel measured one of its pages at about 500KB of HTML and 3KB of markdown. Cloudflare can convert pages at the edge, and frameworks like Next.js can do it with a rewrite.

From our data: As of 3 Nov 2026, 101 of the 214 software vendors in our rankings served their docs as markdown, either through Accept: text/markdown or .md links in llms.txt. Cloudflare's Radar scan of the top 200,000 domains (published 17 Apr 2026) found 3.9% passed its markdown negotiation check.

The request and the response

GET /pricing HTTP/1.1
Host: example.com
Accept: text/markdown, text/html;q=0.9

HTTP/1.1 200 OK
Content-Type: text/markdown; charset=utf-8
Vary: Accept
Link: <https://example.com/pricing>; rel="canonical"

---
title: Pricing
description: Plans for Example Co, as of Nov 2026.
---

# Pricing

- Free: $0, 3 projects
- Team: $12 per user a month

Three ways to ship it

  1. Cloudflare: turn it on

    Markdown for Agents converts HTML at the edge for requests that ask for markdown, on Pro, Business and Enterprise plans and SSL for SaaS at no extra cost. Enable it in AI Crawl Control, through the API (the content_converter zone setting), or for specific paths with a Configuration Rule. It adds YAML frontmatter from your meta tags and keeps your JSON-LD.

  2. Your framework: a rewrite

    In Next.js, Vercel rewrites requests whose Accept header includes text/markdown to a route handler that returns the markdown with Content-Type: text/markdown. Any server can do the same with content negotiation.

  3. .md URLs

    Serve page.md next to each page and advertise it with <link rel="alternate" type="text/markdown" href="...">, as the llms.txt proposal suggests. GitBook and Mintlify do this for docs automatically.

// next.config.ts: send markdown requests for /blog/* to a route handler
export default {
  async rewrites() {
    return {
      beforeFiles: [{
        source: "/blog/:slug",
        has: [{ type: "header", key: "accept", value: "(.*)text/markdown(.*)" }],
        destination: "/blog/md/:slug",
      }],
    };
  },
};

Get the details right

  1. Always send Vary: Accept

    Without it, a cache can serve markdown to a browser or HTML to an agent.

  2. Keep the content identical

    Same facts, prices and dates as the HTML. Generate both from one source so they can't drift.

  3. Advertise it

    Many agents don't send the header. Cloudflare cites a February 2026 Checkly test in which only Claude Code, OpenCode and Cursor did by default, so also add the alternate link in your HTML head or a Link header.

  4. Fall back to HTML

    If a page has no markdown version, return the HTML with its normal content type, not an error.

  5. Keep a markdown sitemap

    Vercel serves /blog/sitemap.md and /docs/sitemap.md so agents can list pages without parsing XML.

Vendors whose docs serve markdown

101 of the vendors in our rankings, from our scan on 3 Nov 2026.

VendorCategoryDocs host
AnthropicRe-check liveAI model APIplatform.claude.com
Fireworks AIRe-check liveAI model APIdocs.fireworks.ai
Google Gemini APIRe-check liveAI model APIaistudio.google.com
OpenAIRe-check liveAI model APIdevelopers.openai.com
OpenRouterRe-check liveAI model APIopenrouter.ai
ReplicateRe-check liveAI model APIreplicate.com
Together AIRe-check liveAI model APIdocs.together.ai
xAIRe-check liveAI model APIdocs.x.ai
AshbyRe-check liveATSdevelopers.ashbyhq.com
WorkableRe-check liveATSapply.workable.com
Auth0Re-check liveauth providerauth0.com
Better AuthRe-check liveauth providerbetter-auth.com
ClerkRe-check liveauth providerclerk.com
DescopeRe-check liveauth providerdocs.descope.com
FusionAuthRe-check liveauth providerfusionauth.io
StytchRe-check liveauth providerstytch.com
SuperTokensRe-check liveauth providersupertokens.com
WorkOSRe-check liveauth providerworkos.com
GhostRe-check liveCMSdocs.ghost.org
PayloadRe-check liveCMSpayloadcms.com
PrismicRe-check liveCMSprismic.io
StrapiRe-check liveCMSdocs.strapi.io
WebflowRe-check liveCMSdevelopers.webflow.com
AffinityRe-check liveCRMdeveloper.affinity.co
CloseRe-check liveCRMdeveloper.close.com
folkRe-check liveCRMdeveloper.folk.app
PipedriveRe-check liveCRMdevelopers.pipedrive.com
TwentyRe-check liveCRMdocs.twenty.com
ZohoRe-check liveCRMwww.zoho.com
AppwriteRe-check livedatabase or backend platformappwrite.io
CockroachDBRe-check livedatabase or backend platformdocs.cockroachlabs.com
ConvexRe-check livedatabase or backend platformdocs.convex.dev
MongoDBRe-check livedatabase or backend platformwww.mongodb.com
NeonRe-check livedatabase or backend platformneon.com
PlanetScaleRe-check livedatabase or backend platformplanetscale.com
SupabaseRe-check livedatabase or backend platformsupabase.com
TursoRe-check livedatabase or backend platformdocs.turso.tech
UpstashRe-check livedatabase or backend platformupstash.com
XataRe-check livedatabase or backend platformxata.io
BigCommerceRe-check livee-commerce platformdocs.bigcommerce.com
EcwidRe-check livee-commerce platformdocs.ecwid.com
MedusaRe-check livee-commerce platformdocs.medusajs.com
ShopifyRe-check livee-commerce platformshopify.dev
WixRe-check livee-commerce platformdevelopers.google.com
BoldSignRe-check livee-signature tooldevelopers.boldsign.com
SignNowRe-check livee-signature toolwww.signnow.com
SignWellRe-check livee-signature toolwww.signwell.com
beehiivRe-check liveemail marketing platformdevelopers.beehiiv.com
BrevoRe-check liveemail marketing platformdevelopers.brevo.com
Customer.ioRe-check liveemail marketing platformdocs.customer.io
KitRe-check liveemail marketing platformdevelopers.kit.com
LoopsRe-check liveemail marketing platformloops.so
MailchimpRe-check liveemail marketing platformmailchimp.com
MailerLiteRe-check liveemail marketing platformdevelopers.mailerlite.com
ResendRe-check liveemail marketing platformresend.com
BirdRe-check liveemail or SMS APIbird.com
MailgunRe-check liveemail or SMS APIdocumentation.mailgun.com
MailtrapRe-check liveemail or SMS APIdocs.mailtrap.io
PostmarkRe-check liveemail or SMS APIpostmarkapp.com
SendGridRe-check liveemail or SMS APIwww.twilio.com
SinchRe-check liveemail or SMS APIdevelopers.sinch.com
TelnyxRe-check liveemail or SMS APIdevelopers.telnyx.com
TwilioRe-check liveemail or SMS APIwww.twilio.com
ERPNextRe-check liveERPdocs.frappe.io
KatanaRe-check liveERPdeveloper.katanamrp.com
PlainRe-check livehelp deskwww.plain.com
ZendeskRe-check livehelp deskdeveloper.zendesk.com
DeelRe-check liveHRMSdeveloper.deel.com
WorkdayRe-check liveHRMSdeveloper.workday.com
AxiomRe-check liveobservability toolaxiom.co
DatadogRe-check liveobservability tooldocs.datadoghq.com
ElasticRe-check liveobservability toolwww.elastic.co
GrafanaRe-check liveobservability toolgrafana.com
HoneycombRe-check liveobservability tooldocs.honeycomb.io
PagerDutyRe-check liveobservability tooldocs.pagerduty.com
SentryRe-check liveobservability tooldocs.sentry.io
AdyenRe-check livepayments platformdocs.adyen.com
Checkout.comRe-check livepayments platformwww.checkout.com
MollieRe-check livepayments platformdocs.mollie.com
PaddleRe-check livepayments platformdeveloper.paddle.com
PolarRe-check livepayments platformpolar.sh
RazorpayRe-check livepayments platformrazorpay.com
SquareRe-check livepayments platformdeveloper.squareup.com
StripeRe-check livepayments platformdocs.stripe.com
AmplitudeRe-check liveproduct analytics toolamplitude.com
MixpanelRe-check liveproduct analytics tooldocs.mixpanel.com
PostHogRe-check liveproduct analytics toolposthog.com
SegmentRe-check liveproduct analytics toolwww.twilio.com
StatsigRe-check liveproduct analytics tooldocs.statsig.com
AsanaRe-check liveproject management toolasana.com
LinearRe-check liveproject management toollinear.app
monday.comRe-check liveproject management toolyes
NotionRe-check liveproject management tooldevelopers.notion.com
WrikeRe-check liveproject management tooldevelopers.wrike.com
Acuity SchedulingRe-check livescheduling tooldevelopers.acuityscheduling.com
Cal.comRe-check livescheduling toolcal.com
CalendlyRe-check livescheduling tooldeveloper.calendly.com
SavvyCalRe-check livescheduling tooldocs.savvycal.com
DudaRe-check livewebsite builderdeveloper.duda.co
FramerRe-check livewebsite builderwww.framer.com
HostingerRe-check livewebsite builderdocs.hostinger.com

Check it yourself

You want content-type: text/markdown and vary: Accept. If you get text/html back, agents that ask for markdown get your full HTML instead. Try a docs or blog URL too, since many sites only convert those.

curl -s -D - -o /dev/null -H "Accept: text/markdown" https://example.com/ \
  | grep -iE "^(content-type|vary|link):"
Run the free check on your siteGet the full checklist

Questions

Is serving markdown to agents cloaking?

Not when the content is the same. It's the same page in another format, chosen by the client's Accept header, at the same URL with Vary: Accept. Keep facts identical and don't serve markdown to browsers.

Is this the same as llms.txt?

No. llms.txt is one index file listing your key pages. Markdown for agents gives every page a markdown version. They work together: link the .md versions from llms.txt.

Does Google use markdown versions?

Google's AI optimization guide says Search doesn't use markdown files. The benefit is for agents that read pages directly, which load them faster and with far fewer tokens.

Do I need a paid Cloudflare plan?

Yes, for the edge conversion: Cloudflare lists Pro, Business and Enterprise plans and SSL for SaaS. On any plan or host you can serve markdown yourself from your app.