PayOnProof is an accounts-payable agent for construction subcontractor invoices. It pays only for work the evidence proves.

Live demo: https://payonproof-sy50.onrender.com · Video: https://youtu.be/vVcLgtnQBlM · Code (MIT): https://github.com/Daniel221287/payonproof · MCP endpoint: https://payonproof-sy50.onrender.com/mcp

What it does

A general contractor receives an invoice from a subcontractor crew, together with the evidence it already holds: signed timesheets, delivery notes and the contract rate sheet, often in different languages (a Polish invoice with German site papers, a Ukrainian crew). PayOnProof:

  1. Reads every document with NVIDIA Nemotron 3 Nano on Nebius Token Factory into strict JSON, one isolated call per document, so text in the invoice cannot change how the timesheets are read.
  2. Proves each invoice line with a deterministic engine in integer cents: duplicates, days without the site manager's signature, more hours or material than the evidence shows, rates above the contract, arithmetic errors and the contract's payment cap.
  3. Shows a proof grid with a verdict, a reason and the evidence chain for every line. In the video: €6,338.00 claimed, €5,035.00 payable, €1,303.00 held back.
  4. Explains the result to the subcontractor in their language. Nemotron drafts the message, and the draft is checked against the computed numbers and its language before it can be used; otherwise a fixed template is used.
  5. Asks a person to approve the exact payment: a single-use, 10-minute approval bound to the SHA-256 of the payment proposal. Any change withdraws it.
  6. Pays only the proven amount with PayPal Payouts (sandbox) and reads the payout back from PayPal. The receipt says PAID & VERIFIED only when PayPal's record matches the approved amount, currency, receiver and ids.

AI agents can run the same flow over MCP (verify a case, propose the payment, pay with a person's approval token, read the payout back), but no tool can approve.

NVIDIA Nemotron on Nebius Token Factory

  • Model nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B through Token Factory's OpenAI-compatible Chat Completions API, selected by one environment variable (NEBIUS_API_KEY). The live demo runs on it.
  • Each document type sends its own JSON Schema as structured output (response_format: json_schema, strict). Every value may be null, so the model is not pushed to invent numbers, and a validator still rejects anything it cannot trust.
  • Reasoning is off by default (chat_template_kwargs: {enable_thinking: false}); in our runs that was faster and steadier for extraction.
  • The model never decides money: amounts and verdicts come from the rules engine, and a payment needs a person's approval.
  • Measured on the four bundled cases (21–22 October 2026), against a deterministic reference parser reading the same documents:
    • reasoning off, JSON Schema (the default), 5 runs: 80/80 documents read, verdicts and totals identical in 20/20 cases, AI message used in 19/20, 3.4–6.4 s per case;
    • reasoning on, JSON Schema, 2 runs: 32/32 documents, 8/8 identical, 15–78 s per case.
  • Cost guard for the public demo: hourly and daily call caps and a cache for identical documents.

Failure cases we hit, and what changed

Live runs showed six ways the model slipped. Each one went the safe way (lines held, or the template used) before any money moved, and each led to a fix: a misspelled line kind in JSON mode ("labbour", gone with JSON Schema), a sign-off word read as part of the signer's name, an article code left inside the item name, message drafts that missed a fact, one draft for a Ukrainian crew written in Russian (now a language check), and an answer cut off while reasoning (now a larger output limit). All six are written up in the README.

How we built it

  • Node.js server without a framework, plain JavaScript UI with AG Grid Community and a strict Content-Security-Policy.
  • PayPal Payouts REST API (sandbox): OAuth client credentials, one payout batch per approved proposal (sender_batch_id derived from the proposal hash), readback with backoff. A lost response is reconciled, never blindly retried.
  • MCP server over Streamable HTTP (protocol 2025-11-25) with four tools.
  • 182 automated tests, a Playwright end-to-end run, npm run live-check against the live model, deployed on a free Render instance.
  • Code written with Claude (Anthropic) as the AI coding agent.

Limitations

Documents are plain text (PDFs and photos would need OCR first). Cases live in memory on one instance; a production system needs a database, user accounts and stronger approver authentication than one shared passcode. The same work billed again under a new invoice number is not detected. Amounts are net; VAT is out of scope.

Built With

  • ag-grid
  • javascript
  • model-context-protocol
  • nebius-token-factory
  • node.js
  • nvidia-nemotron
  • paypal
  • paypal-payouts
  • playwright
  • render
  • zod
Share this project:

Updates

Submission history