// learn · Data & tools

x402: paying per API call

Market data is where most bot projects hit a wall: the free tier is too thin, the paid tier is a monthly subscription you barely use. x402 is an attempt at a third option, paying a fraction of a cent per request, with no account at all.

The idea, in one paragraph

HTTP has always had a status code reserved for this: 402 Payment Required, defined decades ago and left unused because there was no way to settle a payment of half a cent. x402 fills that gap. Your client requests a resource, the server answers 402 with the price and where to pay, the client pays in a stablecoin and retries with a proof of payment, and the server returns the data. No signup, no API key, no card on file, and it works the same whether the caller is a person or a program.

Why it matters if you build bots

What to weigh before using it

This is young infrastructure. The honest comparison is not "x402 versus subscriptions" in the abstract, but these variables against your actual call pattern.

VariableWhy it decides the answerWhere it goes wrong
Calls per month × price per callThe only fair comparison against a flat subscriptionHigh-frequency polling: per-call quickly costs more
Settlement cost and chainA micropayment is pointless if the fee exceeds itOnly viable on low-fee chains; fees are not fixed
Added latency per requestPayment and verification sit inside your request pathLatency-sensitive strategies cannot absorb it
Hot-wallet exposureYour bot holds spendable funds continuouslyA compromised host now drains money, not just data
Spend limits and a kill switchA retry loop is now a loop that spendsNo per-day cap means one bug empties the wallet
Provider count and data qualityEasy payment does not make a feed accurateThin ecosystem; established APIs still win on coverage
Accounting and tax treatmentThousands of stablecoin payments are taxable events in some jurisdictionsRecords you must keep, unlike one monthly invoice
Where the line usually falls. Per-call pricing wins for bursty, exploratory or low-volume use, exactly the phase where you are testing whether a data source is worth anything. Subscriptions win once volume is steady and predictable. Most projects should start on the first and graduate to the second, not pick a side on principle.

Reality check

x402 is a payment rail, not a data source and not an investment. There is no x402 token to buy, and any token marketed as one deserves the red-flags checklist. Treat it as plumbing you might use while building, alongside the free APIs in our market-data APIs guide, and the bot patterns in build a bot. If your wallet is funding it, read smart-contract safety first.

Educational market information, not financial advice. Markets carry risk of loss, do your own research.

← Back to Peaky Learn