PDF to markdown
via POST /parse
POST a PDF to /parse with your ocr_model. The response includes a markdown string and typed layout elements with headings, tables, and figures where the engine detects them.
ocr_model idsMarkdown and typed elementsSync, async, or batchFrom a PDF table to markdown
This illustrative invoice shows how markdown extraction can preserve a heading and table. Output depends on the document and selected OCR model.
Invoice
Item Amount
Consulting $120.00
Total $120.00# Invoice
| Item | Amount |
| --- | --- |
| Consulting | $120.00 |
| Total | $120.00 |Read markdown for chunking and retrieval. Use elements for table cells and source locations. See a parse request and JSON response.
POST /parse returns markdown and elements
Call /parse sync, async, or batch. The response includes a markdown string and typed layout elements.
/parserequestcurl https://api.openparser.dev/parse \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-F 'request={"ocr_model":"paddleocr-vl-1.6","output_format":"openparser@1"};type=application/json' \
-F "file=@statement.pdf"{
"output_format": "openparser@1",
"document_id": "doc_3f9a2c",
"provenance": {
"provider": "paddle",
"model": "paddleocr-vl-1.6"
},
"text": "Total due: $4,318.20",
"markdown": "Total due: $4,318.20\n",
"pages": [
{
"number": 1,
"width": 1700,
"height": 2200,
"unit": "pixel",
"element_ids": [
"elem-total"
],
"reading_order": [
"elem-total"
]
}
],
"elements": [
{
"id": "elem-total",
"kind": "text",
"role": "paragraph",
"text": "Total due: $4,318.20",
"spans": [
{
"start": 0,
"end": 20
}
],
"locations": [
{
"page_number": 1,
"bbox": {
"left": 14,
"top": 53,
"right": 146,
"bottom": 123
}
}
],
"confidence": {
"score": 0.98,
"scope": "recognition",
"calibrated": false
}
}
],
"relations": [],
"text_annotations": [],
"assets": []
}Preview markdown in the playground
Upload a PDF, inspect the markdown field and element kinds, then create an API key for POST /parse.
{ total: "$4,318.20" } b4Markdown for storage, elements for inspection
The markdown field is ready for chunking and retrieval. elements[] carries kinds, bounding boxes, and confidence per region.
Markdown and typed elements
Both return in the same /parse response. Use markdown for storage and retrieval. Use elements when you need per-region types or confidence.
Route low-confidence pages
Elements can include OCR confidence scores. Send low-confidence results to review before they enter a retrieval index.
Headings, tables, figures
When the parser recognizes them, headings and tables survive in markdown and as typed elements. Figures keep their own element type.
Extract after parse
Run /extract on the parse result to fill a JSON schema. Citations point back to element IDs and source-page bounding boxes.
Stable element IDs
Each element carries a stable ID you can attach to vector metadata or hand to an agent tool call.
Batch document intake
POST multiple PDFs to /parse/batch and poll /jobs/{id} when you ingest folders on a schedule.
Page rates depend on ocr_model
New accounts get $10 in credits at signup (about 10,000 pages at $1/1,000 on open-weight hosted models). Other engines publish page rates on GET /models/ocr.
llm_model tokens- No minimums
- No per-seat fees
- Sync, async, and batch
- Console and API keys
PDF to markdown API FAQ
/parse response fields, ocr_model pricing, and hosted inference.
What does the PDF to markdown API return?
The /parse endpoint returns a markdown string plus normalized typed layout elements. Elements can include text, headings, tables, figures, bounding boxes, and confidence values.
Does markdown extraction preserve tables and images?
Tables and headings can appear in markdown when the selected model detects them. Complex tables may need the structured cells in elements instead. Image handling varies by model; inspect figure elements and assets rather than assuming every image is embedded in markdown.
Do I get markdown only, or elements too?
Both return in the same response. Use markdown for storage and retrieval. Use elements when you need per-region types, bounding boxes, or confidence scores.
Which parser runs behind the API?
OpenParser hosts nine OCR models. Set ocr_model on each /parse request. paddleocr-vl-1.6 is an open-weight hosted option at $1 per 1,000 pages; Mistral, Azure, Google, and AWS Textract are also available.
How much does parsing cost?
Open-weight hosted models start at $1 per 1,000 parsed pages. Other models have their own page rates. New accounts get $10 in credits; extraction is billed separately by language-model token usage.
Can I parse PDFs asynchronously?
Yes. The API supports synchronous, asynchronous, and batch parsing, plus job endpoints for checking status and retrieving results.
Does OpenParser run on my infrastructure?
No. OpenParser hosts the OCR engines. You send files to POST /parse; OpenParser runs inference and returns markdown plus typed elements.
Preview markdown in Studio, then call POST /parse
Upload a PDF, inspect the markdown field and element kinds, create an API key, and call /parse from your backend with ocr_model set.