Sign once, settle many times — session-based x402 payments on Stellar.
x402-sessions is an extension of the x402 payment standard that enables frictionless micropayments on Stellar. Instead of requiring a wallet signature for every request, users approve once and then make multiple on-chain payments seamlessly.
Classic x402 → 1 request = 1 signature = 1 settlement
x402-sessions → 1 signature = N settlements
x402-sessions introduces a session-based payment primitive for Stellar that allows:
- Continuous micropayments (e.g. $0.10 per API call)
- Single upfront approval instead of repeated wallet popups
- Fully on-chain enforced spending limits using Stellar Asset Contracts (SAC)
This unlocks a new class of applications where payments feel invisible but remain trustless.
Traditional pay-per-call systems create friction:
- Wallet popup on every request
- Poor UX for AI agents, games, and real-time apps
- Complex off-chain accounting or escrow systems
x402-sessions removes this friction by introducing session-based payments with on-chain guarantees.
Users approve a spending cap once, and then interact freely without repeated wallet confirmations.
- Spending cap enforced directly by SAC (
approve) - Expiry enforced on-chain via ledger limits
- No reliance on off-chain trust for core funds safety
- Funds remain in the user’s wallet
- Only transferred when a request is made
- No refunds, no locking, no custody risks
- Built using Stellar’s SAC (
approve+transfer_from) - Works with USDC, XLM, or any SEP-41 token
- No external standards like Permit2 required
- Extends existing x402 infra
- Works alongside existing schemes
- Plug-and-play for resource servers
x402-sessions unlocks entirely new product categories:
- Pay-per-inference APIs
- Autonomous agents making continuous micro-decisions
- Streaming payments for LLM usage
- In-game microtransactions per action
- Pay-per-move or pay-per-upgrade mechanics
- Seamless player experience without interruptions
- Pay-per-request APIs
- Metered billing without subscriptions
- Developer-first monetization
- Chat systems with per-message pricing
- Streaming services with continuous payments
- Interactive dApps with dynamic pricing
x402-sessions separates responsibilities clearly:
-
On-chain (Stellar SAC)
- Total spending cap
- Expiry enforcement
- Final fund transfer
-
Off-chain (Facilitator)
- Per-call pricing rules
- Session tracking
- Request validation
This ensures:
- Strong guarantees on funds safety
- Flexible application-level control
x402-sessions is not just a library — it's a new payment primitive for the internet:
- Payments that happen per interaction, not per checkout
- Invisible UX with verifiable on-chain settlement
- A foundation for agent-driven economies
We believe the future of payments is:
continuous, programmable, and frictionless
The x402-sessions ecosystem includes:
- SDK – for creating and managing sessions
- Facilitator – for verifying and settling payments
- Resource server integration – for accepting session-based payments
- Demo apps – showcasing real-world use cases
x402-sessions is designed for:
- Developers building on Stellar
- Web3 product teams exploring new monetization models
- Founders creating next-gen AI, gaming, and API platforms
MIT