TSEP · Source conservée

Cloudflare — Markdown for Agents

Vue texte dérivée de la capture ; le document original reste la preuve.

Affirmations et preuves · Télécharger l’original gzip · Source de l’éditeur

Origine et méthode

SHA-256
d3e7bff2270260b7450ac610cd28e243b355b2f914c8cee753c0972889bfcdd3
Capture
Collecte
anonymous_http_response_body
Vue texte
Extraction du texte du DOM ; scripts, styles et contenus intégrés omis

L’empreinte des octets décompressés a été vérifiée avant cet affichage. Le texte est échappé ; aucun script ni ressource du document source n’est exécuté. La présentation, les images et l’ordre de lecture peuvent différer de l’original.

Texte de la source éditrice : Cloudflare — Markdown for Agents. Reproduit pour vérification ; les droits et licences d’origine restent applicables. Demande de retrait : agence@edikka.com.

Passage référencé

#how-to-use — How to use; #response-headers — Response headers; #content-signals-policy — Content Signals Policy

AIA-topic-formats-1 AIA-topic-formats-2

Extrait du nœud HTML portant l’identifiant cité et, pour un titre, de sa section.

How to use

---

Response headers

---

Content Signals Policy

Texte de la capture

Skip to contentDocumentation Index

Fetch the complete documentation index at: https://developers.cloudflare.com/fundamentals/llms.txt

Use this file to discover all available pages before exploring further.

DocsDirectoryAPISDKsChangelog

SearchCtrlK

Log inDashboard

Home

/Cloudflare Fundamentals

/Reference

/Markdown for Agents

Markdown for Agents

Last updated Nov 9, 2026|Copy as Markdown|View as Markdown|Agent setup
OverviewWhat is Markdown for AgentsHow to use Response headers Content Signals PolicyOutput format YAML frontmatter JSON-LDHow to enable Enable for specific subdomains or paths Enable for specific subdomains or paths Enable for all custom hostnames Enable for specific custom hostnamesAnalytics Dashboard GraphQL Analytics API Interpret analyticsCloudflare TracesAvailability and PricingTry it with CloudflareLimitationsOther Markdown conversion APIs

What is Markdown for Agents

Markdown has quickly become the lingua franca for agents and AI systems as a whole. The format’s explicit structure makes it ideal for AI processing, ultimately resulting in better results while minimizing token waste.

Cloudflare's network supports real-time content conversion at the source, for enabled zones using content negotiation ↗︎ headers. When AI systems request pages from any website that uses Cloudflare and has Markdown for Agents enabled, they can express the preference for text/markdown in the request and our network will automatically and efficiently convert the HTML to Markdown, when possible, on the fly.

Read the announcement ↗︎ in our blog for more information.

How to use

To fetch the Markdown version of any page from a zone with Markdown for Agents enabled, the client needs to add the Accept negotiation header with text/markdown as one of the options. Cloudflare will detect this, fetch the original HTML version from the origin, and convert it to Markdown before serving it to the client.

Here's a curl example with the Accept negotiation header requesting this page from our developer documentation:

curl https://developers.cloudflare.com/fundamentals/reference/markdown-for-agents/ \
-H "Accept: text/markdown"

Or if you’re building an AI Agent using Workers, you can use TypeScript:

const r = await fetch(
`https://developers.cloudflare.com/fundamentals/reference/markdown-for-agents/`,
{
headers: {
Accept: "text/markdown",
},
},
);
const markdown = await r.text();

const r = await fetch(
`https://developers.cloudflare.com/fundamentals/reference/markdown-for-agents/`,
{
headers: {
Accept: "text/markdown",
},
},
);
const markdown = await r.text();

The response to this request is now formatting in markdown:

HTTP/2 200
date: Wed, 11 Feb 2026 11:44:48 GMT
content-type: text/markdown; charset=utf-8
vary: accept
cache-control: public, max-age=3600
strict-transport-security: max-age=63072000; includeSubDomains
content-signal: ai-train=yes, search=yes, ai-input=yes

---
title: Markdown for Agents · Cloudflare Agents docs
---

## What is Markdown for Agents

Markdown has quickly become the lingua franca for agents and AI systems
as a whole. The format’s explicit structure makes it ideal for AI processing,
ultimately resulting in better results while minimizing token waste.
...

Response headers

Markdown for Agents preserves the headers from your origin response on the converted response, so security- and cache-relevant headers survive conversion. This includes headers such as Strict-Transport-Security (HSTS), Content-Security-Policy (CSP), X-Frame-Options, Set-Cookie, CORS headers (for example, Access-Control-Allow-Origin), and caching headers (Cache-Control, Expires, Age).

