Payment Schemes
x402 supports two payment schemes that cover different pricing models.Exact Scheme
The payer authorizes a fixed amount that is settled in full.| Aspect | Detail |
|---|---|
| Amount | Fixed at authorization time |
| Settlement | Full authorized amount |
| Transfer methods | ERC-3009, Permit2, Solana |
| Use cases | Fixed-price APIs, one-time purchases |
Upto Scheme
The payer authorizes a maximum amount, and the seller settles only the actual usage.| Aspect | Detail |
|---|---|
| Amount | Maximum authorized |
| Settlement | Any amount up to the maximum |
| Transfer methods | Permit2 only |
| Use cases | Usage-based APIs, AI token billing, metered resources |
Why Upto is Permit2 Only
ERC-3009transferWithAuthorization binds the value directly in the signature hash. The on-chain contract verifies that the transfer amount matches the signed value exactly — partial settlement is rejected.
Permit2’s permitWitnessTransferFrom separates the authorized maximum (in the permit) from the requested transfer amount (in transferDetails). This allows the Facilitator to settle any amount up to the authorized limit.
Zero Settlement
IfsettlementAmount is "0":
- No on-chain transaction is executed
- The payer’s locked balance is fully released
- The Facilitator returns
success: trueimmediately
Settlement Amount Validation
| Condition | Result |
|---|---|
settlementAmount <= amount | Accepted |
settlementAmount > amount | Rejected with error |
settlementAmount == "0" | No on-chain tx, immediate success |
settlementAmount missing (upto) | Rejected — required for upto |
Choosing a Scheme
| Scenario | Recommended Scheme |
|---|---|
| Fixed-price API endpoint | exact |
| Pay-per-token AI inference | upto |
| Subscription-like recurring payment | exact |
| Metered compute / bandwidth | upto |
| One-time content purchase | exact |