{"openapi":"3.1.0","info":{"title":"PDF-to-Markdown x402 API","version":"2.0.0","description":"Extract text and convert PDFs to markdown via x402 micropayments. No API keys, no signup — pay per call in USDC on Base.","x-guidance":"Use POST /api/pdf/extract to get raw text from a PDF ($0.001). Use POST /api/pdf/to-markdown to get structured markdown ($0.002). Provide either a PDF URL in the \"url\" field, or base64-encoded PDF in \"pdfBase64\".","contact":{"email":"my.jackhughes@gmail.com"}},"paths":{"/api/pdf/extract":{"post":{"operationId":"extractPdfText","summary":"Extract raw text from PDF","tags":["PDF"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.001000"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pdfBase64":{"type":"string","description":"Base64-encoded PDF content (optional if url provided)"},"url":{"type":"string","format":"uri","description":"URL to fetch PDF from (optional if pdfBase64 provided)"}}}}}},"responses":{"200":{"description":"Successful extraction","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"pages":{"type":"number"},"preview":{"type":"string"},"fullText":{"type":"string"},"metadata":{"type":"object","properties":{"title":{"type":"string","nullable":true},"author":{"type":"string","nullable":true}}}}}}}},"402":{"description":"Payment Required"}}}},"/api/pdf/to-markdown":{"post":{"operationId":"convertPdfToMarkdown","summary":"Convert PDF to structured Markdown","tags":["PDF"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.002000"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pdfBase64":{"type":"string","description":"Base64-encoded PDF content (optional if url provided)"},"url":{"type":"string","format":"uri","description":"URL to fetch PDF from (optional if pdfBase64 provided)"}}}}}},"responses":{"200":{"description":"Successful conversion","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"pages":{"type":"number"},"markdown":{"type":"string"},"metadata":{"type":"object","properties":{"title":{"type":"string","nullable":true},"author":{"type":"string","nullable":true}}}}}}}},"402":{"description":"Payment Required"}}}}}}