Inspiration
Freelance work dies in the hand-off: the client can't verify "done," the freelancer waits for money that's already earned. Scope arguments, vague briefs, and the awkward payout chase are the three failure modes of every gig. We asked: what if the payment rails themselves carried the verification? PayPal already knows how to hold funds safely — we just needed to instrument the trust gap around it.
What it does
ProofPay is an AI-gated milestone payment platform for freelance work:
- Brief it — the client writes a milestone (title, brief, amount, deadline).
- AI scopes it — AI turns the brief into an objective, per-item acceptance checklist (4–8 checkable criteria) before any money moves.
- Invite & fund — the freelancer accepts the invite (binding them to the exact checklist), then the client funds the milestone through PayPal. Funds sit in escrow.
- Deliver proof — the freelancer uploads screenshots/PDFs plus a note.
- AI evaluates — the proof is graded item-by-item: pass/partial/fail verdicts, written explanations, and a 0–100 overall score.
- Human approves — the client reviews the evaluation and either approves or sends structured revision notes back.
- PayPal pays — approval arms the payout; PayPal Payouts delivers the money instantly.
The core rule: AI never moves money. It has no PayPal credentials and cannot advance the state machine — every fund, capture, and payout is an explicit human click, verified server-side.
How we built it
- Next.js 15 (App Router, TypeScript) with Tailwind CSS v4 — PayPal navy/blue design language, animated with Framer Motion primitives that respect reduced-motion.
- SQLite + Drizzle ORM — milestone files (≤5 MB) stored as DB BLOBs, zero external storage.
- Server-enforced state machine:
DRAFT → CHECKLISTED → INVITED → ACCEPTED → FUNDED → SUBMITTED → EVALUATED → APPROVED → PAID(plus a REJECTED → resubmit loop). The browser never gets to choose a state. - PayPal (sandbox): Orders API v2 (create + approve + capture), server-side capture with amount verification (a $2 order can't be captured against a $250 milestone), and Payouts API with idempotent batch creation.
- AI via Vercel AI SDK + OpenRouter: pinned free vision model with a fallback chain and bounded 429-retry; structured outputs validated by Zod schemas (
ChecklistSchema,EvaluationSchema), with OpenRouter's Response Healing repairing malformed JSON. Images go straight to the vision model; PDFs are parsed to text server-side. - Append-only
eventsledger records every transition (type, actor, payload, model, timestamp) — the on-screen audit timeline reads only from it. - Honest demo mode: seeded workspaces are flagged
is_demowithDEMO-prefixed PayPal ids; funding/payout endpoints refuse demo records, so sample data can never trigger a real PayPal call.
Challenges we ran into
- Free AI models are a contended pool — 429s at the worst moments. We built a fallback chain across multiple free vision models with bounded retries, plus a clear "retry evaluation" path when everything fails.
- Making AI failure boring: AI errors leave the milestone state unchanged — no auto-approval, no auto-payout, ever. Containment was a design rule, not an afterthought.
- Amount integrity: the server re-fetches the PayPal order and verifies amount/currency against the milestone before capture — the browser never supplies money numbers.
- Demo vs. real isolation: judges should explore freely without fear of touching real money (sandbox) or breaking the walkthrough (seeded data), so we made the separation structural.
- PayPal sandbox quirks: sandbox accounts in some countries can't process checkout or payouts — documented the US-account workaround.
Accomplishments that we're proud of
- The trust architecture: escrow in, human approval gate in the middle, Payouts out — with an AI in the middle that provably can't touch money.
- A complete, honest demo: 3 clients + a freelancer, 7 milestones spanning every state of the machine, one-click demo logins (
[email protected]/[email protected], passworddemo1234). - A UI that makes the money legible: live milestone pipeline, per-item verdicts, and an audit timeline both parties can read.
What we learned
- AI is most trustworthy in payments when it's advisory — score the work, but make a human the only path to money.
- Structured outputs + Zod validation beat free-form text for anything that feeds a workflow.
- The state machine was the cheapest thing to build and became the most valuable thing in the product: it turned "who owes whom what?" into a checkable pipeline.
What's next
- Multi-milestone project health view and CSV payout reconciliation.
- Dispute flow with a second AI pass and client-visible re-evaluation diffs.
- Real PayPal production mode behind the same state machine — the guardrails were designed for it.
All PayPal payments in this submission run on the sandbox — play money, real APIs. Not affiliated with PayPal.
Built With
- bcryptjs
- better-sqlite3
- drizzle-orm
- framer-motion-(motion)
- google-gemma-(fallbacks)
- lucide-icons
- next.js-15
- nvidia-nemotron-vision-(free-tier)
- openrouter
- paypal-orders-api-v2
- paypal-payouts-api
- sqlite
- tailwind-css-v4
- typescript
- vercel-ai-sdk-v7
- zod-v4

