{"uid":"cap_RisjG1VfYqSBZ_GFxZsSf","slug":"x402-gateway-document-to-markdown-auto-detect-fc6a5b5d","name":"x402-gateway Document to Markdown (Auto-Detect)","description":"Document to Markdown (auto-detect): Convert any document to Markdown with automatic format detection. One endpoint for pdf, docx, pptx, xlsx, csv, epub, html and plain text — provide a URL or base64 bytes and the type is detected from the file contents. Spreadsheets return both a Markdown table and a JSON array of rows. Pay per call in USDC on Base via x402 — POST https://x402.freeq.one/tools/document_to_markdown.","url":"https://x402.freeq.one/tools/document_to_markdown?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"url":{"type":"string","example":"https://x402.freeq.one/samples/report.pdf","description":"Direct URL to any supported document (pdf, docx, pptx, xlsx, csv, epub, html, text)"},"file_b64":{"type":"string","maxLength":28000000,"description":"Base64-encoded document bytes (alternative to url)"},"max_length":{"type":"integer","example":100000,"description":"Truncate output to N characters"}}},"responseSchema":{"type":"json","example":{"result":{}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_0fJteIpgdXGNFje7oulQd","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts any document (PDF, DOCX, PPTX, XLSX, CSV, EPUB, HTML, or plain text) to clean Markdown with automatic format detection, via a URL or base64 bytes, paid per-call in USDC on Base via x402.","exampleAgentPrompt":"Convert this PDF report to clean Markdown so I can feed it into my LLM pipeline — here's the URL: https://x402.freeq.one/samples/report.pdf, and please truncate the output to 50000 characters.","exampleUseCases":[{"title":"Research PDF ingestion for RAG pipeline","prompt":"I need to convert this academic paper PDF at https://example.com/paper.pdf into Markdown so I can chunk it and load it into my retrieval-augmented generation system — please auto-detect the format and give me the full text."},{"title":"Excel report to structured data","prompt":"Can you convert this Excel spreadsheet at https://example.com/quarterly_report.xlsx into both a Markdown table and a JSON array of rows? I want to be able to read the data easily and process it programmatically."},{"title":"PowerPoint slides to readable text","prompt":"Turn this PowerPoint presentation at https://example.com/deck.pptx into Markdown so I can read through the slide content as plain text — limit the output to 30000 characters."}],"resultDescription":"Returns a JSON object with a 'result' field containing the converted Markdown text. For spreadsheet formats (XLSX, CSV), also includes a Markdown table representation and a JSON array of rows. Output may be truncated if max_length is specified.","failureModes":["URL is inaccessible or returns a non-200 response — endpoint cannot fetch the document","Document format cannot be detected from file contents — returns an error","Base64 payload exceeds 28MB maximum — request rejected","Unsupported or corrupted file — parsing fails with an error","Payment not provided or insufficient USDC — x402 payment required error returned","max_length too small to capture meaningful content — output truncated aggressively"],"whenToPreferThis":"Choose this endpoint when you need to convert any of a wide variety of document formats (PDF, DOCX, PPTX, XLSX, CSV, EPUB, HTML, plain text) to Markdown in a single unified call without knowing the format in advance. Prefer it over format-specific sibling endpoints (like the dedicated PDF-to-Markdown or XLSX-to-Markdown tools) when the document type is unknown or mixed, or when you want a single integration point. Ideal for LLM data preparation pipelines where documents arrive in heterogeneous formats.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-10T06:46:10.447Z","isFirstParty":false,"canonicalSlug":"x402-gateway-document-to-markdown-auto-detect-fc6a5b5d"}