- SaaS platforms with an API surface consumed by customer agents
- Pricing and product leaders evaluating per-action billing for the agent segment
- Finance and operations teams designing one ledger across multiple billing motions
How it works
The same action taxonomy you already meter for overage billing also drives x402 pricing. Each priced action maps to amaxAmountRequired in USDC. Finance pulls one report; channel becomes a column, not a separate ledger. For variable-cost actions (output-size or compute-driven), use the x402 v2 upto scheme described in Per-inference billing.
Get started
Layer x402 v2 middleware after your existing auth. Seat customers and overage customers flow through the existing path. Unauthenticated calls fall through to x402 and pay per action using the same action taxonomy you already meter.Install
- Express
- Next.js
- Hono
Price a metered action
Each priced action declares its ownaccepts block. Reuse your existing action taxonomy so finance can pull one ledger sliced by channel.
Test as a buyer
Implementation
x402 Quickstart for Sellers
Add the middleware behind your existing auth.
Per-inference billing
For variable-cost actions, use the
upto scheme.Monetize an existing API
The general pattern this scenario specializes.
x402 How It Works
Protocol mechanics and receipts.