Document extraction API

Extract documents
into JSON.

Define the fields you need from a PDF or image. Get JSON that matches your schema, with citations to the source text.

Citations per fieldocr_model and llm_model separateSync, async, or batch
MUTUAL NON-DISCLOSURE AGREEMENT
This Agreement is made on 2 September 2026 between Nimbus Cloud GmbH, 42 Speicherstrasse, Berlin ("Nimbus") and Acme Operations GmbH, 8 Marktgasse, Vienna ("Acme").
4. Term and termination
This Agreement remains in force for three (3) years from the date above. Either party may end it with thirty (30) days' written notice.
5. Governing law
This Agreement is governed by Austrian law. The courts of Vienna have exclusive jurisdiction.
Jonas Weber
Jonas Weber
CEO · Nimbus Cloud GmbH
Date: 02.09.2026
M. Fernández
Marta Fernández
COO · Acme Operations GmbH
Date: 02.09.2026
Nimbus × Acme · ConfidentialPage 2 of 2
fx=SUM(E4:E8)
ABCD
1
Payroll · September 2026
2 
3456789
EmployeeHoursGrossNet
J. Carter1688,333.336,212.40
L. García1607,100.005,402.75
A. Okafor1726,880.005,236.10
M. Fernández1505,400.004,180.20
S. Tanaka1647,950.005,970.35
Total81435,663.3327,001.80
Approved by Finance · 30 Sep 2026. Net pay is after income tax and social security. Transfers scheduled for 1 Oct 2026.
SeptemberAugustSummary
NNimbus Cloud GmbHCloud infrastructure
INVOICE
From
Nimbus Cloud GmbH
42 Speicherstrasse · 10115 Berlin
Bill to
Acme Operations GmbH
8 Marktgasse · 1010 Vienna
Invoice no.INV-2026-0718
Issued30 July 2026
Due13 August 2026
DescriptionQtyAmount
Cloud hosting subscriptionJuly 2026 · Production1€1.200,00
Subtotal€1.200,00
VAT 20%€240,00
Total due€1.440,00
Payment details
Bank transfer · IBAN DE89 3704 0044 0532 0130 00
Reference INV-2026-0718
Nimbus Cloud GmbH · Fictional demonstration invoicePage 1 of 1
CALIFORNIA COMMERCIAL LEASE AGREEMENT
This Lease Agreement made the 2025-05-20, by and between Hope Mante [name of lessor], of 925 The Mews [street address], hereinafter referred to as "Lessor", and Reilly Group [name of lessee], hereinafter referred to as "Lessee".
1. DESCRIPTION OF LEASED PREMISES
The Lessor agrees to lease to the Lessee 2448 square feet of Industrial Space located at 80369 Efren Burg, State of California.
2. TERM OF LEASE
The term of this Lease shall be 4 year(s) 5 month(s), commencing on the 20 May 2025 and expiring at midnight on 20 October 2029.
3. BASE RENT
The net monthly payment shall be 8646 dollars per month. A security deposit of 1395 dollars is required.
☑ Lessee may not renew the Lease.
☐ Lessee may renew with written notice 60 days prior.
Page 5 of 8
REPUBLIC OF ALDORIAIDENTITY CARD
Surname
MANTE
Given names
HOPE ELISE
Date of birth
14.03.1988
Sex
F
Document no.
AX4821937
Date of expiry
22.09.2031
H. Mante
Address
925 THE MEWS, ALDOR CITY
Issuing authority
CITY OF ALDOR · 22.09.2021
Height · Eyes
168 CM · BROWN
IDALDAX48219376<<<<<<<<<<<<
8803145F3109225ALD<<<<<<<<4
MANTE<<HOPE<ELISE<<<<<<<<
{
"invoice_no": "INV-2026-0718","due_date": "2026-08-13","total_due": 1440.00}

Extract an amount

Reuse a parse job with your JSON schema. Set grounding to field on a model that supports citations.

