CLI · TypeScript SDK · Python SDK

Document parsing CLI for agents and CI

openparser parse sync ./doc.pdf. Switch OCR models, poll jobs, and extract JSON from a shell agents already know. SDKs mirror the same surface for Node and Python.

npm i -g @openparser/cli@openparser/sdkpip install openparser
1
2
3
b1 title
PAYMENT AUTHORIZATION
b2 field
Account
4021-8837
b3 field
Date
May 2025
b4 table
ItemAmount
Consulting$4,636.40
Adjustment-$318.20
Total$4,318.20
b5 checkbox
PaidPending
b6 signature
readingpaddleocr-vl-1.6
analyzing
0/6 blocks
/ cli

Install once. Parse anywhere.

Global CLI for agents and CI. SDK packages for application code. All three speak the same API surface.

npm i -g @openparser/cli

Global openparser binary for parse, jobs, models, and extract subcommands. Named auth profiles store API keys outside your repo.

b1
0.99
b4
0.98
b6
0.70

npm install @openparser/sdk

TypeScript SDK with the same methods as the CLI: parse sync and async, job polling, model discovery, and schema extraction.

pip install openparser

Python client for notebooks, ETL, and agent frameworks. Identical request shapes and openparser@1 responses as Node.

/ api

Parse from the terminal.

The CLI calls the same /parse and /extract routes as the SDKs. Sync for quick files, async for large PDFs, batch for folders.

endpointsapi.openparser.dev
  • Full API reference
POST/parserequest
curl https://api.openparser.dev/parse \
  -H "Authorization: Bearer op_live_…" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F 'request={"ocr_model":"paddleocr-vl-1.6","output_format":"openparser@1"};type=application/json' \
  -F "file=@statement.pdf"
response200 · 1.9s
{
  "output_format": "openparser@1",
  "document_id": "doc_3f9a2c",
  "page_count": 1,
  "markdown": "## Payment Authorization\n| Item | Amount |\n| --- | --- |\n| Total | $4,318.20 |",
  "blocks": [
    {
      "index": 0,
      "page_number": 1,
      "kind": "text",
      "text": "## Payment Authorization"
    },
    {
      "index": 1,
      "page_number": 1,
      "kind": "table",
      "table_html": "<table><tr><th>Item</th><th>Amount</th></tr><tr><td>Total</td><td>$4,318.20</td></tr></table>",
      "bbox": {
        "left": 14,
        "top": 53,
        "right": 146,
        "bottom": 123
      },
      "confidence": 0.98
    }
  ],
  "regions": [],
  "contents": [],
  "chunks": []
}
/ output

SDKs share the CLI contract.

Agents can shell out to openparser. Applications import the SDK. Both hit the same hosted API with the same ocr_model and output_format fields.

Agent-friendly CLI

Structured stdout and JSON flags fit tool-calling loops. Parse a file, pipe markdown, or dump the full openparser@1 graph for the next agent step.

b1
0.99
b4
0.98
b6
0.70

Named auth profiles

Store API keys with openparser auth login. Profiles live under ~/.config/openparser. Switch staging and prod with --profile or OPENPARSER_PROFILE.

Model discovery

openparser models ocr lists hosted engines with retail prices before you enqueue work. Same catalog as GET /models/ocr.

schema {
total
}
{
total: "$4,318"
}

Parity with SDKs

Every CLI subcommand maps to an SDK method. Move from a shell prototype to typed application code without relearning the API.

b4

Sync, async, and batch

Parse one file synchronously, queue a large PDF, or submit a batch directory. Poll jobs with the same ids the REST API returns.

b2b4b6
x, y, w, h

openparser@1 stdout

Emit markdown or the full ParsedDocument JSON. Extraction results include grounding citations tied to block ids from the parse.

/ pricing

Clients are free. Pages are metered.

Install the CLI or SDKs at no charge. Hosted parsing bills per page; open-weight hosted models start at $1 per 1,000 pages with $10 free credits.

start free
$10
to start
pay per page
$1/ 1,000 pages
open-weight hosted, starting at
+
extraction
Per token
billed based on model
  • CLI and SDKs are free to install
  • Hosted parsing metered per page
  • Open-weight hosted from $1 / 1,000 pages
  • $10 credits at signup
  • Same page prices as the REST API
Create an API key
/ questions

CLI and SDK FAQ.

Install paths, agent workflows, model flags, and where the client guides live.

How do I install the OpenParser CLI?

Run npm i -g @openparser/cli. Authenticate with openparser auth login or set OPENPARSER_API_KEY. Named profiles live under ~/.config/openparser.

Does the CLI match the REST API?

Yes. Subcommands call the same /parse, /jobs, /extract, and /models/ocr routes. Request fields like ocr_model and output_format are identical.

Can agents use the CLI instead of the SDK?

Yes. The CLI is designed for tool-calling agents that already run shell commands. Use --json for machine-readable ParsedDocument output.

Is there a Python client?

pip install openparser installs the Python SDK with the same API surface as @openparser/sdk for Node. Both return openparser@1 documents.

How do I switch OCR models from the CLI?

Pass --ocr-model or set ocr_model in the request JSON for parse commands. Run openparser models ocr to list available ids and retail prices.

Does the CLI work in CI?

Yes. Store an API key in a CI secret, configure a named profile, and run openparser parse async or batch in pipelines. Poll jobs until complete before downstream steps.

/ agents

Parse from the shell with the same openparser@1 graph.

npm i -g @openparser/cli, then openparser auth login and parse a PDF. SDKs wait when you want types in-process.