Because the body is replaced with converted Markdown, the following changes are applied:

Content-Type is set to text/markdown; charset=utf-8.

Vary includes Accept (any Vary dimensions your origin already declared are preserved) so that caches store separate variants for Markdown and HTML.

Content-Length is removed because the Markdown response is streamed.

Headers that describe the original body are removed, because they no longer match the converted response: Content-Encoding, Content-Range, Transfer-Encoding, ETag, and Last-Modified. ETag and Last-Modified are dropped because conditional requests (If-None-Match, If-Modified-Since) cannot be honored for converted responses.

Content Signals Policy

Content Signals ↗︎ is a framework that allows anyone to express their preferences for how their content can be used after it has been accessed.

If your origin already sets a content-signal header, Markdown for Agents preserves that value on the converted response — your origin's policy is authoritative. This lets you define custom Content Signal policies by setting the content-signal header at your origin.

When the origin response does not include a content-signal header, Markdown for Agents adds a default Content-Signal: ai-train=yes, search=yes, ai-input=yes, signaling that the content can be used for AI Training, Search results, and AI Input, which includes agentic use.

Output format

Markdown for Agents returns a Markdown document with a consistent, predictable structure so AI systems can rely on it without per-site parsing logic. The response always follows this layout:

YAML frontmatter with metadata extracted from the page's <meta> tags. Only emitted when at least one supported meta tag is present.

Body Markdown converted from the document body. Non-content elements (such as headers, footers, navigation, scripts, and styles) are stripped during pre-processing. For the full list of elements that are removed, refer to HTML pre-processing in the Workers AI Markdown Conversion documentation.

JSON-LD structured data preserved as a fenced json code block at the end of the document. Only emitted when the source HTML contains JSON-LD.

YAML frontmatter

When the source HTML contains supported <meta> tags, Markdown for Agents prepends a YAML frontmatter block to the response. The block uses the following fields:

Field
Source <meta> tag

title
<meta name="title">, with fallback to <meta property="og:title">

description
<meta name="description">, with fallback to <meta property="og:description">

image
<meta property="og:image">

Only fields with a value are emitted. If the source HTML does not contain any of the supported meta tags, the frontmatter block is omitted entirely.

For title and description, the standard <meta name="..."> form always takes priority over the Open Graph <meta property="og:..."> form, regardless of the order they appear in the HTML. Open Graph values are used only as fallbacks when the standard form is missing.

Example output:

---
title: My Page Title
description: A short summary of the page.
image: https://example.com/cover.png
---

# Page heading

...

JSON-LD

JSON-LD ↗︎ is a structured-data format used by search engines and AI systems to interpret a page's semantic content. Markdown for Agents preserves any <script type="application/ld+json"> blocks from the source HTML by appending them at the end of the converted Markdown inside a single fenced json code block.

If the source HTML contains multiple JSON-LD scripts, all of them are concatenated within the same code block, each on its own line.

JSON-LD is the only <script> content preserved in the output — all other <script> and <style> content is stripped during HTML pre-processing.

Example output:

... main markdown content ...

```json
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "Article Title",
"author": { "@type": "Person", "name": "Jane Doe" }
}
```

How to enable

To enable Markdown for Agents for your zone in the dashboard:

In the Cloudflare dashboard, select your zone and go to Agent Readiness > Markdown for Agents.

Go to Markdown for Agents ↗

Turn on Serve Markdown to AI agents. You need permission to edit zone settings and a supported plan.

Enable for specific subdomains or paths

To enable Markdown for Agents for specific subdomains or paths instead of your entire zone, create a configuration rule:

Log in to the Cloudflare dashboard ↗︎ and select your account.

Select the zone you want to configure.

Go to Rules > Overview and select Create rule > Configuration Rules.

Under When incoming requests match, build an expression to match your subdomain (for example, http.host eq "docs.example.com") or path.

Under Then the settings are, select Add setting > Markdown for Agents and set it to On.

Select Deploy.

To enable Markdown for Agents for your zone using APIs, send a PATCH to /client/v4/zones/{zone_tag}/settings/content_converter with the payload {"value": "on"} to the Cloudflare API.

You will need to create an API token with the Zone Settings edit permissions enabled.

Example:
Enable Markdown for Agentsbash
curl -X PATCH 'https://api.cloudflare.com/client/v4/zones/{zone_tag}/settings/content_converter' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer {api_token}" --data-raw '{"value": "on"}'

Enable for specific subdomains or paths

