/nutrient-dws:document-extraction-apifrom nutrient-dws
Parses documents into Markdown or spatial elements, extracts named fields (e.g., invoice totals) with source citations, classifies documents by type, and detects boundaries in merged packets using the Nutrient Data Extraction API.
Ships in nutrient-dws. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Use this skill to build with the Data Extraction API. To process a file in chat, connect the hosted Nutrient MCP plugin for its supported document tasks.
| Desired result | Use |
|---|---|
| Named fields, such as invoice number, total, and line items, with evidence | extract with a JSON Schema via scripts/extract.py. |
| Whole-document Markdown for RAG, search, or migration | parse with Markdown output via scripts/parse.py. |
| Document layout, bounding boxes, or every detected table | parse with spatial output via scripts/parse.py. |
| The likely document type, such as invoice, receipt, or contract | classify via the Classify API. |
| Where the component documents start and end in a merged file | split via the Split API. |
For RAG chunking of a parsed document, see the sibling grounded-rag-ingestion skill. For
PDF generation, conversion, OCR, redaction, signing, or any /build-based workflow, use the
sibling document-processor-api skill.
Follow the linked API examples for these operations. The bundled scripts cover parsing and field extraction.
POST /extraction/classify with at least two meaningful labels for a direct
classification request. The result ranks labels with scores. Route ambiguous results to review.POST /extraction/split when the workspace has Split enabled. Read the one-based,
inclusive page ranges and boundary confidence from output.segments. When you need
one PDF per segment, the API can also return a ZIP download.document-processor-api skill instead./extraction/extract — schema field extraction with citationsDefine the fields you want in a JSON Schema (root type: object); extract returns
output.data with those values and output.metadata with per-field citation metadata
(options.includeCitations defaults on). Accepts a local file or a URL.
For a first run, save the schema from the Extract API examples
as fields.json and use the synthetic sample invoice.
Look for invoice number INV-DEMO-1042 and total 176.00 USD with citations on page 1.
# Pull schema-defined fields from a local invoice, with citations (default)
uv run scripts/extract.py --input invoice.pdf --schema fields.json --out result.json
# From the public sample URL
uv run scripts/extract.py --url https://www.nutrient.io/downloads/pdf-to-json-review/invoice.pdf \
--schema fields.json --out result.json --mode understand
Use the Data Extraction pricing guide
and the response's usage for current charges. The bundled script gates high local estimates
behind --yes and can display legacy credit-based estimates. See
references/extract-output-and-citations.md for the response shape. Include the source page
when reporting cited values, and flag missing or uncertain evidence for review.
NUTRIENT_EXTRACT_API_KEY:
export NUTRIENT_EXTRACT_API_KEY="pdf_live_..."
scripts/ relative to this SKILL.md. Use the directory containing this
SKILL.md as the working directory:
cd <directory containing this SKILL.md> && uv run scripts/<script>.py --help
The helpers prefer NUTRIENT_EXTRACT_API_KEY and can use a global key with Data Extraction
access via NUTRIENT_API_KEY when the first variable is unset.
/extraction/parse — one primitive, two output shapesOne call returns a structural document model with typed elements, bounding boxes, confidence scores, and reading order, or a whole-document Markdown string. The processing mode determines which element types are available.
The processing modes guide
recommends auto as a starting point for direct API integrations. It routes each page
to structure, understand, or agentic. The bundled parse.py helper takes explicit
modes and defaults to structure with spatial output.
| User intent | Mode | Output |
|---|---|---|
| Read an existing PDF text layer for search or RAG | text | Markdown |
| Read a scan or photo with OCR | structure | Markdown or spatial |
| Enumerate form regions or detect semantic layout | understand | Spatial |
| Describe figures or diagrams | agentic | Spatial |
For large runs, estimate the cost from the current per-page prices and the page count. When using a legacy credit estimate, confirm with the operator before running above 200 extraction credits.
# Default: structure mode, spatial output
uv run scripts/parse.py --input doc.pdf --out out.json
# Markdown for RAG (text mode — cheapest)
uv run scripts/parse.py --input doc.pdf --out out.md --output-format markdown --mode text
# Enumerate all key-value regions of a form (understand mode) — for NAMED fields use extract
uv run scripts/parse.py --input doc.pdf --out out.json --mode understand
# Agentic (VLM alt text on pictures)
uv run scripts/parse.py --input doc.pdf --out out.json --mode agentic
The script reports legacy credit usage when present in the response. Use the API response or dashboard to verify current charges.
After a single /parse call, slice the response for common needs:
output.elements sorted by (page.pageIndex, readingOrder), join paragraph and handwriting text fieldscells[] on each table element into rows/columns using cell.row and cell.columnpairs[] on each keyValueRegion element — each pair has .key.value and .value.valuelatex on each formula elementclassification and altDescription (populated by agentic mode) on each picture element--output-format markdown; the script writes the Markdown string directlyFor the canonical response schema and per-mode field availability, see the official docs linked from references/parse-output-filtering.md; that file also lists the tools we suggest for filtering and reshaping the response.
parse.py accepts local file paths. For a document at a public URL, use the
Parse API's documented JSON URL input.
references/extract-output-and-citations.md (opens in a new tab)references/parse-output-filtering.md (opens in a new tab)scripts/extract.py (opens in a new tab)scripts/lib/common.py (opens in a new tab)scripts/lib/test_common.py (opens in a new tab)scripts/parse.py (opens in a new tab)scripts/test_extract.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub pspdfkit-labs/nutrient-skills --plugin nutrient-dws6 skills in this plugin
/ai-gatewayTwo primitives of the Nutrient AI Gateway. Chat models (`nutrient-s`/`nutrient-m`/`nutrient-l` via `POST /responses` or `POST /chat/completions`) are OpenAI-compatible, for open-ended generation. The decision API (`POST /systemone`, TypeSafe-compatible) returns calibrated probabilities instead of free text, for routing, flagging, and scoring — `noul` for yes/no, `choice` for picking one of several labels, `score` for placing content on an ordered scale. Route to the decision API whenever the task is "classify this", "is this true/false", "route to a category", "flag for review", "rate the severity/quality", or anything else that would otherwise need regex, keyword matching, or asking a chat model to emit structured JSON. Route to a chat model for open-ended generation, summarization, or tool-calling. Triggers include AI Gateway, nutrient-document-decision, nutrient-systemone, System One, TypeSafe, calibrated probability, noul question, choice question, score question, classify this document/message, route to a category, flag for review, confidence threshold./document-processor-apiProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble documents or split PDFs at known page ranges, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery. For accessibility or PDF/UA-1 validation of an existing PDF, use remediate-pdf./dws-viewer-apiUpload documents to Nutrient-managed cloud storage and mint browser viewer session JWTs via the Nutrient DWS Viewer API (cloud-hosted document viewing). Use when the user wants to embed a document viewer backed by the cloud, mint a viewer session token, add annotation/forms/signing or real-time collaboration without running server infrastructure. Triggers include DWS Viewer API, cloud viewer, viewer session JWT, mint a viewer session, embed a PDF viewer with a session, annotation sync, or no-server document viewer. Not for the self-hosted Web SDK (`@nutrient-sdk/viewer` / `NutrientViewer.load` without a DWS session) — that is `nutrient-web-sdk`; not for self-hosted annotation persistence — that is `nutrient-document-engine`./grounded-rag-ingestionChunk a document into provenance-carrying JSONL ready for embedding via the Nutrient Data Extraction API (`/extraction/parse`, spatial output). Every chunk carries element type, page index, bounding box, confidence, and reading order, traceable to a specific page region. Use for grounded or auditable RAG, cited retrieval, confidence-aware ingestion, or any pipeline that must prove which document region a retrieved answer came from. Triggers include grounded RAG, auditable RAG, RAG with provenance, chunk with bounding box, cite page, provenance-carrying chunks, confidence-aware chunking, or embedding pipeline. Not for cheap Markdown — use document-extraction-api with `--output-format markdown` for that. Not for known target fields — if the user wants specific fields ("invoice number and total", "map to my schema", "return these fields cited"), use document-extraction-api's `extract` (one cited call), not whole-document chunking./signer-apiIntroduces the Nutrient DWS Signer API, which sends documents for legally binding eSignatures and tracks every envelope. The API is not public yet: it is available only on the Enterprise plan. Use when the user asks about Nutrient Signer, sending a PDF for signature, or eSignature envelopes.Other plugins' skills for the same job