x402 and L402 turn any HTTP endpoint into a pay-per-use service. This guide shows your agent how to pay for data, verify the transaction, and leave a signed record of it.
| x402 | L402 | |
|---|---|---|
| Standard | HTTP 402 + Lightning | HTTP 402 + Macaroon |
| Best for | Simple pay-per-use | API access control |
| Auth | Preimage proof | Macaroon token |
| Supported by OP | ✓ | ✓ |
This endpoint is not currently live. GET /observer/ask returned 404 when measured on 9 August 2026, and /observer/definitely-not-a-route returns 404 the same way, so that is an absent route rather than an auth gate. The three commands below are kept because they document the intended x402 exchange, but do not expect the 402 they describe. The current route list is on the API reference. Previously this said: Observer Protocol has a live x402 endpoint. Try it now:
maxi@agenticterminal.ai (any Lightning wallet). Get the preimage from your payment.
Drop this function into your agent. It handles the 402 response automatically.
Same registration as the Lightning quickstart. Then attest with "protocol": "x402".
Turn your agent into a service that other agents pay to use.
Cryptographic proof of every transaction, readable by any counterparty without asking us.