* * * PENNYOCR × PYDANTIC AI * * *
PennyOCR with Pydantic AI.
Pydantic AI is about typed, validated agent IO — and our SDK speaks the same language: dataclass results, deterministic errors, exact costs. Register one tool function and your agent reads any PDF or image with a schema it can trust.
START FREE — 50 PAGES
$0.75 / 1,000 PAGES
1,333 PAGES PER DOLLAR · NO CREDIT CARD
AT A GLANCE
UPDATED
- PRICE
- $0.75 per 1,000 pages ($0.00075 per page), prepaid
- FREE TIER
- First 50 pages free per account, no credit card
- FORMATS
- PDF, PNG, JPEG, WebP, TIFF
- LIMITS
- 50 MB and 500 pages per request
- OUTPUT
- JSON with markdown (tables preserved) or plain text, per page and joined
- INTERFACES
- REST API, OpenAI-compatible chat completions, MCP server
- CREDITS
- Never expire; requests stop with a 402 when the balance runs out
01 / TRY IT
ONE ENDPOINT.
POST a file, get JSON back — the extracted text, per page and joined. PDF, PNG, JPEG, WebP or TIFF.
curl https://api.pennyocr.com/v1/ocr \
-H "Authorization: Bearer $PENNYOCR_API_KEY" \
-F "file=@invoice.pdf"
# $0.75 per 1,000 pages, first 50 free02 / USE CASES
THE TYPED TOOL.
THE CODE
@agent.tool_plain · def read_document(path: str) -> str: return PennyOCR().ocr(path, format="markdown").text — result objects are dataclasses (id, pages, text, page_results, cost_usd).
TYPED FAILURES
PennyOCRError carries status_code: 402 means buy credits, 413 means split the document, 422 means the file's unreadable. Agents can branch on it cleanly.
COST IN THE LOOP
Return cost_usd alongside content and let the agent track its own budget across a run.
VIA MCP INSTEAD
Pydantic AI speaks MCP: add https://mcp.pennyocr.com as a tool server and skip the wrapper entirely.
03 / PRICE CHECK
HALF THE PRICE OF THE BIG CLOUDS.
Per 1,000 pages, public list prices, first tier.
PENNYOCR$0.75
AWS TEXTRACT$1.50
GOOGLE CLOUD VISION$1.50
AZURE DOC INTELLIGENCE$1.50
YOU KEEP50%
ASYNC SUPPORT?
The REST endpoint works with httpx.AsyncClient today (one multipart POST); an async SDK method is on the roadmap.
STRUCTURED EXTRACTION INTO PYDANTIC MODELS?
Today: markdown in, your model's structured-output pass out — works well. A native /v1/extract that takes a JSON schema is on the roadmap.
HOW DO I TEST WITHOUT SPENDING?
Your first 50 pages are free, and estimate_cost (free) for URL documents. Enough to build and test the whole tool path.
ALSO ON THE MENU