Request: POST /extract
curl https://api.openparser.dev/extract \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F 'request={"parse_job_id":"7f9f2f3d-0f8a-4f0a-9a2b-2f6f0a7d2c11","llm_model":"openai/gpt-6-luna","schema":{"type":"object","properties":{"total":{"type":"number"}},"required":["total"],"additionalProperties":false},"grounding":"field"};type=application/json'
Abbreviated extraction response
{
  "output": {
    "total": 4318.2
  },
  "parsed_document": {
    "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": []
  },
  "llm_model": "openai/gpt-6-luna",
  "grounding": {
    "mode": "field",
    "fields": [
      {
        "path": "total",
        "citations": [
          {
            "element_id": "elem-total",
            "page_number": 1,
            "bbox": {
              "left": 14,
              "top": 53,
              "right": 146,
              "bottom": 123
            },
            "source_type": "text",
            "granularity": "element",
            "confidence": {
              "score": 0.98,
              "scope": "recognition",
              "calibrated": false
            }
          }
        ]
      }
    ]
  },
  "attempts": [
    {
      "attempt": 1,
      "status": "succeeded",
      "llm_model": "openai/gpt-6-luna"
    }
  ]
}

Use the citation element_id and page location to find the source in parsed_document. OCR confidence describes recognition quality; it is not a probability that the extracted value is correct.

Call the extraction API

Call /extract after /parse, or queue extract jobs async and in batch. Poll /jobs for status and results.

Install
$ npm i @openparser/sdk
$ pip install openparser-sdk
POST/extractrequest
curl https://api.openparser.dev/extract \
  -H "Authorization: Bearer $OPENPARSER_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F 'request={
    "ocr_model": "paddleocr-vl-1.6",
    "llm_model": "openai/gpt-5.6-terra",
    "schema": { "properties": { "total": { "type": "number" } } },
    "grounding": "field"
  };type=application/json' \
  -F "file=@invoice.pdf"
200 · resultresponse
{
  "output": {
    "invoice_no": "INV-2026-0718",
    "total": 1440.00
  },
  "grounding": {
    "fields": [{
      "path": "total",
      "citations": [{
        "element_id": "elem-total",
        "confidence": { "score": 0.98 }
      }]
    }]
  }
}

Test your schema in Studio

Upload a document, define fields, and check the results.

Upload a document, pick an OCR model, and switch on extraction.

Schema JSON with element_id citations

Typed elements carry ids. Extraction references element_id instead of inventing coordinates, so a bad citation fails lookup.

Define your fields

Define vendor_name, line_items, totals, or other fields in your JSON schema.

Validate the output

Check types against your schema and values against source citations.

Parser and LLM split

ocr_model handles layout and OCR. llm_model handles extraction. Change either without rewriting the other step.

Choose the extraction LLM

Choose Claude, GPT, or a model you host to fill your schema.

Review source text

grounding.fields[] ties each value to element_id and bbox from the parse. You audit values against the elements they cite.

Look up source elements

Look up each cited element_id in the parsed document to check its page and location.

Parse bills by page; extract bills by token

Start with $10 in credits. Parsing starts at $1 per 1,000 pages; extraction adds LLM token costs.

parse
$1/ 1,000 pages

$10 credits at signup

extract
Per token

billed by llm_model

  • Per-page parse pricing
  • Per-token extraction
  • Sync, async, batch
  • Source citations
  • API keys in console
Create an API key

Extraction API FAQ

What do I send to the extraction endpoint?

You send a parse job id (or parse a file first), a JSON schema, an llm_model, and a grounding mode. The API fills your schema from the parsed elements and returns citations per field.

How do I request extraction with source citations?

Set grounding to field and choose an llm_model that supports field grounding. The response includes grounding metadata and, when it fits the result size limit, a lineage derivation graph. Inspect citations in the returned parsed_document to review the evidence for each field.

How do source citations work?

Each extracted field can list one or more citations with element_id, page_number, bbox, source_type, and confidence. You map element_id back to the parsed document to highlight the source region.

Can I pick the parser and extraction model separately?

Yes. Parsing uses ocr_model across ten hosted engines (Paddle, GLM-OCR, Mistral, Azure, Google, AWS Textract, and others). Extraction uses llm_model, which you set independently on the extract request.

Does extraction cost the same as parsing?

No. Open-weight hosted parsing starts at $1 per 1,000 pages; other OCR models have their own rates. Extraction adds language-model token costs. Reusing a completed parse job avoids another OCR page charge. New accounts get $10 in free credits.

Can I run extraction sync, async, or in batch?

Yes. /extract, /extract/async, and /extract/batch mirror the parse endpoints. Poll /jobs/{id} for async and batch results.

How do I review extraction evidence?

Use each citation to locate its element and page region in parsed_document. Compare the quoted source with the extracted value. Source citations support review; they do not guarantee that every value is correct.

Test /extract with your schema

Upload a PDF and run /extract in Studio

Test your schema and check the extracted fields against the PDF.