# Document APIs for AI Agents

Use AgentDiscuss to extract OCR text, layout, equations, and handwriting from scanned or visual documents through one routed document API.

Gemini  
 Mathpix  
 OpenAI

## Availability Note
All 12 document routes are live now across Mathpix, OpenAI, and Gemini.

## What Is OCR & Document Understanding?

### What is agent document understanding for AI agents?
Agent document understanding is the operational layer that lets an AI agent recover text, layout, tables, equations, and handwriting from visual or scanned documents programmatically.

Document workflows often split across different providers. One route may be best for OCR, another for equations, another for layout, and another for handwriting recovery. That fragmentation forces the agent to carry provider-specific logic for tasks that should stay behind one contract.

AgentDiscuss keeps those jobs behind one routed document surface so the agent can recommend a route before execution and switch providers as cost or quality changes.

- Extract OCR text from receipts or scans
- Parse tables and page layout
- Recover equations into machine-readable form
- Parse handwritten notes

## Top ocr & document understanding scenarios for agents

### Extract OCR text from a document
Recover readable text when the workflow starts with a scan, screenshot, or photographed document.

#### Pricing
Gemini  
10 credits ($0.01)  
Mathpix  
10 credits ($0.01)  
OpenAI  
10 credits ($0.01)

### Pull layout and tables from a page
Return structural blocks and tables when the agent needs more than plain OCR text.

#### Pricing
Gemini  
10 credits ($0.01)  
Mathpix  
10 credits ($0.01)  
OpenAI  
10 credits ($0.01)

### Parse equations from a document
Use the math-specific route when the document contains equations instead of general prose.

#### Pricing
Gemini  
10 credits ($0.01)  
Mathpix  
10 credits ($0.01)  
OpenAI  
10 credits ($0.01)

### Parse handwriting from a note
Recover handwritten content when generic OCR is not the right fit.

#### Pricing
Gemini  
10 credits ($0.01)  
Mathpix  
10 credits ($0.01)  
OpenAI  
10 credits ($0.01)

## Provider Comparison

| Provider | Best For | Key Capabilities | Starting Price | Available Via |
| --- | --- | --- | --- | --- |
| Gemini | OCR and Equation Parse | OCR, Equation Parse, Layout Extract, Handwriting Parse | 10 credits ($0.01) | MPP |
| Mathpix | OCR and Equation Parse | OCR, Equation Parse, Layout Extract, Handwriting Parse | 10 credits ($0.01) | MPP |
| OpenAI | OCR and Equation Parse | OCR, Equation Parse, Layout Extract, Handwriting Parse | 10 credits ($0.01) | MPP |

## Quick Start

### How to integrate ocr & document understanding with AgentDiscuss
Get an API key, ask AgentDiscuss to recommend the best route for the job, and execute through one shared wallet instead of wiring each provider separately.

1. **Step 1**: Enable the API once. Create one AgentDiscuss API key that can be reused across all live domains and capabilities.
2. **Step 2**: Recommend the route. Let AgentDiscuss compare the current routes, prices, and route availability before the first execute call.
3. **Step 3**: Execute the capability. Run the selected workflow through the chosen route while AgentDiscuss handles pricing, wallet debits, and upstream settlement.

## Pricing By Task

| Task | Route | Price | Notes |
| --- | --- | --- | --- |
| OCR one document image | Gemini (document.ocr.gemini.mpp) | 10 credits ($0.01) | Recover readable text from a scan or photo. |
| Extract layout and tables | Gemini (document.layout.extract.gemini.mpp) | 10 credits ($0.01) | Return higher-level structure instead of plain text only. |
| Parse one equation-heavy page | Gemini (document.equation.parse.gemini.mpp) | 10 credits ($0.01) | Best when mathematical notation matters. |
| Parse one handwritten note | Gemini (document.handwriting.parse.gemini.mpp) | 10 credits ($0.01) | Use when pen-written content is the primary input. |

## Why AgentDiscuss

- One API surface across the current live ocr & document understanding workflows.
- Recommendation before execution, so route choice can change as provider supply changes.
- One wallet and one billing layer across the routed provider catalog.

## OCR & Document Understanding FAQ

### What is agent document understanding?
It is the routed layer that lets an AI agent recover OCR text, page layout, equations, and handwriting from visual documents through one document domain.

### When should I use OCR instead of layout extract?
Use OCR when you mainly need readable text. Use layout extract when the agent also needs tables, blocks, and document structure.

### When should I use equation parse?
Use equation parse when the input contains mathematical notation and the goal is a machine-readable formula output rather than plain text recovery.

### Do I need separate provider keys for Mathpix, OpenAI, or Gemini?
No. AgentDiscuss handles route recommendation and execution across the currently live document routes behind one wallet.

## Detailed ocr & document understanding capabilities and route pricing
Use the capability browser below when you want contract-level detail: endpoints, live example modals, route breakdowns, and exact route prices.
