# docparse-x402 Document OCR

> docparse-x402 Document OCR is a paid API for AI agents from docparse-x402.f3rnandonhan.workers.dev, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-10).

Extracts structured JSON data (vendor, date, line items, totals, tax) from receipt, invoice, and fiscal-document images or PDFs using OCR

## Facts

- Endpoint: POST https://docparse-x402.f3rnandonhan.workers.dev/parse-document?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/docparse-x402-document-ocr-4c0e7046
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ZMCoLKLQauJT0HeVDhhvJ

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability docparse-x402-document-ocr-4c0e7046 -d '<json body>'
```

Example prompt: I have a JPEG photo of a restaurant receipt — can you parse it into structured JSON and pull out the vendor name, date, line items with prices, tax, and total amount?

## When to prefer this

Choose this endpoint when you need structured JSON extraction from receipt, invoice, or fiscal-document images/PDFs with per-call micropayment pricing via USDC on Base. Ideal for expense automation, accounting pipelines, or compliance workflows where you need line-item detail, tax, and vendor data without a subscription. Prefer over generic OCR when you specifically need fiscal-document-aware field extraction with a confidence score.

## Known failure modes

- Invalid or corrupt base64 image data — returns error or low-confidence result
- Unsupported MIME type — processing may fail or return empty fields
- Handwritten or very low-resolution documents — confidence score will be low, fields may be null
- Missing required fields (image or mimeType) — request rejected
- Document is not a fiscal document (e.g. plain text page) — document_type returns 'other' with sparse fields
- Payment failure or insufficient USDC balance — x402 payment error before processing

## How this service works

Receipt, invoice, and fiscal-document OCR into structured JSON for AI agents. USDC on Base mainnet via Coinbase CDP facilitator.

## Output

A JSON object containing: document_type (invoice, receipt, fiscal_note, or other), vendor_name, document_date (ISO 8601), currency (ISO 4217), line_items array (each with description, quantity, unit_price, total), tax_amount, total_amount, and a confidence score (0–1) indicating extraction reliability.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "image",
  "mimeType"
 ],
 "properties": {
  "image": {
   "type": "string",
   "description": "Base64-encoded image or PDF of the document (no data: prefix)"
  },
  "mimeType": {
   "type": "string",
   "description": "e.g. image/jpeg, image/png, application/pdf"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "currency": {
   "type": [
    "string",
    "null"
   ],
   "description": "ISO 4217 code, e.g. USD, BRL"
  },
  "confidence": {
   "type": "number",
   "description": "0 to 1, your confidence in this extraction"
  },
  "line_items": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "total": {
      "type": [
       "number",
       "null"
      ]
     },
     "quantity": {
      "type": [
       "number",
       "null"
      ]
     },
     "unit_price": {
      "type": [
       "number",
       "null"
      ]
     },
     "description": {
      "type": "string"
     }
    }
   }
  },
  "tax_amount": {
   "type": [
    "number",
    "null"
   ]
  },
  "vendor_name": {
   "type": [
    "string",
    "null"
   ]
  },
  "total_amount": {
   "type": [
    "number",
    "null"
   ]
  },
  "document_date": {
   "type": [
    "string",
    "null"
   ],
   "description": "ISO 8601 date, if found"
  },
  "document_type": {
   "type": "string",
   "description": "invoice, receipt, fiscal_note, or other"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/docparse-x402-document-ocr-4c0e7046/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from docparse-x402.f3rnandonhan.workers.dev](https://www.zero.xyz/host/docparse-x402.f3rnandonhan.workers.dev/llms.txt)
