ValidPay — pay only for valid responses
- Problem
- x402 is the open standard that lets AI agents pay per API call. Plain x402 settles the payment before anyone knows if the response is valid: bad response, money already gone.
- Solution
- Validate, then settle. A contract fail withholds the charge — the buyer pays $0 on chain.
- Result
- Solo build, settling on Algorand Mainnet. Selected for the judged mentoring round — one of 22 teams.
A seller puts the gateway in front of their HTTP API and declares a response contract per route. The gateway calls the upstream, checks the payload against the contract, and settles USDC on Algorand only when it passes; otherwise the charge is withheld. Built for the Brainwave 2026 x402 track.
Buyer side, seller side, and the receipt:
- The buyer installs nothing — a normal x402 client against a paid URL.
- v1 contracts are mechanical (JSON shape, required fields, reject-on-error) — no LLM judging quality. Deterministic checks first; judgment later, if ever.
- Every settlement is publicly provable — the receipt links to the real Mainnet transaction.
Same payment, different outcome
The whole product is one reordering. In plain x402 the money settles before the response arrives, so a bad or empty response is already paid for. In ValidPay the gateway validates the payload against the seller's contract first, and settles only if the check passes.
View full sizeThe seller sees settled and withheld charges, live
The first version was a buyer-facing dashboard. Halfway through I asked who the screen was for: in our own story, buyers never know ValidPay exists, so it existed only to impress judges. I dropped it and rebuilt the surface for the seller, the one party who watches settlements.
The seller console reports three numbers: settled charges (USDC received after the contract passed), withheld charges (the response failed your contract; buyer not charged on chain), and upstream errors (your API was unreachable or returned non-JSON). Below them, a live feed pairs every event with its reason (contract passed, handler failed, reject-on-error) and links each settlement to its transaction.
View full sizeEvery receipt is on the public blockchain
Each settlement in the feed opens in the Algorand Mainnet explorer. The receipt is a public record, so a buyer can check for themselves that a charge held to the seller's contract.
View full sizeThe buyer's view: reject costs nothing, valid settles
The demo agent buys a weather forecast through the gateway twice. Invalid coordinates: the contract's reject-on-error rule fires, status rejected, nothing settles. Valid Berlin coordinates: a real forecast comes back, the receipt reads paid · validation_passed, and the x402 settlement block carries the payer, the transaction ID and the network, the same transaction the seller's console links to.
View full sizeWhere it stands
A hackathon build, live on Algorand Mainnet with a public repo and a runnable judge demo. The contracts stay mechanical, with no marketplace and no LLM quality judge, because withholding money needs a check both sides can predict.