Document (PDF, DOCX, XLSX, CSV) to Markdown API
Markdown of a document at a public URL, up to 10 MB: PDF (page count, title, created and modified dates from its metadata), DOCX, ODT, XLSX/XLS, ODS, Numbers (sheet names), CSV, XML or HTML; plain text is returned as served. Returns file name, MIME type, size, Markdown, word count, token estimate and truncation flag. Images are not converted. Conversion: Cloudflare Workers AI toMarkdown; fetch via validated redirects, DNS checks via Cloudflare DoH.
$0.005 per call USDC over x402 v2 on Base, Polygon, Arbitrum, Avalanche or Sei. No signup, no API key. Requests that fail or match nothing are not charged.
Endpoint
GET https://web.kit-rx.com/v1/doc/markdown
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
url | string | yes | http or https URL of a PDF, DOCX, ODT, XLSX, XLS, ODS, Numbers, CSV, XML or HTML file (at most 10 MB). Default ports only; credentials, IP addresses, localhost and private or single-label names are rejected. e.g. https://nvlpubs.nist.gov/nistpubs/CSWP/NIST.CSWP.29.pdf |
max_chars | integer | no | Maximum characters of Markdown returned, 1000 to 100000. Default 20000. Longer output is cut at a line boundary and flagged truncated. e.g. 20000 |
Example request
https://web.kit-rx.com/v1/doc/markdown?url=https%3A%2F%2Fnvlpubs.nist.gov%2Fnistpubs%2FCSWP%2FNIST.CSWP.29.pdf
Without payment the server answers 402 Payment Required with the price (5000 atomic USDC) in the PAYMENT-REQUIRED header. Any x402 v2 client pays and retries automatically. A request with no parameters runs this example.
curl -i "https://web.kit-rx.com/v1/doc/markdown?url=https%3A%2F%2Fnvlpubs.nist.gov%2Fnistpubs%2FCSWP%2FNIST.CSWP.29.pdf"
Pay from an agent
AgentCash: fetch the URL. OpenDexter MCP: x402_fetch. Kit Rx MCP server: https://web.kit-rx.com/mcp. Code:
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.BUYER_KEY) });
const pay = wrapFetchWithPayment(fetch, client);
const res = await pay("https://web.kit-rx.com/v1/doc/markdown?url=https%3A%2F%2Fnvlpubs.nist.gov%2Fnistpubs%2FCSWP%2FNIST.CSWP.29.pdf");
console.log(await res.json());
Example response
{
"query": {
"url": "https://nvlpubs.nist.gov/nistpubs/CSWP/NIST.CSWP.29.pdf",
"max_chars": 20000
},
"result": {
"final_url": "https://nvlpubs.nist.gov/nistpubs/CSWP/NIST.CSWP.29.pdf",
"status": 200,
"redirect_count": 0,
"name": "NIST.CSWP.29.pdf",
"mime_type": "application/pdf",
"content_type": "application/pdf",
"format": "pdf",
"bytes": 1518858,
"pages": 32,
"sheets": null,
"title": "The NIST Cybersecurity Framework (CSF) 2.0",
"created": "2024-03-06T15:46:45-05:00",
"modified": "2025-06-04T10:58:23-04:00",
"markdown": "# NIST.CSWP.29.pdf\n## Contents\n### Page 1\n\nNational Institute of Standards and Technology\n\nThis publication is available free of charge from: https://doi.org/10.6028/NIST.CSWP.29\n\nFebruary 26, 2024\n\n![National Institute of Standards and Technology \\(NIST\\) logo]()\n\n# The NIST Cybersecurity\nFramework (CSF) 2.0\n\n### Page 2\n## NIST CSWP 29\nFebruary 26, 2024Abstract\n\n…",
"chars": 19972,
"word_count": 2797,
"token_estimate": 4993,
"truncated": true,
"links_count": 0,
"full_chars": 70007,
"converter_tokens": 17502
},
"sources": [
{
"name": "Cloudflare DNS over HTTPS (JSON API)",
"url": "https://developers.cloudflare.com/1.1.1.1/encryption/dns-over-https/make-api-requests/dns-json/"
},
{
"name": "Cloudflare Workers AI toMarkdown",
"url": "https://developers.cloudflare.com/workers-ai/features/markdown-conversion/"
},
{
"name": "Live HTTP(S) fetch of the URL",
"url": "https://nvlpubs.nist.gov/nistpubs/CSWP/NIST.CSWP.29.pdf"
}
],
"notes": [
"The PDF metadata block is omitted from the Markdown; title and dates are returned as fields.",
"Fetched live by the Kit Rx fetcher (User-Agent KitRx/1.0); content belongs to its publisher."
],
"attribution": [
"DNS resolved via Cloudflare 1.1.1.1 DNS-over-HTTPS."
],
"generated_at": "2026-11-15T00:30:40.565Z"
}
Kit Rx Website Security, TLS & Markdown: Website tools for AI agents: security headers grade, SSL/TLS certificate check, page and document to Markdown, site and agent-readiness checks, paid per call over x402. Machine-readable: OpenAPI, llms.txt, /.well-known/x402, agent skills.