{"uid":"cap_RWTNgEEl35a5UrF8WMifc","slug":"structdoc-layout-to-markdown-document-structuring-api-0a2f40f9","name":"StructDoc Layout-to-Markdown Document Structuring API","description":"Turn any document into structured data for AI agents — OCR, layout-to-Markdown, tables, key-value, invoice/receipt fields — from PDF/images in 100+ languages. Pay per call via x402 (USDC). No API keys.","url":"https://structdoc-api.hp-vladic.workers.dev/layout","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"url":{"type":"string","description":"Document URL (PDF/image)"},"pages":{"type":"string","description":"Page range e.g. \"1-5\""},"base64":{"type":"string","description":"Base64 document bytes (≤~6MB)"},"features":{"type":"string","description":"languages,barcodes,keyValuePairs"},"queryFields":{"type":"string","description":"custom fields, comma-separated ≤8"}}},"responseSchema":{"type":"json","example":{"model":"prebuilt-layout","pages":1,"format":"markdown","content":"# ..."}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.25","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.25/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.25","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.25","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_RPv4nKLlJmG48SDWSM-XC","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.25","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts PDF or image documents into structured data (Markdown, tables, key-value pairs, invoice/receipt fields) using OCR and layout analysis across 100+ languages","exampleAgentPrompt":"Can you extract all the text and tables from this invoice PDF and give me the results as structured Markdown — I need the line items, totals, and vendor info pulled out cleanly?","exampleUseCases":null,"resultDescription":"A JSON object containing the model name ('prebuilt-layout'), page count, output format ('markdown'), and full Markdown-formatted document content including extracted text, tables, and layout structure. Key-value fields such as invoice line items, totals, dates, and vendor info are embedded in the Markdown representation.","failureModes":["Unsupported file format returns an error — only PDF and common image types accepted","Document too large or too many pages may time out or return a partial result","Heavily handwritten or low-resolution scans may produce poor OCR accuracy","Non-Latin scripts may have reduced accuracy depending on language support","Payment failure via x402/USDC will block the request before processing","Malformed or inaccessible document URL returns a fetch error"],"whenToPreferThis":"Choose this endpoint when you need to convert unstructured PDF or image documents into AI-ready Markdown or structured data, especially for invoices, receipts, and forms with tables or key-value pairs. It is ideal for agents that need to process documents without managing API keys, paying per-call via USDC. Prefer it over generic OCR when you need layout-aware extraction that preserves table structure and document hierarchy across 100+ languages.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T18:33:06.928Z","isFirstParty":false}