x402 · sBTC · USDCx · STACKS:1
The payment and credit rail for agentic APIs on Stacks.
Point Lend402 at any HTTPS endpoint. Agents pay from sBTC collateral without pre-loading stablecoins. Every settlement is an on-chain transaction ID.
Built for three different users.
For API Providers
Monetize any endpoint in 60 seconds
Enter your origin URL and a price per call. Lend402 wraps it behind a payment-aware gateway. You receive USDCx directly in your Stacks wallet — no billing infrastructure, no API keys, no invoices.
For AI Agent Operators
Pay from sBTC. Never pre-load stablecoins.
Your agent holds sBTC as its treasury asset. When it hits a 402, Lend402 borrows the exact USDCx needed, settles on Stacks Nakamoto in under 10 seconds, and repays atomically. Zero idle stablecoin exposure at rest.
For Enterprise
Every payment is cryptographically auditable
Each call produces a Stacks transaction ID verifiable on the public Hiro explorer. The blockchain is the receipt — no vendor billing records needed.
How a paid call moves through the system.
REQUEST
Agent calls the wrapped gateway URL.
402
Gateway returns an x402 V2 challenge with payment requirements.
LOCK sBTC
Agent SDK locks sBTC collateral in the vault contract.
BORROW USDCx JIT
USDCx is borrowed just-in-time against the locked collateral.
PAY MERCHANT
USDCx routes directly to the provider's Stacks wallet.
CONFIRM
Nakamoto fast-block confirms settlement in under 10 seconds.
Three Stacks-native properties no other x402 implementation has.
PostConditionMode.Deny
Consensus-layer payment safety
sBTC collateral movement is enforced at the Stacks consensus layer, not the smart contract layer. If any declared amount differs from what executes, the entire transaction reverts. This is not available on Ethereum or Solana.
Atomic Borrow-and-Pay
One contract call, five operations
A single Clarity function checks collateral ratio, locks sBTC, borrows USDCx, transfers it to the provider, and records the debt position. Everything succeeds or nothing moves.
X402 V2 Compliant
Beyond the baseline spec
Implements canonical payment-signature, payment-required, and payment-response headers with a payment-identifier tamper detection extension that validates txid integrity before broadcast.
How a paid call moves
~5s
Nakamoto confirmation time
1 txid
per call, verifiable on Hiro explorer