To enable Markdown for Agents for specific subdomains or paths instead of your entire zone, create a configuration rule:
Enable Markdown for Agents for a subdomainbash
curl --request PUT \
--url "https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets/phases/http_config_settings/entrypoint" \
--header "Authorization: Bearer {api_token}" \
--header "Content-Type: application/json" \
--data '{
"rules": [{
"expression": "http.host eq \"docs.example.com\"",
"action": "set_config",
"action_parameters": {
"content_converter": true
},
"description": "Enable Markdown for Agents for docs subdomain"
}]
}'

You can also use path-based expressions like starts_with(http.request.uri.path, "/blog/"). For more information on building expressions, refer to Rules language.

If you are using Cloudflare for SaaS and want to enable Markdown for Agents for your custom hostnames, you have two options:

Enable for all custom hostnames

To enable Markdown for Agents for all custom hostnames on your SaaS zone:

Log into the Cloudflare dashboard ↗︎ and select your account.

Select your SaaS zone.

Look for Quick Actions.

Toggle the Markdown for Agents button to enable.

Enable for specific custom hostnames

Enabling Markdown for Agents for specific custom hostnames requires an advanced subscription with access to custom metadata.

Step 1: Set custom metadata on the custom hostname

When creating or updating a custom hostname via API, add content_converter to the custom_metadata object:

curl --request PATCH \
--url "https://api.cloudflare.com/client/v4/zones/{zone_id}/custom_hostnames/{custom_hostname_id}" \
--header "Authorization: Bearer {api_token}" \
--header "Content-Type: application/json" \
--data '{
"custom_metadata": {
"content_converter": "enabled"
}
}'

Step 2: Create a Configuration Rule

Create a Configuration Rule on your SaaS zone that matches custom hostnames with the metadata and enables content conversion:

curl --request PUT \
--url "https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets/phases/http_config_settings/entrypoint" \
--header "Authorization: Bearer {api_token}" \
--header "Content-Type: application/json" \
--data '{
"rules": [{
"expression": "lookup_json_string(cf.hostname.metadata, \"content_converter\") eq \"enabled\"",
"action": "set_config",
"action_parameters": {
"content_converter": true
},
"description": "Enable content converter for opted-in custom hostnames"
}]
}'

This will enable the feature on custom hostnames that have the content_converter custom metadata tag set.

Analytics

Use the dashboard or the GraphQL Analytics API to monitor conversions, estimate token savings, and diagnose partial or failed conversions.

Dashboard

In the Cloudflare dashboard, select your zone and go to Agent Readiness > Markdown for Agents.

Go to Markdown for Agents ↗

Use the hostname selector and time range to narrow analytics and logs. The page provides Analytics, Logs, and Playground tabs.

Analytics

The Analytics tab shows conversion attempts, full conversion rate, estimated token reduction, partial conversions, and unfinished or failed conversions.

Use the charts and breakdowns to inspect conversions:

Conversions over time

Top converted pages

Top user agents

Failure reasons

Content limits

Top pages not converted

Top pages not converted includes pages with partial or failed conversions. Content limits identifies conversions with truncated input, omitted front matter, or omitted JSON-LD. A conversion can reach more than one limit.

Logs

The Logs tab shows sampled conversion events with page URLs, user agents, outcomes, failure reasons, and content limits. Filter by outcome, failure reason, or content limit to investigate issues.

Each row represents an estimated request count, not necessarily one request.

Playground

The Playground tab tests a path with Accept: text/markdown and compares the response with HTML. Inspect Markdown, a rendered preview, response headers, and estimated token reduction.

Playground uses the selected hostname, or the zone apex when All hostnames is selected. If your browser cannot read the response because of cross-origin resource sharing (CORS) restrictions or a network error, use the provided curl command.

GraphQL Analytics API

Query the markdownForAgentsAdaptiveGroups dataset under viewer.zones for one zone or viewer.accounts for an account. Use an API token with Analytics Read access scoped to the resources you query.

The dataset is available on all plans. Analytics access does not turn on conversion or change conversion availability.

Queries cover up to seven days of history, with a maximum seven-day query window and 1,000 groups per dataset query.

For example, this query returns conversion totals and the top pages by estimated conversion attempts for a zone:

query MarkdownForAgents($zoneTag: string, $start: Time, $end: Time) {
viewer {
zones(filter: { zoneTag: $zoneTag }) {
totals: markdownForAgentsAdaptiveGroups(
limit: 1
filter: { datetime_geq: $start, datetime_lt: $end }
) {
count
sum {
fullRequests
partialRequests
completedUnknownRequests
failedRequests
unfinishedRequests
savingsInputTokens
savingsOutputTokens
estimatedTokensSaved
}
}
pages: markdownForAgentsAdaptiveGroups(
limit: 10
filter: { datetime_geq: $start, datetime_lt: $end }
orderBy: [count_DESC]
) {
count
dimensions {
pageUrl
}
}
}
}
}

