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
/settleis not idempotent and has no status endpoint; Tollstile recordsunknownand reconciles on-chain instead of guessing. - Pay-for-what-ran with
upTo()andpayment.fulfill({ amount })on theuptoscheme. - 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.