C
How to accept USDC from an AI agent in 20 lines
A working x402 paywall in one route handler: 402 with a price, verify the signature, do the work, settle. Plus the four things that will break it.
SH-03
5 min1.2k w
notes on paying for HTTP
A working x402 paywall in one route handler: 402 with a price, verify the signature, do the work, settle. Plus the four things that will break it.
Every paid endpoint does the same three things. There are six ways to order them and only one that never takes money for a response it failed to send.
402 was never broken. It was half a protocol: a status code with no challenge header and no credential header. The missing half took 26 years.
General notes
Sheet notes