Guide

How to serve pages as Markdown for AI agents

AI assistants process clean text faster and more accurately than HTML. When an agent sends the header Accept: text/markdown, it expects concise Markdown without navigation, ads and scripts.

Cloudflare

If you use Cloudflare on a paid plan, enable Markdown for AI in the domain settings. Cloudflare will automatically convert your pages to Markdown when an agent sends the right header.

Custom server

If you don't use Cloudflare, add middleware that returns a Markdown version of the page when the Accept: text/markdown header is present. Libraries such as turndown (JavaScript) or markdownify (Python) can convert HTML to Markdown on the fly.

Check your website — find out what AI assistants see on your pages.