Set zoneTag to your zone ID. Set start and end to UTC timestamps within the last seven days. For instructions on submitting the query and variables, refer to Querying basics.

Group or filter results with dimensions such as hostname, pageUrl, userAgent, outcome, and errorCode. The inputStatus, frontmatterStatus, and jsonLdStatus dimensions identify content limits. Account-scoped queries also support the zoneTag dimension.

Interpret analytics

Analytics and logs use sampled conversion attempts. Counts and token sums are sample-weighted estimates, excluding skipped requests and some early cancellations.

User agents are client-supplied strings, not verified bot identities. Page URLs exclude query strings, fragments, and credentials.

Conversion outcomes distinguish the following results:

Outcome
Meaning

full
Conversion completed with all content-limit flags known to be false. This does not mean lossless HTML preservation.

partial
Conversion completed, but a content limit truncated the input or omitted front matter or JSON-LD.

completed_unknown
Conversion completed, but limit information cannot establish whether output was full or partial.

error
Conversion ended with a terminal error. Inspect errorCode for the failure reason.

unfinished
The stream did not reach a terminal conversion outcome. The cause is unknown.

Token estimates use bytes divided by four, rounded down, rather than a tokenizer. Savings include only full conversions with a positive input token estimate.

Partial, failed, unfinished, and unverified conversions do not contribute to savings. estimatedTokensSaved is signed: Markdown larger than its HTML input contributes a negative value.

Calculate token reduction as 1 - savingsOutputTokens / savingsInputTokens when savingsInputTokens is greater than zero. Completion and output token estimates do not prove delivery to the client.

Cloudflare Traces

Cloudflare Traces records Markdown conversion within the request timeline. When tracing is enabled and a request is sampled, a streaming conversion adds a markdown_conversion span under response. Skipped conversions and HEAD responses do not create this span.

To capture and inspect conversions, configure tracing for your domain, then find a trace by Ray ID. Expand response and select markdown_conversion to inspect its attributes:

Attribute
Meaning

cloudflare.markdown.outcome
completed, completed_partial, or a conversion error code, including unfinished for streams without a terminal outcome.

cloudflare.markdown.input_bytes
Decompressed HTML bytes queued for conversion, capped at the input limit.

cloudflare.markdown.output_bytes
Markdown bytes emitted by the converter, not necessarily delivered to the client.

cloudflare.markdown.cpu_time_us
Approximate converter CPU time, in microseconds.

cloudflare.markdown.longest_slice_us
Longest converter processing slice, in microseconds.

cloudflare.markdown.input_truncated
Whether a content limit truncated the HTML input.

cloudflare.markdown.frontmatter_omitted
Whether a content limit omitted front matter.

cloudflare.markdown.jsonld_omitted
Whether a content limit omitted JSON-LD.

Span duration includes waits for the origin body and downstream backpressure. It is not converter CPU time, and a completed conversion does not guarantee delivery to the client.

Content-limit flags are omitted for panicked or unfinished conversions because their final state is unknown. The span does not capture HTML or Markdown content.

Availability and Pricing

Markdown for Agents is available to Pro, Business and Enterprise plans, and SSL for SaaS customers at no cost.

Try it with Cloudflare

We have enabled this feature in our Developer Documentation ↗︎ and our Blog ↗︎, inviting all AI crawlers and agents to consume our content using markdown instead of HTML.

curl https://blog.cloudflare.com/markdown-for-agents/ \
-H "Accept: text/markdown"

Limitations

We only convert from HTML, other types of documents may be included in the future.

Conversion is limited to 6 MiB (6,291,456 bytes) of decompressed HTML. The limit applies after decompression, not to the compressed response size.

Other Markdown conversion APIs

If you’re building AI systems that require arbitrary document conversion from outside Cloudflare or Markdown for Agents is not available from the content source, we provide other ways to convert documents to Markdown for your applications:

Workers AI AI.toMarkdown() supports multiple document types and summarization.

The Browser Run /markdown endpoint supports markdown conversion if you need to render a dynamic page or application in a real browser before converting it.

PreviousGlossaryNextNetwork Layers

Was this helpful?

YesNo

Edit pageReport issue

On this page

Overview

What is Markdown for Agents

How to use

Response headers

Content Signals Policy

Output format

YAML frontmatter

JSON-LD

How to enable

Enable for specific subdomains or paths

Enable for specific subdomains or paths

Enable for all custom hostnames

