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:

FILEDrop a file or click to upload

Production-ready

Private by design

Security-first

Scalable

Production-ready

Private by design

Security-first

Scalable

Production-ready

Private by design

Security-first

Scalable

Turn contracts into Markdown

Upload a contract PDF or submit a URL, get Markdown back.

# SaaS Services Agreement

**Kind:** document
**Created:** 2025-06-01T10:00:00.000Z
**MIME Type:** application/pdf
**Size:** 312400 bytes
**Chunks:** 36

## Document

**Author:** Legal Department
**Pages:** 12
**Created:** 2025-05-01T00:00:00.000Z

## Contract

**Parties:** Acme Corp, Widget Industries Ltd
**Effective date:** 2025-06-01
**Expiration date:** 2026-05-31
**Governing law:** State of Delaware
**Clauses:**
  - **Title:** Term and Renewal
    **Summary:** Initial 12-month term with automatic annual renewal unless either party provides 60 days written notice.
  - **Title:** Payment Terms
    **Summary:** Net 30 from invoice date. Annual subscription of $48,000 billed quarterly.
  - **Title:** Limitation of Liability
    **Summary:** Total liability capped at fees paid in the 12 months preceding the claim.
  - **Title:** Confidentiality
    **Summary:** Mutual NDA covering proprietary information. Obligations survive 3 years after termination.
  - **Title:** Termination for Cause
    **Summary:** Either party may terminate with 30 days written notice if the other party materially breaches and fails to cure within the notice period.
  - **Title:** Indemnification
    **Summary:** Each party indemnifies the other against third-party claims arising from its own negligence or willful misconduct

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?

  1. Get your API key

Free, no credit card:

Sign up at exabase.io and copy your API key from the dashboard.

  1. Submit a contract PDF

Using the SDK (Node.js):

import { Exabase } from "@exabase/sdk";
import { createReadStream } from "fs";

const api = new Exabase({
  apiKey: process.env.EXABASE_API_KEY,
});

const job = await api.extract.createFromFile({
  file: createReadStream("./saas-agreement.pdf"),
  name: "SaaS Services Agreement",
});

console.log(job.id);    // extraction job id
console.log(job.state); // "pending"
  1. Get Markdown back

Poll the job until state reaches completed, or skip polling entirely with webhooks.

curl 'https://api.exabase.io/v2/extract/<jobId>?format=markdown' \
  -H 'X-Api-Key: <EXABASE_API_KEY>'

One API call. No templates, no clause library, no Markdown conversion.

Example output

# SaaS Services Agreement

**Kind:** document
**Created:** 2025-06-01T10:00:00.000Z
**MIME Type:** application/pdf
**Size:** 312400 bytes
**Chunks:** 36

## Document

**Author:** Legal Department
**Pages:** 12
**Created:** 2025-05-01T00:00:00.000Z

## Contract

**Parties:** Acme Corp, Widget Industries Ltd
**Effective date:** 2025-06-01
**Expiration date:** 2026-05-31
**Governing law:** State of Delaware
**Clauses:**
  - **Title:** Term and Renewal
    **Summary:** Initial 12-month term with automatic annual renewal unless either party provides 60 days written notice.
  - **Title:** Payment Terms
    **Summary:** Net 30 from invoice date. Annual subscription of $48,000 billed quarterly.
  - **Title:** Limitation of Liability
    **Summary:** Total liability capped at fees paid in the 12 months preceding the claim.
  - **Title:** Confidentiality
    **Summary:** Mutual NDA covering proprietary information. Obligations survive 3 years after termination.
  - **Title:** Termination for Cause
    **Summary:** Either party may terminate with 30 days written notice if the other party materially breaches and fails to cure within the notice period.
  - **Title:** Indemnification
    **Summary:** Each party indemnifies the other against third-party claims arising from its own negligence or willful misconduct

API quick reference

Endpoint

Method

Description

/v2/extract

POST

Submit extraction job

/v2/extract

GET

List extraction jobs

/v2/extract/{jobId}

GET

Poll for result

/v2/extract/{jobId}/chunks

GET

Fetch text chunks (JSON only)

/v2/extract-settings

PUT

Configure webhook

Auth: X-Api-Key header on all requests.

File retention: Stored files are retained for 1 day from job creation. Download or copy anything you need before they expire.

Need file extraction or full page content?

Exabase offers a full set of tools to extract content from any media, document or website.

All your data extraction needs in one place.

Why Exabase

Use cases

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.

Deciding?

Ask your favourite AI about Exabase:

Cut your token spend and give your agent precise context.

Get started in minutes.

Cut your token spend and give your agent precise context.

Get started in minutes.