x402 (pay-per-request)
x402 is a simple pattern: an API can return HTTP 402 with payment requirements.
Flow
- Client calls a service
- Service returns 200 (paid) or 402 (payment required)
- Client pays (Permit2)
- Client retries with receipt
What you get
- Pricing becomes part of the protocol
- Easy per-call billing and rate limits
- Clean separation: “upstream logic” vs “payment + policy”
Integration guidance
- Keep the paid surface stable (service ID/slug)
- Put strict limits in place (per user/day, per key, etc.)
- Log transactions for auditability