# BRAINIAC Invoice Data Extraction API

> BRAINIAC Invoice Data Extraction API is a paid API for AI agents from www.brainiac.software, paid per call via x402, $0.06/call, status unknown (last checked 2026-11-17).

Extracts structured invoice fields (supplier, amounts, dates, line items, etc.) from uploaded PDF, plain text, or CSV invoice documents using AI, returning per-field extraction status and evidence.

## Facts

- Endpoint: POST https://www.brainiac.software/api/v1/accounts-payable/invoice-data-extract?utm_source=zero.xyz
- Price: $0.06/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/brainiac-invoice-data-extraction-api-f085f00e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_zhN_VNHrIgPaM622dmTjF

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 brainiac-invoice-data-extraction-api-f085f00e -d '<json body>'
```

Example prompt: Can you extract all the structured data from this invoice PDF — supplier name, invoice number, date, due date, line items, tax, and total — and tell me which fields you were able to find versus which ones were missing?

## When to prefer this

Use this endpoint when you need to extract structured invoice data from documents (PDF, text, or CSV) in a pay-per-call, no-account-required workflow. It is well-suited for accounts payable automation, invoice validation pipelines, and situations where you want explicit per-field confidence and evidence provenance. Prefer this over generic OCR when you need invoice-specific fields (PO number, payment terms, line items, tax rate) with status and evidence annotations. The x402/USDC micropayment model (Base blockchain) makes it ideal for agents that need usage-based billing without API key management.

## Known failure modes

- File too large (base64 exceeds 12,000,000 chars) — request rejected
- Unsupported media type — only PDF, plain text, and CSV accepted
- Ambiguous or slash-format dates not parsed — field returned as 'unavailable' with a finding
- Field not present in document — status 'unavailable' with null value and null evidence
- CSV without labeled columns — line items may not be mapped correctly
- Malformed base64 encoding — file cannot be decoded
- Invoice fields that require external data (tax rules, supplier records) — left unavailable, not invented

## How this service works

Pay-per-call APIs for AI agents: OFAC sanctions screening, compliance checks, token security, and Base chain data via x402. No account. Fixed USDC price. MCP-ready.

## Output

A JSON object with a 'fields' array where each entry contains the field name, extracted value, extraction status ('extracted' or 'unavailable'), and the evidence text from the document that supported the extraction. Also includes 'findings' (warnings or issues encountered, like ambiguous date formats), 'limitations' (scope disclaimers), 'source' (always 'document'), and a 'checkedAt' timestamp. No payment is initiated by the API.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "file": {
   "type": "object",
   "required": [
    "mediaType",
    "fileBase64"
   ],
   "properties": {
    "filename": {
     "type": "string",
     "maxLength": 180,
     "minLength": 1
    },
    "mediaType": {
     "enum": [
      "application/pdf",
      "text/plain",
      "text/csv"
     ],
     "type": "string"
    },
    "fileBase64": {
     "type": "string",
     "maxLength": 12000000,
     "minLength": 1
    }
   },
   "additionalProperties": false
  },
  "invoice": {
   "type": "object",
   "properties": {
    "tax": {
     "type": "number",
     "maximum": 1000000000000,
     "minimum": -1000000000000
    },
    "lines": {
     "type": "array",
     "items": {
      "type": "object",
      "required": [
       "description"
      ],
      "properties": {
       "sku": {
        "type": "string",
        "maxLength": 80,
        "minLength": 1
       },
       "tax": {
        "type": "number",
        "maximum": 1000000000000,
        "minimum": -1000000000000
       },
       "amount": {
        "type": "number",
        "maximum": 1000000000000,
        "minimum": -1000000000000
       },
       "quantity": {
        "type": "number",
        "maximum": 1000000000,
        "minimum": -1000000000
       },
       "unitPrice": {
        "type": "number",
        "maximum": 1000000000000,
        "minimum": -1000000000000
       },
       "description": {
        "type": "string",
        "maxLength": 300,
        "minLength": 1
       }
      },
      "additionalProperties": false
     },
     "maxItems": 200
    },
    "total": {
     "type": "number",
     "maximum": 1000000000000,
     "minimum": -1000000000000
    },
    "dueDate": {
     "type": "string",
     "format": "date",
     "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
    },
    "taxRate": {
     "type": "number",
     "maximum": 100,
     "minimum": 0
    },
    "currency": {
     "type": "string",
     "pattern": "^[A-Za-z]{3}$"
    },
    "discount": {
     "type": "number",
     "maximum": 1000000000000,
     "minimum": -1000000000000
    },
    "poNumber": {
     "type": "string",
     "maxLength": 80,
     "minLength": 1
    },
    "shipping": {
     "type": "number",
     "maximum": 1000000000000,
     "minimum": -1000000000000
    },
    "subtotal": {
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "fields": [
   {
    "name": "supplierName",
    "value": "Northwind Paper Ltd",
    "status": "extracted",
    "evidence": "Northwind Paper Ltd"
   },
   {
    "name": "invoiceNumber",
    "value": "INV-100",
    "status": "extracted",
    "evidence": "INV-100"
   },
   {
    "name": "invoiceDate",
    "value": "2026-10-01",
    "status": "extracted",
    "evidence": "2026-10-01"
   },
   {
    "name": "dueDate",
    "value": null,
    "status": "unavailable",
    "evidence": null
   },
   {
    "name": "currency",
    "value": "USD",
    "status": "extracted",
    "evidence": "Currency: USD"
   },
   {
    "name": "poNumber",
    "value": "PO-55",
    "status": "extracted",
    "evidence": "PO-55"
   },
   {
    "name": "paymentTerms",
    "value": "Net 30",
    "status": "extracted",
    "evidence": "Net 30"
   },
   {
    "name": "subtotal",
    "value": "55",
    "status": "extracted",
    "evidence": "55.00"
   },
   {
    "name": "discount",
    "value": null,
    "status": "unavailable",
    "evidence": null
   },
   {
    "name": "shipping",
    "value": null,
    "status": "unavailable",
    "evidence": null
   },
   {
    "name": "tax",
    "value": "0",
    "status": "extracted",
    "evidence": "0.00"
   },
   {
    "name": "taxRate",
    "value": null,
    "status": "unavailable",
    "evidence": null
   },
   {
    "name": "total",
    "value": "55",
    "status": "extracted",
    "evidence": "55.00"
   }
  ],
  "source": "document",
  "findings": [
   {
    "code": "due_date_unparsed",
    "detail": "The document due date \"02/11/2026\" was not an unambiguous calendar date. Slash dates were not guessed.",
    "severity": "unavailable"
   }
  ],
  "checkedAt": "2026-11-02T19:00:00.000Z",
  "limitations": [
   "No payment was initiated.",
   "Tax rules, purchase orders, supplier records, and payment terms are not invented when they are absent.",
   "Only the invoice, purchase order, and prior invoices in this request are compared.",
   "Labeled document lines are read as printed. A missing label is left unavailable.",
   "CSV is read as text. Columns are not mapped unless the file uses labeled lines or description, quantity, unit price, and amount."
  ],
  "paymentInitiated": false
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/brainiac-invoice-data-extraction-api-f085f00e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from www.brainiac.software](https://www.zero.xyz/host/www.brainiac.software/llms.txt)
