Processing modes
Nutrient Data Extraction API offers auto routing and four explicit processing modes for the parse endpoint. Start with auto as the recommended starting mode. It routes each page to structure, understand, or agentic and bills at the selected mode’s rate. Select auto explicitly; the API uses understand when you omit mode.
The four explicit processing modes trade off cost, speed, and extraction depth. Choose one when your workflow requires a specific pipeline.
The API reads XLSX workbooks cell by cell in every mode. The mode doesn’t change the output for an XLSX workbook. Other spreadsheet formats are still accepted, but they don’t use this optimized XLSX path.
Processing location
Processing runs on Nutrient infrastructure in Frankfurt, with some AI inference potentially running in the US for agentic parsing and extract requests. This includes auto when it selects agentic for complex content, and extract requests regardless of parse mode. Refer to the privacy guide for regional and retention details.
Mode selection by use case
Start with the output your application needs, and then choose the mode.
| Goal | Use this endpoint and request | Why |
|---|---|---|
| Retrieval-augmented generation (RAG) ingestion, search indexing, or content migration for born-digital documents | /extraction/parse with mode: "text" and output.format: "markdown" | Fastest and cheapest path to whole-document Markdown when the source already contains text. |
| Markdown from scanned documents or images that need optical character recognition (OCR) | /extraction/parse with mode: "structure" and output.format: "markdown" | Runs OCR before producing Markdown. Use a higher mode if layout quality isn’t good enough. |
| Forms, key-value pairs, invoices, or known fields | /extraction/extract with a schema | The extract endpoint maps named fields directly to JSON. The parse endpoint returns document structure, not named label-value fields. |
| Picture or diagram alt descriptions | /extraction/parse with mode: "agentic" and output.format: "spatial" | Agentic mode uses vision language model (VLM)-enhanced analysis for visual understanding and generated descriptions. |
| Chart data, QR codes, or barcodes | /extraction/parse with mode: "understand" and output.format: "spatial" | Spatial output returns chart elements and decoded barcode elements when detected. |
To extract named fields from forms, invoices, or key-value layouts, use the /extraction/extract endpoint with a schema. The parse endpoint returns document structure, such as paragraphs, tables, and barcodes, not named label-value fields.
Mode comparison
| Routing mode | Processing modes selected per page | Cost per page |
|---|---|---|
auto | structure, understand, or agentic | $0.0015–$0.018 |
With auto, speed and extraction depth depend on the modes selected for your pages. The following table compares the four explicit modes:
text | structure | understand | agentic | |
|---|---|---|---|---|
| Cost per page | $0.001 | $0.0015 | $0.009 | $0.018 |
| Speed | Fastest | Fast | Slower | Slowest |
| Output formats | Markdown only | Spatial, Markdown | Spatial, Markdown | Spatial, Markdown |
| OCR | No | Yes | Yes | Yes |
| Artificial intelligence (AI) augmentation | No | No | Yes | Hybrid (AI + VLM) |
| Layout analysis | No | Basic segmentation | Full AI-augmented | Hybrid (AI + VLM) |
| Word-level data | — | Yes (spatial only) | Yes (spatial only) | Yes (spatial only) |
Text mode
Text mode extracts Markdown from born-digital documents. It doesn’t run OCR or AI augmentation, making it the fastest and cheapest option.
curl -X POST https://api.nutrient.io/extraction/parse \ -H "Authorization: Bearer your_api_key_goes_here" \ -F "file=@document.pdf" \ -F 'instructions={"mode":"text"}'import requests
response = requests.post( "https://api.nutrient.io/extraction/parse", headers={"Authorization": "Bearer your_api_key_goes_here"}, files={"file": open("document.pdf", "rb")}, data={ "instructions": '{"mode":"text","output":{"format":"markdown"}}' },)
print(response.json()["output"]["markdown"])import fs from "node:fs";
const form = new FormData();form.append("file", await fs.openAsBlob("document.pdf"), "document.pdf");form.append( "instructions", JSON.stringify({ mode: "text", output: { format: "markdown" } }),);
const response = await fetch("https://api.nutrient.io/extraction/parse", { method: "POST", headers: { Authorization: "Bearer your_api_key_goes_here" }, body: form,});
const result = await response.json();console.log(result.output.markdown);The JavaScript samples use fs.openAsBlob, which requires Node 19.8 or later.
When to use text mode
- RAG ingestion and search indexing where you need clean Markdown from born-digital documents
- High-throughput pipelines where cost and speed matter more than spatial data
Limitations
- Only supports
markdownoutput format - No OCR — Text in scanned documents or images won’t be returned
Structure mode
Structure mode runs OCR-based segmentation to extract typed document elements with bounding boxes and confidence scores. It handles scanned documents, images, and any file requiring OCR.
curl -X POST https://api.nutrient.io/extraction/parse \ -H "Authorization: Bearer your_api_key_goes_here" \ -F "file=@document.pdf" \ -F 'instructions={"mode":"structure","output":{"format":"spatial"}}'import requests
response = requests.post( "https://api.nutrient.io/extraction/parse", headers={"Authorization": "Bearer your_api_key_goes_here"}, files={"file": open("document.pdf", "rb")}, data={ "instructions": '{"mode":"structure","output":{"format":"spatial"}}' },)
result = response.json()for element in result["output"]["elements"]: print(f'{element["type"]}: {element.get("text", "")}')import fs from "node:fs";
const form = new FormData();form.append("file", await fs.openAsBlob("document.pdf"), "document.pdf");form.append( "instructions", JSON.stringify({ mode: "structure", output: { format: "spatial" } }),);
const response = await fetch("https://api.nutrient.io/extraction/parse", { method: "POST", headers: { Authorization: "Bearer your_api_key_goes_here" }, body: form,});
const result = await response.json();result.output.elements.forEach((el) => { console.log(`${el.type}: ${el.text || ""}`);});When to use structure mode
- Scanned documents and images that require OCR
- Workflows that need spatial data (bounding boxes, coordinates) at lower cost than understand mode
- Documents with straightforward layouts where AI augmentation isn’t necessary
- OCR-backed Markdown from scans when layout complexity is low
Limitations
- Doesn’t return named fields for forms or invoices. For named label-value fields, use
/extraction/extractwith a schema. - Can miss complex table structure, multicolumn layout relationships, and form semantics because it doesn’t use AI augmentation.
Understand mode
Understand mode runs the full extraction pipeline with AI augmentation on top of OCR. It produces the most accurate results for complex documents with tables, multicolumn layouts, nested structures, formulas, and form fields.
curl -X POST https://api.nutrient.io/extraction/parse \ -H "Authorization: Bearer your_api_key_goes_here" \ -F "file=@document.pdf" \ -F 'instructions={"mode":"understand","output":{"format":"spatial"}}'import requests
response = requests.post( "https://api.nutrient.io/extraction/parse", headers={"Authorization": "Bearer your_api_key_goes_here"}, files={"file": open("document.pdf", "rb")}, data={ "instructions": '{"mode":"understand","output":{"format":"spatial"}}' },)
result = response.json()for element in result["output"]["elements"]: print(f'{element["type"]}: {element.get("text", "")}')import fs from "node:fs";
const form = new FormData();form.append("file", await fs.openAsBlob("document.pdf"), "document.pdf");form.append( "instructions", JSON.stringify({ mode: "understand", output: { format: "spatial" } }),);
const response = await fetch("https://api.nutrient.io/extraction/parse", { method: "POST", headers: { Authorization: "Bearer your_api_key_goes_here" }, body: form,});
const result = await response.json();result.output.elements.forEach((el) => { console.log(`${el.type}: ${el.text || ""}`);});When to use understand mode
- Complex documents with tables, charts, multicolumn layouts, or nested structures
- Invoice and form processing where accurate data extraction matters
- Documents with formulas, tables, charts, QR codes, barcodes, printed-style handwriting, or mixed content types
- Any workflow where extraction accuracy is more important than cost
If you already know the fields you want, such as invoice_number, vendor_name, or total_amount, consider the /extraction/extract endpoint instead of reconstructing fields from spatial elements.
Agentic mode
Agentic mode builds on the understand pipeline and augments it with a VLM. The VLM improves results in areas like image descriptions, complex layout analysis, and semantic understanding. It’s designed for the most complex documents that require the deepest visual understanding.
curl -X POST https://api.nutrient.io/extraction/parse \ -H "Authorization: Bearer your_api_key_goes_here" \ -F "file=@document.pdf" \ -F 'instructions={"mode":"agentic","output":{"format":"spatial"}}'import requests
response = requests.post( "https://api.nutrient.io/extraction/parse", headers={"Authorization": "Bearer your_api_key_goes_here"}, files={"file": open("document.pdf", "rb")}, data={ "instructions": '{"mode":"agentic","output":{"format":"spatial"}}' },)
result = response.json()for element in result["output"]["elements"]: print(f'{element["type"]}: {element.get("text", "")}')import fs from "node:fs";
const form = new FormData();form.append("file", await fs.openAsBlob("document.pdf"), "document.pdf");form.append( "instructions", JSON.stringify({ mode: "agentic", output: { format: "spatial" } }),);
const response = await fetch("https://api.nutrient.io/extraction/parse", { method: "POST", headers: { Authorization: "Bearer your_api_key_goes_here" }, body: form,});
const result = await response.json();result.output.elements.forEach((el) => { console.log(`${el.type}: ${el.text || ""}`);});When to use agentic mode
- Documents with embedded images, charts, or diagrams where you need generated alt descriptions, not just classification
- Degraded scans, faxes, low-quality images, or documents where understand mode produces visible gaps in extracted text
- Cursive, connected, freeform, dense, or annotated handwriting (such as forms with handwritten markup or filled-in government forms) where understand mode’s character-level recognition isn’t sufficient
- Workflows where you’ve tested understand mode on a representative sample and the quality isn’t sufficient for your use case
Limitations
- Slowest processing mode
- Highest cost: $0.018 per page
Choosing the right mode
Start with auto, especially when evaluating the API or processing a mix of document types. Choose an explicit mode when you have a specific output, cost, or quality requirement:
- Do you only need Markdown from born-digital documents?
- Yes — Use text mode. It’s the fastest and cheapest option ($0.001 per page), but has no OCR.
- No — Continue to step 2.
- Do you need Markdown from scanned documents or images?
- Yes — Use structure mode with
output.format: "markdown"to run OCR before Markdown generation. Move tounderstandif the layout quality isn’t good enough. - No — Continue to step 3.
- Yes — Use structure mode with
- Are you extracting forms, key-value pairs, invoices, or known fields?
- Yes — Use the
/extraction/extractendpoint with a schema. The parse endpoint returns document structure, not named label-value fields. - No — Continue to step 4.
- Yes — Use the
- Do your documents need image descriptions or contain cursive handwriting, or has understand mode produced insufficient quality on a representative sample?
- No — Stay with
auto. Chooseunderstandexplicitly when you need its AI-augmented pipeline for every document. - Yes — Use agentic mode. VLM augmentation on top of the understand pipeline adds descriptions for embedded images. It also lifts quality on degraded scans, cursive or freeform handwriting, and other hard-to-read content where understand mode falls short.
- No — Stay with
For mixed-complexity pipelines, auto selects a mode for each page. Its cost depends on the routing mix and can exceed understand when pages use agentic.
Handwriting
Handwriting recognition depends on both the writing style and the quality of the input image.
Match the mode to the writing style
- Printed-style handwriting — Clearly separated letters and short entries such as names, dates, and filled-in form fields. Understand mode handles this well with character-level OCR.
- Cursive, connected, or freeform handwriting — Use agentic mode. Understand mode reads handwriting one character at a time, so connected or stylized writing produces frequent errors. The VLM in agentic mode interprets whole words and lines and is substantially more reliable for these documents.
Even in agentic mode, recognition of an ambiguous word can be confident but wrong. The model may settle on a plausible word that differs from what the writer actually wrote. For high-stakes fields, check the per-element confidence scores and add a human review step where accuracy is critical.
Cost per mode
| Mode | Cost per page | 10-page document |
|---|---|---|
auto | $0.0015–$0.018 | $0.015–$0.18 |
text | $0.001 | $0.01 |
structure | $0.0015 | $0.015 |
understand | $0.009 | $0.09 |
agentic | $0.018 | $0.18 |
See pricing for more details and frequently asked questions (FAQs).