Last week I shipped AtlasData , a pay-per-call crypto data API where the buyer is usually not a human β it is an agent that holds a wallet. Getting paid per request without accounts, API keys, or invoices meant implementing both of the protocols that actually work today: x402 (USDC on Base) and L402 (Lightning sats). Here is what I learned running both on the same FastAPI app.
The shape of both protocols
Both live on HTTP 402 Payment Required:
curl -i https://atlasdata.shares.zrok.io/api/price/BTC # HTTP/2 402 # {"payment": {"maxAmountRequired":"1000", "asset":"USDC", "network":"eip155:8453", ...}}
curl -i https://atlasdata.shares.zrok.io/l402/btc/fees # HTTP/2 402 # www-authenticate: L402 macaroon="...", invoice="lnbc100n1..."
Enter fullscreen mode
Exit fullscreen mode
The difference is the proof. x402 returns an EIP-3009 transferWithAuthorization the client signs; a facilitator settles it onchain, then your server serves the response.β¦