Last week I wrote about the French voiceover API that only accepts payment from robots.
Today: the part people actually asked me about — how do you verify a $0.05 payment on-chain with zero payment processor, zero SDK, and zero KYC?
The answer: one Python function, ~40 lines, stdlib only.
Here's the real production code.
The setup My endpoint sells French neural TTS voiceovers for $0.03–0.05 USDC.
At that price, Stripe is a non-starter (their floor is ~$0.50 per charge) and any processor's KYC kills the "robots welcome" model.
So payments go through the x402 pattern: client pays USDC on Base, sends me the transaction hash, I verify it myself against a public RPC before delivering.
The verification function That's the whole payment gateway.
No web3.py, no API key, no account anywhere.
Why each check exists Contract address filter — anyone can emit a event from a fake token contract.
Only logs from the real USDC contract count.
Topic structure — ERC-20 has exactly 3 topics (signature + from + to).
The recipient is the last 20 bytes of .
Amount in the log data — parsed from hex, divided by 10^6 (USDC decimals).
Comparing lets a generous buyer overpay without getting rejected. — a reverted transaction still has a receipt.
Skipping this check would accept failed payments.
Anti-replay file — without it, one $0.05 payment could be reused for unlimited generations.
A plain JSON set is enough at this scale.
The 402 gate around it If there's no header, the server answers with HTTP 402 (yes, the "Payment Required" status code that's been reserved since 1999 and almost never used) plus everything a machine needs to pay: An AI agent reading that response has all it needs: chain, token, amount, destination.
Pay, retry with the hash, get the MP3.
Total round-trip: two HTTP calls.
What this costs to run RPC: public Base endpoint, free Verification: ~1 RPC call per purchase Gas: paid by the buyer, not me — at $0.05 price points this matters Chargebacks: don't exist KYC: don't exist (receiving crypto needs no identity) The obvious trade-off: this only works for buyers who already hold USDC on Base — which today means mostly other agents and crypto-natives.
That's a feature for now, not a bug.
Try it Live endpoint (humans get the service card, agents get the 402 dance): Human portfolio with free audio samples: voixoff-fr.netlify.app Building in public, week
2.
Scoreboard so far: 0 sales, 1 working payment rail, ~0 lines of payment-processor code.
Previous posts: robot-only API · $0 avatar pipeline