npm packages are not installable yet: [email protected] can be published after 2026-09-16 10:30 UTC. Details
Tollstile

Tollstile vs raw x402 middleware

When the official x402 middleware is enough, and what Tollstile adds on top of x402 for APIs and MCP tools.

Public Beta · early access

The x402 SDKs give you middleware that answers 402 with PAYMENT-REQUIRED, verifies a PAYMENT-SIGNATURE through a facilitator, and settles. That is the protocol layer, and Tollstile's x402 rail speaks it.

Use raw x402 middleware when

  • x402 is the only way you will ever get paid,
  • every caller pays per call, and
  • you are comfortable handling settlement failures and records yourself.

Use Tollstile when you also need

  • The same route to accept MPP, L402, or KYAPay alongside x402.
  • Subscribers and credits that skip or replace the payment.
  • Nothing charged when the handler fails — the authorization is released instead of settled.
  • Settlement you can trust after a timeout. x402's /settle is not idempotent and has no status endpoint; Tollstile records unknown and reconciles on-chain instead of guessing.
  • Pay-for-what-ran with upTo() and payment.fulfill({ amount }) on the upto scheme.
  • A ledger in your database, spend limits per payer, and a test rail for local development.

Verification status

The x402 rail is implemented and tested against a fake facilitator, a simulated chain, and the reference @x402/core, not yet against a real facilitator or chain. See x402.

On this page