Drop our x402.js script tag on any page. Every API call from that page becomes pay-per-call USDC on Base 8453. Hive collects 5 bps + per-call receipt fee. The merchant keeps the rest.
<!-- Drop this into <head> --> <script src="https://thehiveryiq.com/cdn/x402.js" data-merchant="0xYourBaseAddress" data-paths="/api/*" data-price-usd="0.01"></script>
That's it. Every fetch() call to a path matching /api/* from this page is now 402-gated. When your backend returns a 402, x402.js triggers a pay flow, settles via Hive's verifier, and retries the original request with an access token.
// Your backend (already done — Hive provides /v1/x402/proof/submit) // 1. Browser calls /api/expensive-thing // 2. Backend returns 402 with: {nonce, amount_usd, recipient, chain, asset} // 3. x402.js prompts the user (or hands off to your CFG.onPay) // 4. Wallet signs USDC transfer on Base 8453 // 5. x402.js POSTs proof to Hive: {nonce, payer, chain, tx_hash} // 6. Hive returns {access_token, expires_in_seconds} // 7. x402.js retries the original request with X-Hive-Access: <token> // 8. Backend serves the response — you keep 99.5% of the money.
Production integrators register an onPay handler that turns the quote into a real wallet signature.
window.HiveX402.onPay = async (quote) => { // quote: {amount_usd, merchant, chain, asset, nonce, recipient} const tx = await wallet.sendUSDC({ to: quote.recipient, amount: quote.amount_usd, chain: 'base-8453' }); return { tx_hash: tx.hash, payer: wallet.address, nonce: quote.nonce }; };
0.05% on settlement value. On a $0.01 call we collect $0.000005.
Per signed call receipt. Anchored to Base 8453. Tamper-evident.
No platform fee. No monthly. No exclusivity. Bring your own wallet.
| Cost on a $0.01 call | Stripe | Coinbase Commerce | Hive x402 |
|---|---|---|---|
| Per-tx fee | $0.30 fixed + 2.9% | 1.0% | 5 bps + $0.0001 |
| Effective on $0.01 | $0.3029 | $0.0001 (subsidized) | $0.000105 |
| Settlement rail | Card networks | USDC on Base/Polygon | USDC on Base 8453 |
| Per-call signed receipt | No | No | ML-DSA-65 + Ed25519 |
| Drop-in (no backend rewrite) | No | No | Yes — one script tag |
Once you install, your wallet address is the merchant key. Track call volume, paid passes, and revenue at /v1/x402/stats (public JSON). Hive's clip is netted automatically — you receive your share at settlement.