Skip to content

x402-sessions

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


What we are building

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.


Why x402-sessions

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.


Key Advantages

1. Sign Once UX

Users approve a spending cap once, and then interact freely without repeated wallet confirmations.

2. On-chain Enforcement

  • Spending cap enforced directly by SAC (approve)
  • Expiry enforced on-chain via ledger limits
  • No reliance on off-chain trust for core funds safety

3. No Escrow Model

  • Funds remain in the user’s wallet
  • Only transferred when a request is made
  • No refunds, no locking, no custody risks

4. Native to Stellar

  • Built using Stellar’s SAC (approve + transfer_from)
  • Works with USDC, XLM, or any SEP-41 token
  • No external standards like Permit2 required

5. Compatible with x402 Ecosystem

  • Extends existing x402 infra
  • Works alongside existing schemes
  • Plug-and-play for resource servers

What this enables

x402-sessions unlocks entirely new product categories:

AI & Agents

  • Pay-per-inference APIs
  • Autonomous agents making continuous micro-decisions
  • Streaming payments for LLM usage

Games

  • In-game microtransactions per action
  • Pay-per-move or pay-per-upgrade mechanics
  • Seamless player experience without interruptions

APIs & SaaS

  • Pay-per-request APIs
  • Metered billing without subscriptions
  • Developer-first monetization

Real-time Applications

  • Chat systems with per-message pricing
  • Streaming services with continuous payments
  • Interactive dApps with dynamic pricing

Trust Model

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

Vision

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


Ecosystem

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

Built for builders

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

License

MIT

Popular repositories Loading

  1. x402-session-sdk x402-session-sdk Public

    TypeScript

  2. x402-session-facilitator x402-session-facilitator Public

    TypeScript

  3. x402-session-app x402-session-app Public

    TypeScript

  4. x402-session-tests x402-session-tests Public

    TypeScript

  5. .github .github Public

Repositories

Showing 5 of 5 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…