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.

AGENT ACTIVITY LOG — lend402::borrow-and-pay
● LIVE
11:31:01.197——  [REQUEST] GET https://gateway.lend402.xyz/v/abc123/prices/BTC-USD/spot
11:31:01.199——  [402]     Payment required · sBTC collateral path active
11:31:06.441——  [CONFIRMED ✓] Block #142857 · TXID: 0x3f9a1c...e4b2 · +$0.50 USDCx settled
agent@lend402:~$
NETWORK STACKS:1BLOCK ~5SPROTO X402 V2NAKAMOTO RELEASE

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.

1

REQUEST

Agent calls the wrapped gateway URL.

2

402

Gateway returns an x402 V2 challenge with payment requirements.

3

LOCK sBTC

Agent SDK locks sBTC collateral in the vault contract.

4

BORROW USDCx JIT

USDCx is borrowed just-in-time against the locked collateral.

5

PAY MERCHANT

USDCx routes directly to the provider's Stacks wallet.

6

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

Agent SDK intercepts 402simulate-borrow pre-flightborrow-and-pay contract-callPostConditionMode.DENYStacks mempoolNakamoto fast-blockpayment-response header

~5s

Nakamoto confirmation time

1 txid

per call, verifiable on Hiro explorer

For API Providers

Wrap any HTTPS endpoint behind x402 in under a minute.

For Agent Operators

Test the full borrow-and-pay flow against a live vault.