Lab · Agentic economy · x402 pay-per-call
Pay-per-call with x402
An agent that pays for what it reads. Halden’s price API charges $0.01 per call over x402: the first request gets a 402 with the terms (PAYMENT-REQUIRED), the second carries a USDC authorization signed by the agent (PAYMENT-SIGNATURE, EIP-3009), and a facilitator settles it on-chain before the quote is served (PAYMENT-RESPONSE). The customer approves before anything is signed. Every message is on the wire to inspect or tamper with, and the token contract is the one that says no.
Real: the official x402 SDKs (client, resource server and the EVM “exact” facilitator scheme), the EIP-3009 signature checked by MockUSDC.sol on an Ethereum VM that runs in this page, and, in the wallet scenario, the signature, the transaction and the receipt on Base Sepolia. Re-created: the Machine Payments Protocol’s headers on the same API (scenario MPP), with a plain USDC transfer standing in for Tempo. Simulated: the agent’s decisions unless you connect a model, and the money. Edit the token contract, recompile it in your browser, and run again on your version.
The wallet scenario needs a wallet that supports EIP-6963 (MetaMask, Rabby, Coinbase Wallet) on Base Sepolia, a little test ETH for gas and test USDC from Circle’s faucet; the page never sees a key. Test USDC goes to a sink address.