GUIDE · AI AGENT PAYMENTS

How to charge AI agents for your API

Agents do not want API keys and monthly plans. They want a machine-readable price, a wallet, and a receipt. HTTP 402 + x402 is that contract.

1. Return HTTP 402 with accepts[]

When unpaid, respond 402 with network, asset, payTo, and amount (atomic USDC). Agents parse this automatically.

2. Accept proof on retry

Agent pays USDC on Base, retries with X-PAYMENT-TX (sovereign) or facilitator X-PAYMENT. You verify and return data.

3. Ship a one-line paywall

app.use('/premium', x402({ price: '0.001', payTo: '0x…', freeForHumans: true }))
Launchpad Watch it work

4. Price like the market

Commodity snacks: $0.001. See the pricing oracle.

FAQ

Do humans need wallets?

No. freeForHumans lets browsers through while bots/agents pay.

Is this Stripe?

No. Settlement is on-chain USDC. See Stripe vs crypto for APIs.

KEEP GOING · SCRIPTMASTERLABS

Related