Resolve402 / services
Document to Markdown
GET / POST /api/doc-to-markdown · $0.005 per call (USDC on Base or Solana, x402)
Convert a document (PDF, DOCX, HTML, TXT) or an image into clean Markdown for an LLM, with tables extracted as rows and OCR (French, English) for scanned PDFs and images. Give a public URL (?url=) or POST the file (multipart or raw binary, max 10 MB). Returns markdown, tables, pages, chars and source type. Charged only if text is found. Nothing stored.
Problem solved
You have a PDF, Word file, web page or scan and need its text and tables as clean Markdown for an LLM, without running a parser yourself.
Use cases
- Read a supplier's PDF invoice, a report or a contract from its URL and feed the Markdown to the model.
- Upload a scanned page or a photo of a document and get its text back through OCR.
Input
GET /api/doc-to-markdown?url=<public document URL> | POST /api/doc-to-markdown (multipart file field, or raw binary body)
| Parameter | Where | Type | Description |
|---|---|---|---|
url | query | string | Public http(s) URL of a PDF, DOCX, HTML, TXT or image (PNG, JPEG, WebP, TIFF) document (max 10 MB, 10 s fetch). Alternative: POST the file as multipart/form-data (field 'file') or as a raw binary body. |
file | POST file | file | POST alternative: multipart/form-data file field, or raw binary body (application/pdf, application/octet-stream, text/html...) |
Output
Returns markdown, tables [{page?, rows}] (also inlined as GFM tables in markdown), pages (PDF only), chars, source_type (pdf | docx | html | txt | markdown | image), truncated (Markdown cut at 400,000 characters), and ocr {engine, languages, pages_ocr, pages_skipped, mean_confidence} when OCR ran. 422 no_text = nothing readable, not charged.
Price
$0.005 per call. Charged only if text is found: 422 no_text (blank or unreadable document) and conversion errors are not charged.
Example
GET https://resolve402.dev/api/doc-to-markdown?url=https%3A%2F%2Fwww.w3.org%2FWAI%2FER%2Ftests%2Fxhtml%2Ftestfiles%2Fresources%2Fpdf%2Fdummy.pdf
{
"markdown": "# Quarterly report\n\nRevenue grew 12%…",
"tables": [
{
"page": 2,
"rows": [
[
"Region",
"Revenue"
],
[
"EU",
"1.2M"
]
]
}
],
"pages": 3,
"chars": 4210,
"source_type": "pdf",
"truncated": false
}Bazaar discovery example served in the production 402 (the response illustrates the shape, not the dummy.pdf content).
Sources
- The document you send or its public URL; conversion and OCR (tesseract, French + English) run in memory on our server
Limits
- Max 10 MB by URL; a POST body is limited to 4.5 MB by the hosting platform.
- OCR on up to 4 scanned pages per call; OCR text comes without tables.
- PDF tables are rebuilt from text positions: spanning headers or irregular borderless layouts may be mis-split.
- Nothing stored: the document is processed in memory and discarded.
Use it
- HTTP + x402: call the URL, pay the 402 with any x402 v2 client, retry with the PAYMENT-SIGNATURE header.
- OpenAPI: /openapi.json (operations
docToMarkdowndocToMarkdownUpload) - MCP:
npx -y resolve402-mcp, tooldoc_to_markdown(npm) - Agent guide: /llms.txt · skill: /SKILL.md