Skip to main content

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.
AspectDetail
AmountFixed at authorization time
SettlementFull authorized amount
Transfer methodsERC-3009, Permit2, Solana
Use casesFixed-price APIs, one-time purchases
{
  "scheme": "exact",
  "amount": "1000000"
}
The on-chain transfer moves exactly 1,000,000 units (1 USDC with 6 decimals).

Upto Scheme

The payer authorizes a maximum amount, and the seller settles only the actual usage.
AspectDetail
AmountMaximum authorized
SettlementAny amount up to the maximum
Transfer methodsPermit2 only
Use casesUsage-based APIs, AI token billing, metered resources
{
  "scheme": "upto",
  "amount": "5000000",
  "extra": {
    "assetTransferMethod": "permit2",
    "settlementAmount": "300000"
  }
}
The payer authorized up to 5 USDC, but the seller only settles 0.30 USDC.

Why Upto is Permit2 Only

ERC-3009 transferWithAuthorization 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

If settlementAmount is "0":
  • No on-chain transaction is executed
  • The payer’s locked balance is fully released
  • The Facilitator returns success: true immediately
This is useful when the buyer’s request consumed no billable resources.

Settlement Amount Validation

ConditionResult
settlementAmount <= amountAccepted
settlementAmount > amountRejected with error
settlementAmount == "0"No on-chain tx, immediate success
settlementAmount missing (upto)Rejected — required for upto

Choosing a Scheme

ScenarioRecommended Scheme
Fixed-price API endpointexact
Pay-per-token AI inferenceupto
Subscription-like recurring paymentexact
Metered compute / bandwidthupto
One-time content purchaseexact