AI Document Intelligence

OCR & Parse API

Turn any PDF, receipt, invoice, contract, or ID photo into clean structured JSON. Claude Vision reads the document and returns every field — line items, totals, dates, names, addresses — validated and ready to use.

Requires a paid plan. Get your API key at 1frx.com/dashboard.html

How it works

Request

Endpoint: POST /api/parse

Requires: X-1FRX-Key header

Parameters

Parameter Type Description
file string, required Base64-encoded file content
mimeType string, required "application/pdf", "image/jpeg", "image/png", "image/webp"
schema object, optional JSON Schema to validate output against
hints string, optional Context hint e.g. "UK VAT invoice from 2024"

Example request

curl -X POST https://api.1frx.com/v1/parse \
  -H "X-1FRX-Key: sk_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "file": "JVBERi0xLjQK...",
    "mimeType": "application/pdf",
    "hints": "Invoice from a UK supplier"
  }'

Response

{
  "success": true,
  "document_type": "invoice",
  "confidence": 0.97,
  "data": {
    "invoice_number": "INV-2024-0042",
    "date": { "iso": "2024-03-15", "original": "15 March 2024" },
    "vendor": {
      "name": "Acme Ltd",
      "address": { "line1": "12 Baker Street", "city": "London", "postcode": "W1U 3BT", "country": "GB" },
      "vat_number": "GB123456789"
    },
    "line_items": [
      { "description": "Web Design Services", "quantity": 1, "unit_price": 2500.00, "total": 2500.00 }
    ],
    "totals": {
      "subtotal": { "amount": 2500.00, "currency": "GBP", "formatted": "£2,500.00" },
      "vat": { "amount": 500.00, "currency": "GBP", "formatted": "£500.00" },
      "total": { "amount": 3000.00, "currency": "GBP", "formatted": "£3,000.00" }
    }
  },
  "warnings": [],
  "usage": { "input_tokens": 1240, "output_tokens": 387 }
}

Supported document types

Limits

Error codes