Skip to content

x402 Payment Protocol

x402 is an open protocol for machine-to-machine payments using the HTTP 402 Payment Required status code. It enables AI agents to pay for services programmatically using USDC stablecoin.

Traditional payment flows (Stripe Checkout, credit card forms) require human interaction. x402 enables fully autonomous agent commerce:

  • Agent-to-agent payments — Other AI agents can pay Wilson for financial analysis
  • Pay-per-run workflows — Charge per execution instead of annual subscriptions
  • No checkout friction — Payment is in the HTTP protocol itself
  • Micro-transactions — Charges as low as $0.001 per request
1. Agent sends request to Wilson API
2. Wilson returns HTTP 402 with price and payment details
3. Agent pays via USDC on Base (Coinbase L2)
4. Wilson verifies payment and returns results

The $ in Wilson’s ASCII art isn’t just branding — it’s functional. The HTTP 402 status code was reserved for future use since HTTP/1.1 was drafted. x402 finally puts it to work.

  1. Install the x402 npm SDK
  2. Wrap paid chain endpoints with x402 payment middleware
  3. Agent calls Wilson API → gets 402 response with price → pays → receives result
  4. Settlement in USDC on Base (Coinbase L2)

Other AI agents running on OpenClaw, LangChain, or custom frameworks can pay Wilson for:

  • Transaction categorization
  • Spending analysis
  • Tax deduction summaries
  • Cash flow projections

Wilson can pay other services for:

  • Real-time market data
  • Credit report access
  • Tax law databases
  • Financial document parsing
  • Payment states are first-class UI — Display 402 Payment Required as a clear prompt, not an error
  • Money green for confirmations — Successful payments render in #22c55e
  • Amber for payment-required — It’s a prompt, not an error
  • Ledger-style receipts — Transaction receipts render in monospace, JetBrains Mono
  • x402 is early-stage — ecosystem adoption is uncertain
  • USDC payments require crypto-savvy users (or agents)
  • Regulatory uncertainty around crypto payments for consumer finance tools
  • Recommendation: Implement as supplementary channel alongside Stripe, not replacement