Skip to content
nsin docs

Markdown for Agents

An AI agent gets the same HTML as a browser: nav, scripts, styles, tracking.

Markdown for Agents converts eligible pages to Markdown at the edge on request — typically 5–10× fewer tokens. Human visitors always get HTML.

  1. Open your domain in the dashboard.
  2. Go to AI Crawl Control → Optimization.
  3. Switch Markdown for Agents on.

Off by default; needs an active plan.

Standard HTTP content negotiation:

Terminal window
curl -H 'Accept: text/markdown' https://example.ir/pricing

Eligible pages get:

HeaderValue
Content-Typetext/markdown; charset=utf-8
X-Markdown-Tokenstokens in the Markdown it sent
X-Original-Tokenstokens the HTML would have cost
VaryAccept

Vary: Accept tells caches this URL has two representations. A hot page converts once, then reuses.

Conversion never turns a working page into an error; it falls back when:

  • not 200 text/html (image, JSON API, redirect);
  • too large for the edge’s budget;
  • can’t be parsed in time, or unsupported encoding.

It still appears in your logs, with the reason.

The Optimization page has a tester: give it a subdomain and path; it fetches the URL as both, showing:

  • status, content type, cache status,
  • whether the agent’s copy converted,
  • token count of each, and percent saved.

Below it, the live view shows which requests negotiated Markdown, converted, or fell back.