Payment Required

x402 can't complete a payment without Coinbase. L402 can't be stopped by anyone. Both protocols want to define how AI agents pay for APIs.

x402 L402
Trust model Facilitator required No intermediary
Verification Remote (Facilitator API) Local (HMAC + SHA256)
Privacy On-chain visible Off-chain, onion-routed
Credential Single-use signature Reusable macaroon
Currency USDC (stablecoin) Bitcoin (sats, volatile)
Client gas None (facilitator pays) N/A
Settlement ~2s (Base L2) ~1-2s (Lightning)
Multi-chain Yes (Base, Solana, fiat) Lightning only
Challenge PAYMENT-REQUIRED WWW-Authenticate: L402
Payment header X-PAYMENT Authorization: L402
Backed by Coinbase, Cloudflare, Google, Visa Lightning Labs
Since May 2025 March 2020

HTTP 402 Payment Required has been "reserved for future use" since 1997. Two protocols now claim that future. They've made opposite bets on whether payments need an intermediary.

x402 requires a Facilitator—Coinbase's infrastructure—to verify signatures and settle funds on-chain. The agent never touches gas and gets dollar-stable pricing. If the Facilitator rejects the request or goes down, the payment doesn't complete.

L402 has no intermediary. Agent pays a Lightning invoice, server verifies a hash locally, resource delivered. Zero steps require anyone's permission. You run Lightning infrastructure, price in volatile sats, and channel liquidity is your problem.

An AI agent making thousands of API calls a day will eventually need to pay for one. Whether it can depends on who else has to be involved.

Text description of protocol comparison

x402 Protocol (9 steps)

  1. Client sends GET request to Server
  2. Server returns 402 Payment Required with PAYMENT-REQUIRED header containing JSON payment terms
  3. Client signs an EIP-3009 gasless authorization off-chain (no gas, no transaction)
  4. Client retries request with PAYMENT-SIGNATURE header containing the signed proof
  5. Server sends the signed payload to the Facilitator for verification
  6. Facilitator verifies the signature off-chain (~100ms) and confirms
  7. Server delivers the resource (200 OK) — before on-chain settlement
  8. Facilitator submits transferWithAuthorization to settle USDC on Base (~2s)
  9. Blockchain confirms the on-chain settlement

L402 Protocol (5 steps)

  1. Client sends GET request to Server
  2. Server returns 402 with WWW-Authenticate header containing a macaroon and Lightning invoice
  3. Client pays the Lightning invoice with any wallet, receiving the preimage as proof
  4. Client retries request with Authorization header containing the macaroon and preimage
  5. Server verifies locally (SHA256 of preimage matches payment_hash in macaroon) and delivers the resource
Sideband · Data sourced from x402 and L402 protocol specs · CC BY 4.0