Payment Schemes
The facilitator supports two x402 payment schemes:exact and escrow. Understanding when to use each is key to building efficient applications.
Overview
exact
Standard x402 per-request payments using ERC-3009
escrow
Session-based payments with pre-deposited funds
Exact Scheme
Theexact scheme is the standard x402 payment method. Each API request requires a fresh ERC-3009 signature authorizing the exact payment amount.
How It Works
Characteristics
| Property | Value |
|---|---|
| Signatures | 1 per request |
| Gas | Per request (ERC-3009 transfer) |
| Latency | Higher (blockchain confirmation) |
| Pre-deposit | None required |
| Unused funds | N/A (exact amounts) |
When to Use
- Infrequent calls: < 10 API calls per day
- Variable pricing: Each request has different cost
- No pre-commitment: Don’t want to lock up funds
- Simple integration: Minimal state management
Server Configuration
Client Usage
The
exact scheme requires user signature per request - best for browser dApps.Escrow Scheme
Theescrow scheme enables session-based payments. Users deposit funds once and make unlimited API calls without additional signatures.
How It Works
Characteristics
| Property | Value |
|---|---|
| Signatures | 1 per session (not per request) |
| Gas | Only on session creation |
| Latency | Instant (off-chain verification) |
| Pre-deposit | 100 USDC |
| Unused funds | 100% reclaimable |
When to Use
- High-frequency calls: 100s-1000s of API calls
- AI agents: Autonomous operations without user prompts
- Low latency: Real-time applications
- Predictable billing: Session-based budgets
Server Configuration
Client Usage
Session Lifecycle
- Creation: User signs ERC-3009, facilitator deposits to escrow contract
- Active: Session has balance, requests debit from it
- Depleted: Balance exhausted, new session needed
- Expired: Past expiry time, funds reclaimable
- Reclaimed: User withdrew remaining balance
Sessions are scoped to
(user, payTo, network). Different APIs from the same provider share a session.Accepting Both Schemes
Servers can accept both schemes, letting clients choose:Comparison Summary
| Aspect | exact | escrow |
|---|---|---|
| UX | Sign every request | Sign once |
| Speed | Slower (on-chain) | Instant |
| Cost | Gas per request | Gas once |
| Commitment | None | Pre-deposit |
| Refunds | N/A | Reclaimable |
| Complexity | Simple | Sessions to manage |
| AI Agents | Poor fit | Ideal |