Tools
Contract to Markdown API
Submit a contract PDF. Get back parties, dates, governing law, and clause summaries as a readable Markdown document. No templates, no training.
Try it below:
Turn contracts into Markdown
Upload a contract PDF or submit a URL, get Markdown back.
What is Exabase's contract to Markdown API?
Submit a contract PDF to the Exabase Extract API and get a Markdown document back instead of JSON. The API detects the document type automatically, extracts contract-specific fields (parties, effective date, expiration date, governing law, clauses with titles and summaries), 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, then a ## Contract section with all the extracted structured fields. Clauses are rendered as a nested list, each with a title and summary. The result is ready to feed into an LLM for contract analysis, present to a reviewer, or store as a readable record.
What you get back
The ## Contract section contains the parties, effective date, expiration date, governing law, and clauses. No template configuration, no clause library setup. The API recognises the contract 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 contracts, the structured fields render under a ## Contract heading. For invoices: vendor, line items, and totals under ## Invoice. For resumes: experience, education, and skills under ## Resume.
The submission flow is identical across all types. The Extract docs cover each content type in detail.
What you can build with it
Feed contract content into an LLM as readable Markdown for automated review. Present clause summaries to legal agents or human reviewers as a readable document. Build a compliance audit workflow where contracts are extracted, reviewed as Markdown, and indexed for search.
Store processed contracts as Resources in a Base and search across all of them through Deep Search. Workers can process new contracts as they arrive.
Beyond Markdown
The Extract API also returns JSON (the default) with typed fields for programmatic processing. Use Markdown for LLM context and human review, JSON for system integration and querying. The Contract 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 a contract 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 clause library, 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?
Parties, effective date, expiration date, governing law, and clauses (each with title and summary). Rendered under a ## Contract heading.
Can I still get JSON?
Yes. JSON is the default. For programmatic processing, Contract to JSON returns typed fields.
Is the extraction suitable for legal decisions?
The API extracts structured data. Legal interpretation and compliance determinations are your responsibility. The extraction output is a data layer, not legal advice.
How accurate is the extraction?
Accuracy depends on the document quality and structure. Well-formatted contracts with clear section headings produce the most reliable output. The structured fields are a starting point: your own legal review sits on top. Validate critical terms in your application logic before acting on them.
What if the API doesn't recognise the PDF as a contract?
The ## Contract section will be absent. You still get document metadata and text in the Markdown output.
Does it handle scanned contracts?
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 contracts as a Resource in a Base and the content becomes searchable through Deep Search. Extract key terms into Memory so your agent retains contract details. Workers can process new contracts 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.