# GET /markdown: $0.005 per call

Turn any document URL into clean Markdown for LLMs: web pages, PDFs, Word (.docx), Excel (.xlsx/.xls), OpenDocument, CSV, XML and plain text, up to 10 MB. Returns title, Markdown, links (for web pages) and character count. Pass ?url=https://... For JavaScript-heavy sites use /markdown/rendered. Private addresses are blocked; failures are not charged.

- **Price:** $0.005 in USDC, the same on Base, Solana, Polygon, Arbitrum. Failed calls are never charged.
- **Free trial:** yes, 20 free calls a day from Claude, Cursor or any MCP client ([set-up](/mcp/setup)).
- **Tier:** live
- **Answers cached for:** 10 min
- **Data sources:** the web; Workers AI toMarkdown (free for documents)
- **Lane:** Documents & web ([OpenAPI](/openapi/documents.json))
- **Live health:** [status page](/status)

## Free sample

See an answer for the demo input first, free (no payment, 10 a minute): [https://aayatai.com/sample/markdown](/sample/markdown). It is a stored real answer when we have one, otherwise an example marked `"kind": "illustrative"`.

```bash
curl "https://aayatai.com/sample/markdown"
```

## 1. See the price (free)

Call it without paying: you get `402 Payment Required` and a `PAYMENT-REQUIRED` header with the exact price and where to pay.

```bash
curl -i "https://aayatai.com/markdown?url=https%3A%2F%2Fexample.com"
```

## 2. Pay and call (TypeScript)

```bash
npm install @x402/fetch @x402/evm viem
```

```ts
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";

// A wallet used only by your agent, holding a little USDC on Base.
const account = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as `0x${string}`);
const pay = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(account) }],
});

const res = await pay("https://aayatai.com/markdown?url=https%3A%2F%2Fexample.com");
console.log(await res.json());
```

## 3. Or as an MCP tool

```ts
// MCP server: https://aayatai.com/mcp (Streamable HTTP). With the x402 MCP client (see /start):
const result = await client.callTool("markdown", {"url":"https://example.com"});
```

## Inputs

- `url` **(required)** (string): Address of a public web page or document.

Bad inputs are rejected with HTTP 400 before any payment is asked for.

## Example answer

```json
{
  "url": "https://example.com/report.pdf",
  "contentType": "application/pdf",
  "title": "Annual Report 2025",
  "markdown": "# Annual Report 2025\n\n## Summary\n\nRevenue grew 12%...",
  "links": [],
  "chars": 18234,
  "truncated": false,
  "converter": "document"
}
```

## Related

- [GET /markdown/rendered](/services/markdown-rendered) ($0.02): Read JavaScript-heavy web pages (single-page apps, React/Vue sites, dashboards) as clean Markdown: the page is loaded in a real headless browser, scripts run, t
- [POST /extract-json](/services/extract-json) ($0.03): AI structured extraction: give a URL (web page, PDF, Word, Excel...) or text plus your own JSON Schema, get back JSON that fits it.
- [GET /extract](/services/extract) ($0.005): Fetch any public web page and get back clean Markdown, the page title and all links as JSON.

New here? [Getting started in 60 seconds](/start). All services: [Aayat AI](/).