# Doc Tools for Agents (PDF, Office, audio, OCR) via MPP > Pay-per-call document conversion for AI agents: PDF to Markdown/text, PDF info/split/merge, DOCX/XLSX/CSV/HTML conversion, image OCR, Markdown to PDF, speech-to-text, voice memo to document, meeting notes, RAG chunking and JSON Schema validation. No account, no API key: pay per call with MPP on Tempo (USDC.e or pathUSD). ## Docs (free) - Human docs with copy-paste examples: https://mpp-docs.fmf-x402.workers.dev/docs - OpenAPI 3.1: https://mpp-docs.fmf-x402.workers.dev/openapi.json - This file: https://mpp-docs.fmf-x402.workers.dev/llms.txt - MCP server (Streamable HTTP): https://mpp-docs.fmf-x402.workers.dev/mcp - Health: https://mpp-docs.fmf-x402.workers.dev/health - Attribution counters (no PII): https://mpp-docs.fmf-x402.workers.dev/stats/refs ## How to pay No account and no API key. Unpaid calls receive HTTP 402 with an MPP challenge on Tempo (USDC.e or pathUSD). Official clients pay the challenge and retry automatically. POST JSON {"url": ""} (or {"data": ""}, or the raw file as the body, or multipart field "file") to any /mpp/* route. Pay the MPP 402 challenge on Tempo. Invalid input or failed conversion returns 402 with an error and you are not charged. PDF-output routes return application/pdf unless format=json. ## Quick start mppx CLI (creates/uses a Tempo account in your keychain): ```bash npx mppx https://mpp-docs.fmf-x402.workers.dev/mpp/html/markdown -X POST -H 'content-type: application/json' -d '{"url":"https://example.com"}' ``` TypeScript (mppx). After Mppx.create(), global fetch handles 402: ```ts import { Mppx, tempo } from 'mppx/client' import { privateKeyToAccount } from 'viem/accounts' Mppx.create({ methods: [tempo({ account: privateKeyToAccount(process.env.TEMPO_PRIVATE_KEY) })], }) // Global fetch now pays the 402 automatically. const res = await fetch('https://mpp-docs.fmf-x402.workers.dev/mpp/html/markdown', { method: 'POST', headers: { 'content-type': 'application/json', }, body: JSON.stringify({"url":"https://example.com"}), }) console.log(await res.json()) ``` Python (pympp): ```python # pip install pympp # Docs: https://mpp.dev/sdk/python import asyncio from mpp.client import Mpp from mpp.methods.tempo import TempoAccount from mpp.methods.tempo import client as tempo account = TempoAccount.from_key("0x...") async def main(): async with Mpp(methods=[tempo.charge(account=account)]) as mpp: response = await mpp.fetch("https://mpp-docs.fmf-x402.workers.dev/mpp/html/markdown", method="POST", json={"url":"https://example.com"}) print(await response.json()) asyncio.run(main()) ``` An unpaid curl shows the 402 (you are not charged): ```bash curl -i -X POST https://mpp-docs.fmf-x402.workers.dev/mpp/html/markdown -H 'content-type: application/json' -d '{"url":"https://example.com"}' ``` ## MCP Add this to Cursor / Claude Desktop / VS Code MCP settings (Streamable HTTP): ```json { "mcpServers": { "fmf-mpp-docs": { "url": "https://mpp-docs.fmf-x402.workers.dev/mcp" } } } ``` `tools/list` is free. `tools/call` requires an MPP Payment credential in the Authorization header (or just call the HTTP route with mppx). The wrapper does not settle payment on its own and stores nothing. ## Routes - POST https://mpp-docs.fmf-x402.workers.dev/mpp/pdf/markdown ($0.005) PDF to Markdown: Convert a PDF to clean LLM-ready Markdown with a layout-aware engine: correct word spacing (incl. LaTeX/arXiv papers), headings from font size/bold/section numbers, bullet and numbered lists, column-aligned tables, de-hyphenation, page markers. Optional pages="1-5". Up to 40 MB / 500 pages. Example: `npx mppx https://mpp-docs.fmf-x402.workers.dev/mpp/pdf/markdown -X POST -H 'content-type: application/json' -d '{"url":"https://arxiv.org/pdf/1706.03762"}'` - POST https://mpp-docs.fmf-x402.workers.dev/mpp/pdf/text ($0.003) PDF to plain text: Extract plain text from a PDF with correct word spacing (layout-aware; pages separated by form feed \f). Optional pages="1-5". Up to 40 MB. Example: `npx mppx https://mpp-docs.fmf-x402.workers.dev/mpp/pdf/text -X POST -H 'content-type: application/json' -d '{"url":"https://arxiv.org/pdf/1706.03762"}'` - POST https://mpp-docs.fmf-x402.workers.dev/mpp/pdf/info ($0.001) PDF metadata and page count: PDF facts in one call: page count, title, author, subject, keywords, creator, producer, dates, page sizes, encryption and form-field flags, and the bookmark outline (title, level, page). Up to 40 MB. Example: `npx mppx https://mpp-docs.fmf-x402.workers.dev/mpp/pdf/info -X POST -H 'content-type: application/json' -d '{"url":"https://raw.githubusercontent.com/py-pdf/sample-files/main/001-trivial/minimal-document.pdf"}'` - POST https://mpp-docs.fmf-x402.workers.dev/mpp/pdf/split ($0.003) PDF extract pages: Extract pages from a PDF into a new PDF. pages="1-3,5,last" (1-based; reverse ranges allowed). Returns application/pdf, or JSON with base64 when format=json. Up to 40 MB. Example: `npx mppx https://mpp-docs.fmf-x402.workers.dev/mpp/pdf/split -X POST -H 'content-type: application/json' -d '{"url":"https://raw.githubusercontent.com/py-pdf/sample-files/main/001-trivial/minimal-document.pdf","pages":"1"}'` - POST https://mpp-docs.fmf-x402.workers.dev/mpp/pdf/merge ($0.005) PDF merge: Merge 2-20 PDFs (JSON {urls:[...]} or {files:[{data}]}, or multipart files) into one PDF in the given order. Returns application/pdf, or JSON with base64 when format=json. Up to 20 MB each, 30 MB total. Example: `npx mppx https://mpp-docs.fmf-x402.workers.dev/mpp/pdf/merge -X POST -H 'content-type: application/json' -d '{"urls":["https://raw.githubusercontent.com/py-pdf/sample-files/main/001-trivial/minimal-document.pdf","https://raw.githubusercontent.com/py-pdf/sample-files/main/001-trivial/minimal-document.pdf"]}'` - POST https://mpp-docs.fmf-x402.workers.dev/mpp/doc/markdown ($0.005) Any document to Markdown: Universal converter: PDF, DOCX, XLSX/XLS/XLSM/XLSB, ODT/ODS, CSV, HTML, XML or Apple Numbers to Markdown (type auto-detected). Max 15 MB. Example: `npx mppx https://mpp-docs.fmf-x402.workers.dev/mpp/doc/markdown -X POST -H 'content-type: application/json' -d '{"url":"https://arxiv.org/pdf/1706.03762"}'` - POST https://mpp-docs.fmf-x402.workers.dev/mpp/docx/markdown ($0.003) DOCX to Markdown: Convert a Word .docx (or .odt) to Markdown with headings, lists and tables. Max 15 MB. Example: `npx mppx https://mpp-docs.fmf-x402.workers.dev/mpp/docx/markdown -X POST -H 'content-type: application/json' -d '{"url":"https://raw.githubusercontent.com/python-openxml/python-docx/master/tests/test_files/test.docx"}'` - POST https://mpp-docs.fmf-x402.workers.dev/mpp/html/markdown ($0.003) URL/HTML to clean Markdown: Fetch a web page (url) or take raw HTML and return clean Markdown with absolute links. Optional selector (CSS) to keep only part of the page. Static HTML, no JS rendering. Max 5 MB. Example: `npx mppx https://mpp-docs.fmf-x402.workers.dev/mpp/html/markdown -X POST -H 'content-type: application/json' -d '{"url":"https://example.com"}'` - POST https://mpp-docs.fmf-x402.workers.dev/mpp/sheet/json ($0.002) CSV/XLSX to JSON: Convert CSV, XLSX/XLS/XLSM/XLSB, ODS or Numbers to JSON: one array of row objects per sheet (first row = headers). Numbers are typed. Max 10 MB. Example: `npx mppx https://mpp-docs.fmf-x402.workers.dev/mpp/sheet/json -X POST -H 'content-type: application/json' -d '{"url":"https://raw.githubusercontent.com/datasets/country-codes/main/data/country-codes.csv"}'` - POST https://mpp-docs.fmf-x402.workers.dev/mpp/image/ocr ($0.004) Image OCR: Read all text in an image (PNG, JPEG, WebP, GIF, BMP; screenshots, scans, receipts, photos of documents) and return it as Markdown, keeping headings, lists and tables. Max 5 MB. Example: `npx mppx https://mpp-docs.fmf-x402.workers.dev/mpp/image/ocr -X POST -H 'content-type: application/json' -d '{"url":"https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/testocr.png"}'` - POST https://mpp-docs.fmf-x402.workers.dev/mpp/markdown/pdf ($0.005) Markdown to PDF: Render Markdown (headings, paragraphs, bold, bullet/numbered lists, code blocks, tables, rules) to a clean A4/Letter PDF. Body: JSON {markdown, title?, page_size?: "A4"|"Letter"} or raw text/markdown. Returns application/pdf (or base64 JSON with format=json). Max 300 KB of Markdown. Example: `npx mppx https://mpp-docs.fmf-x402.workers.dev/mpp/markdown/pdf -X POST -H 'content-type: application/json' -d '{"markdown":"# Hello\n\n- one\n- two"}'` - POST https://mpp-docs.fmf-x402.workers.dev/mpp/audio/transcribe ($0.01) Speech to text: Transcribe speech (MP3, WAV up to 10 minutes / 15 MB; FLAC, M4A, OGG, WebM up to 8 MB) with Whisper large-v3-turbo on Cloudflare Workers AI. Returns text, timestamped segments, WebVTT subtitles, detected language and duration. Optional language (ISO code). For up to 30 minutes use /mpp/audio/transcribe-long. Not charged on failure or when the daily free compute budget is reached. Example: `npx mppx https://mpp-docs.fmf-x402.workers.dev/mpp/audio/transcribe -X POST -H 'content-type: application/json' -d '{"url":"https://github.com/openai/whisper/raw/main/tests/jfk.flac"}'` - POST https://mpp-docs.fmf-x402.workers.dev/mpp/audio/memo ($0.02) Voice memo to Markdown document: Turn a voice memo (up to 10 minutes; MP3/WAV up to 15 MB, other formats 8 MB) into a structured Markdown document: title, summary, headings, bullet points, decisions, action items and open questions, plus the raw transcript. Example: `npx mppx https://mpp-docs.fmf-x402.workers.dev/mpp/audio/memo -X POST -H 'content-type: application/json' -d '{"url":"https://github.com/openai/whisper/raw/main/tests/jfk.flac"}'` - POST https://mpp-docs.fmf-x402.workers.dev/mpp/audio/meeting ($0.03) Meeting audio to summary: Meeting recording (up to 10 minutes; MP3/WAV up to 15 MB, other formats 8 MB) to notes: summary, key points, decisions, action items (owner, due date if said), open questions, as Markdown and JSON, plus the timestamped transcript. Example: `npx mppx https://mpp-docs.fmf-x402.workers.dev/mpp/audio/meeting -X POST -H 'content-type: application/json' -d '{"url":"https://github.com/openai/whisper/raw/main/tests/jfk.flac"}'` - POST https://mpp-docs.fmf-x402.workers.dev/mpp/url/metadata ($0.001) URL metadata / link preview: Fetch a URL and return its link-preview metadata: final URL, HTTP content type, title, description, canonical, language, Open Graph and Twitter card fields, favicon, feeds, JSON-LD types, and word count. Static fetch, max 3 MB. Example: `npx mppx https://mpp-docs.fmf-x402.workers.dev/mpp/url/metadata -X POST -H 'content-type: application/json' -d '{"url":"https://example.com"}'` - POST https://mpp-docs.fmf-x402.workers.dev/mpp/text/chunk ($0.001) Text chunking for RAG: Split text or Markdown into retrieval-ready chunks that respect headings, paragraphs and sentences. Params: size (target tokens, default 400, 50-4000), overlap (tokens, default 40). Returns chunks with heading path, char offsets and token estimates. Body: JSON {text} or raw text. Max 2 MB. Example: `npx mppx https://mpp-docs.fmf-x402.workers.dev/mpp/text/chunk -X POST -H 'content-type: application/json' -d '{"text":"# Title\n\nFirst paragraph.\n\nSecond paragraph.","size":400}'` - POST https://mpp-docs.fmf-x402.workers.dev/mpp/json/validate ($0.001) JSON Schema validate: Validate JSON data against a JSON Schema (draft 2020-12, 2019-09, 7, 4). Body: JSON {schema, data, draft?}. Returns valid plus every error with instance path and keyword. Example: `npx mppx https://mpp-docs.fmf-x402.workers.dev/mpp/json/validate -X POST -H 'content-type: application/json' -d '{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"integer"}}},"data":{"id":"x"}}'` - POST https://mpp-docs.fmf-x402.workers.dev/mpp/pdf/images ($0.005) PDF pages to images: Render PDF pages to PNG or JPEG images (for vision models, OCR, thumbnails). Params: pages="1-3" (default first 10, max 50 per call), dpi (36-300, default 110), format png|jpeg, quality (JPEG), output=zip for a ZIP file instead of JSON base64. Up to 40 MB. Example: `npx mppx https://mpp-docs.fmf-x402.workers.dev/mpp/pdf/images -X POST -H 'content-type: application/json' -d '{"url":"https://raw.githubusercontent.com/py-pdf/sample-files/main/001-trivial/minimal-document.pdf","pages":"1","dpi":72}'` - POST https://mpp-docs.fmf-x402.workers.dev/mpp/text/tokens ($0.001) Exact token count (tiktoken): Exact token counts with OpenAI tiktoken encodings: o200k_base (GPT-4o, 4.1, o-series, GPT-5) and cl100k_base (GPT-4, 3.5, text-embedding-3). Body: JSON {text, encodings?} or raw text. Up to 5 MB of text. Example: `npx mppx https://mpp-docs.fmf-x402.workers.dev/mpp/text/tokens -X POST -H 'content-type: application/json' -d '{"text":"Hello, how many tokens is this sentence?"}'` - POST https://mpp-docs.fmf-x402.workers.dev/mpp/audio/transcribe-long ($0.05) Long audio transcription (up to 30 min): Transcribe long recordings (podcasts, lectures, interviews, calls) up to 30 minutes / 40 MB (MP3 or WAV; split into 2-minute chunks transcribed in parallel) with Whisper large-v3-turbo on Cloudflare Workers AI. Returns text, timestamped segments, WebVTT, language, duration. Not charged on invalid input or when the daily free compute budget is reached. Example: `npx mppx https://mpp-docs.fmf-x402.workers.dev/mpp/audio/transcribe-long -X POST -H 'content-type: application/json' -d '{"url":"https://github.com/openai/whisper/raw/main/tests/jfk.flac"}'` ## Sources and licences Input: POST JSON {url} or {data: base64}, raw file body, or multipart field file. GET ?url= also works for single-file routes. Invalid input or a failed conversion is refused with 402 and is not charged. ## Sister services - [Web & Data](https://mpp-agent-data.fmf-x402.workers.dev/docs?ref=cross-docs): Scrape, extract, SEC filings, weather, FX - [Utility Tools](https://mpp-tools.fmf-x402.workers.dev/docs?ref=cross-docs): Tempo chain, attestation, QR, DNS, email, IP, geo, tech detect, math - [AI Tools](https://mpp-ai.fmf-x402.workers.dev/docs?ref=cross-docs): Chat, translation, embeddings, rerank - [Browser](https://mpp-browser.fmf-x402.workers.dev/docs?ref=cross-docs): JS-rendered screenshots, page to Markdown, page to PDF - [Research](https://mpp-research.fmf-x402.workers.dev/docs?ref=cross-docs): Papers, FDA drugs, recalls, clinical trials, LEI - [Control-plane](https://controlplane-x402.fmf-x402.workers.dev/docs?ref=cross-docs): Contract control-plane snapshots and Tempo token data (MPP + x402) ## Attribution Append `?ref=your-channel` or send header `X-FMF-Ref: your-channel` on any request (including unpaid 402s and /docs). We count hits and paid successes per channel so we can see what actually drives calls. The parameter is ignored by the tool.