Tools
Invoice to Markdown API
Submit an invoice PDF. Get back vendor, line items, totals, and dates as a readable Markdown document. No templates, no training.
Try it below:
Turn invoices into Markdown
Upload an invoice PDF or submit a URL, get Markdown back.
What is Exabase's invoice to Markdown API?
Submit an invoice PDF to the Exabase Extract API and get a Markdown document back instead of JSON. The API detects the document type automatically, extracts invoice-specific fields (vendor, invoice number, issue date, due date, line items, total), and renders them as a structured Markdown document. Pass ?format=markdown when retrieving the result.
The Markdown output includes document metadata at the top, followed by a ## Document section with page count, author, and creation date, then a ## Invoice section with all the extracted structured fields. Line items are rendered as a nested list with description, quantity, unit price, and amount for each. The result is ready to feed into an LLM for further processing, present to a human for review, or store as a readable record.
What you get back
The Markdown response is a single text document. The ## Invoice section contains vendor, invoice number, issue date, due date, line items (each with description, quantity, unit price, and amount), and total. No template configuration, no field mapping. The API recognises the invoice and renders the structured data automatically.
You can also configure webhooks with webhookFormat: "markdown" so completed jobs POST the Markdown document directly to your server.
One multi-modal API
The same POST /v2/extract endpoint handles every content type Exabase supports, and the ?format=markdown parameter works across all of them. For invoices, the structured fields render under an ## Invoice heading. For contracts: parties, dates, and clauses under ## Contract. For resumes: experience, education, and skills under ## Resume. For audio and video, you get the transcript. For images, you get OCR text.
The submission flow is identical across all types. The Extract docs cover each content type in detail.
What you can build with it
Feed invoice content into an LLM as readable Markdown for automated processing. Present extracted invoice data to AP teams as a readable document for review before it enters your ERP. Build an internal tool that shows invoice details without opening the original PDF.
Store processed invoices as Resources in a Base and search across all of them through Deep Search. Workers can process new invoices as they arrive.
Beyond Markdown
The Extract API also returns JSON (the default) with typed fields you can query programmatically. Use Markdown for LLM context and human review, JSON for structured processing and system integration. The Invoice to JSON tool page covers the JSON output.
How do I use it?
Get your API key
Free, no credit card:
Sign up at exabase.io and copy your API key from the dashboard.
Submit an invoice PDF
Using the SDK (Node.js):
Get Markdown back
Poll the job until state reaches completed, or skip polling entirely with webhooks.
One API call. No templates, no field mapping, no Markdown conversion.
Why Exabase
Works with other Exabase features
FAQs
What is Exabase?
Exabase is infrastructure for AI agents. It gives your agents memory, versioned file storage, AI deep search, and context automation through a set of APIs. Store what your agent learns, search inside any content type, and keep knowledge bases current automatically. Built for production use. Give your agent precise context and cut your token spend by up to 81%.
Who uses Exabase?
Developers and teams building AI agents, copilots, and RAG applications. If your agent needs to remember things between sessions, store and retrieve files, search across documents and media, or stay up to date without manual maintenance, Exabase handles that infrastructure so you can focus on your product.
How do I get Markdown instead of JSON?
Add ?format=markdown to the GET /v2/extract/{jobId} request. For webhooks, set webhookFormat: "markdown".
What fields does the Markdown include?
Vendor, invoice number, issue date, due date, line items (description, quantity, unit price, amount), and total. Rendered under an ## Invoice heading.
Can I still get JSON?
Yes. JSON is the default. Both formats are available from the same extraction job. For programmatic processing, Invoice to JSON returns typed fields.
How accurate is the extraction?
Accuracy depends on document quality. The structured fields are a starting point. Validate critical values in your application logic.
What if the API doesn't recognise the PDF as an invoice?
The ## Invoice section will be absent. You still get document metadata and text in the Markdown output.
Does it handle scanned invoices?
Yes. OCR is built in.
Do I have to poll for results?
No. Configure a webhook with webhookFormat: "markdown".
What happens if extraction fails?
The job state moves to failed. You can call the reprocess endpoint to retry without re-uploading the original file.
How long are files retained?
Stored files are retained for 1 day from job creation, then permanently deleted. Download or copy anything you need before the retention window expires.
Does it work with password-protected PDFs?
No. Password-protected PDFs cannot be processed. Remove the password before submitting.
Can I use the extracted content with other Exabase features?
Yes. Store processed invoices as a Resource in a Base and the content becomes searchable through Deep Search. Extract key details into Memory so your agent retains invoice history. Workers can process new invoices automatically as they arrive.
Is there an SDK?
Yes. The @exabase/sdk package for Node.js/TypeScript handles file streaming, job polling, and chunk retrieval. Install with npm install @exabase/sdk. Or call the REST API directly from any language.