Skip to main content
Balanced mode runs an extraction pipeline with independent verification. Every extracted field includes an audit trail: where the value came from, how it was derived, and whether an independent check confirmed it. Before you begin, make sure you have:
  1. A Datalab account with an API key (new accounts include $5 in free credits)
  2. Python 3.10+ installed
  3. The Datalab SDK: pip install datalab-python-sdk
  4. Your DATALAB_API_KEY environment variable set

When to Use Fast vs Balanced

Use fast when speed and cost matter most. Use balanced when you need to trust every field and want metadata to power downstream decisions.

Schema size on short documents

For shorter documents (under 20 pages), balanced mode limits how large your schema can be. Documents of 20+ pages have no schema-size limit. If a schema is too large for a short document, the request fails with a clear error telling you your field count and your options — and you aren’t charged.

Count your fields

A field is one value you get back — a string, number, date, true/false, or one choice from a fixed list. Objects and lists are containers, not fields — count the fields inside them. A list of repeated items counts its fields once, no matter how many rows the document has. 4 fields:
5 fields — the object is a container, so count what’s inside it:
4 fields — a list’s columns count once, not once per row:

How many fields can I use?

About 25 fields is a comfortable limit for any schema on a short document. Larger schemas often work too — especially flat ones without deep nesting — but the more fields you add, and the more deeply they’re nested (lists of objects several levels down), the more likely you are to reach the limit. You don’t have to guess: if a schema is too large for a short document, the request fails with a clear error (and you aren’t charged), so it’s safe to try a larger one. If you need a bigger schema on a short document:
  1. Split it into multiple extractions — for example, header fields in one request and a large list in another.
  2. Use fast mode — it supports larger schemas and costs less, without the per-field verification metadata.
  3. Trim and flatten — drop fields you don’t use and reduce nesting.
This applies only to balanced mode on documents under 20 pages. Documents of 20+ pages support schemas of any size.

Quick Start

extraction_mode controls the extraction pipeline (fast or balanced). This is separate from mode, which controls the document parsing stage (fast, balanced, or accurate). You can combine them independently — for example, mode="fast" with extraction_mode="balanced".extraction_mode is not yet exposed in the Python SDK’s ExtractOptions. To set it explicitly, use the cURL or Python requests examples above. When omitted, the team’s configured default applies (see Changelog — 6/4/2026 for default rules).

Response Format

In balanced mode, each extracted field includes three sibling keys. The _citations sibling is the same format as fast mode for compatibility — balanced mode adds _meta with richer metadata on top:
The _citations key is shared with fast mode — if you switch between modes, citation-consuming code continues to work. The _meta key is balanced-mode-only and contains the full audit trail.

Field Metadata

Each _meta object contains:

Extraction Status

Verification Status

In practice, most fields will be PASS or FAIL_UNRESOLVABLE after verification. The other statuses indicate cases where the verifier flagged an issue that could not be fully resolved automatically.

Building Workflows with Verification Metadata

The per-field metadata enables automated quality gates:

Common Workflow Patterns

  • Auto-approve when all fields have verification.status == "PASS" — no human review needed
  • Flag for review when any field is NOT_RESOLVABLE or has a FAIL_* verification status — the document may be missing information or the extraction needs a human check
  • Show citations to reviewers so they can verify in seconds — each field links back to specific blocks in the document
  • Use reasoning as an audit trail — for compliance workflows, the per-field reasoning documents exactly how each value was produced, with block-level citations back to the source document

Next Steps

Structured Extraction Overview

Schema format, response structure, and extraction tips

Confidence Scoring

Additional per-field confidence scores (works with both modes)

Saved Schemas

Save and version schemas for reuse across requests

Handling Long Documents

Tips for extracting from 100+ page documents