How does an HTTP 402 API paywall work with autonomous AI agents?
When an unauthenticated client or AI agent calls your protected endpoint, your middleware returns HTTP 402 Payment Required with XPayr challenge headers and a JSON quote. The agent settles the USDC/USDT session via @xpayr/mcp-server (0.5% flat split) and retries with Authorization: X402 <es256_jwt>, which your API verifies in <1ms against /.well-known/jwks.json.