Enable for specific custom hostnames

Analytics

Dashboard

GraphQL Analytics API

Interpret analytics

Cloudflare Traces

Availability and Pricing

Try it with Cloudflare

Limitations

Other Markdown conversion APIs

Edit pageReport issue

Cloudflare Fundamentals

/

Overview

Concepts

How Cloudflare DNS works

Traffic flow through Cloudflare

Accounts, zones, and profiles

Cloudflare IP addresses

Get started

Accounts

Create account

Account security

Add abuse contact

Allow Cloudflare access

Leaked Password Notifications

Manage active sessions

Review audit logs - v1

Audit Logs - v2

SCIM provisioning

Overview

Authentik

Microsoft Entra

Okta

Troubleshooting

Secure compromised account

Set up SSO ↗︎

Zone holds

Find account and zone IDs

Change Super Administrator

Organizations

Overview

Organizations for Enterprise

Organizations for MSSP and Distributors

Policy sharing

Limitations and troubleshooting

Members and permissions

Members and permissions

Manage

Policies

Roles

Role scopes

User GroupsNew

Set up dashboard SSO

User profiles

Overview

Verify email address

Log in to Cloudflare

Profile settings

Account recovery

Delete your Cloudflare account

Email address and password

Multi-Factor Email Authentication

Two-factor authentication

Domains

Overview

Add multiple sites via automation

Change your domain version

Manage subdomains

Move a domain between Cloudflare accounts

Onboard a domain

Pause Cloudflare

Redirect one domain to another

Remove a domain

Star domains

Performance

Improve SEO

Maintenance mode

Minimize downtime

Optimize site speed ↗︎

Prepare for surges or spikes in web traffic ↗︎

Test speed

Security

Prevent DDoS attacks ↗︎

Protect your origin server

Recovering from a hacked site

Scan for PCI compliance

Secure your website ↗︎

Under a DDoS attack?

Cloudflare's API

Get started

Create API token

Get Global API key (legacy)

Get Origin CA keysDeprecated

Token formats

Account API tokens

How to

Make API calls

Create tokens via API

Control API Access

Restrict tokens

Roll tokens

API token template URLs

Reference

REST API ↗︎API

GraphQL API ↗︎

Wrangler API ↗︎

API token permissions

API deprecations

API token templates

Rate limits

SDKs

Troubleshooting

OAuth Applications on Cloudflare

Overview

Create your OAuth client

Integrate your OAuth client with Cloudflare

Authorizing an application

Reference

Migration guides

SCIM migration

Policies

Cloudflare Cookies

Compliance documentation

Content Security Policies (CSPs)

Delivering Videos with Cloudflare

Licenses

Project Cybersafe Schools

Abuse

Overview

Review abuse policies

Complaint types

Providing specific URLs

Customer abuse report obligations

View and submit reports

Blocked Content

SDK ecosystem support policy

Troubleshooting

/cdn-cgi/ endpoint

Account and domain management best practices

Cloudflare and Google Analytics

Cloudflare crawlers

Cloudflare HTTP headers

Cloudflare Ray ID

Cloudy AI agentBeta

Connection limits

Cryptographic Attestation of Personhood

Error responses

Glossary

Markdown for Agents

Network Layers

Network ports

Partners

Redirects

Scans and penetration testing policy

TCP connections

Under Attack mode

RSS Feeds

Available RSS Feeds

Consuming RSS Feeds

Agent resources

Agent setup ↗︎

Cloudflare Skills ↗︎

Code Mode MCP Server ↗︎

Domain-specific MCP Servers ↗︎MCP

Cloudflare Fundamentals llms.txt ↗︎

Cloudflare Fundamentals llms-full.txt ↗︎

Cloudflare Docs llms.txt ↗︎

Cloudflare Docs llms-full.txt ↗︎

Getting started
PlansContact salesPartnersFind a partnerStartupsUnder attack?Domain name search

Company
AboutCareersInvestorsPressPress kitGlobal network

Public interest
Project GalileoAthenian ProjectCloudflare for CampaignsProject FairshotImpact/ESG

Compliance
Compliance resourcesTrust HubData ProtectionResponsible AITransparency reportReport abuse

Resources
App innovation reportCloudflare RadarCase studiesStatusSupportEventsBlog

Developers
DocumentationLearning centerCommunity

Solutions
SSE and SASE platformCloudflare AI CloudAI SecurityFrontend Development PlatformMulti-Tenant Platform DevelopmentWeb Security Platform

Start BuildingLog In

© 2026 Cloudflare, Inc.

Privacy policy| Report security issues| Terms of use| Trademark
|
Your privacy choices

Docs