One <script> tag. A clean modal. Stablecoin payments on Base and Solana, settled on-chain in seconds. No keys, no signup, no SDK to learn. Built on the x402 protocol.
Paste one line into your <head>. Then add data-x402-endpoint to any button. That's it.
x402 is HTTP 402 Payment Required, with a manifest. The drop-in handles the entire dance — you never see it.
The modal opens. We probe your endpoint, parse the 402 challenge, and show the price + network.
Phantom for Solana, MetaMask/Coinbase for Base. We build the SPL transfer or EIP-3009 authorization. One click.
PayAI or Coinbase CDP verifies and broadcasts the tx on-chain. Your endpoint runs and returns the result.
These are real paid endpoints. Pay $0.001 USDC with Phantom or your browser wallet and see the response stream back.
For re-downloadable content — GLBs, avatars, agent skills, lobby characters — buyers shouldn't pay again every time they fetch the same asset. When an endpoint opts into SIWX (Sign-In-With-X, CAIP-122), the modal grows a second option:
┌──────────────────────────────────────────┐
│ three.ws ✕ │
│ Download pole-dancer-rumba.glb │
├──────────────────────────────────────────┤
│ 0.05 USDC [Base · live ●] │
├──────────────────────────────────────────┤
│ ┌────────────────────────────────────┐ │
│ │ Sign in with wallet │ │ ← primary
│ └────────────────────────────────────┘ │
│ ┌────────────────────────────────────┐ │
│ │ Pay 0.05 USDC instead │ │ ← secondary
│ └────────────────────────────────────┘ │
│ Already paid for this once? Sign in to │
│ re-enter without paying again. │
└──────────────────────────────────────────┘
Click Sign in with wallet → wallet pops with a CAIP-122
message naming the resource, the connected address, and a fresh nonce →
modal posts the signed payload as a SIGN-IN-WITH-X
header → endpoint looks the wallet up in its payment ledger → returns
200 without charging. If the wallet hasn't actually paid for this
resource (or the signature is rejected), the modal falls back to the
normal pay flow with a one-line notice.
Programmatic callers see the same flow: await window.X402.pay(...)
resolves with { result, siwx: { address, network } }
(instead of payment) when SIWX was used. The element-bound API also
dispatches an x402:siwx-signed event right before
x402:result so analytics can distinguish a sign-in from a paid
call. A manual test surface lives at /siwx-test.html.
Same modal, called from JavaScript. The promise resolves with the API result and a settlement receipt.