Paying for a single API call: what x402 actually does

HTTP 402 stops being decorative. Per-call payment for data APIs, using AtlasData as the example.

title: Paying for a single API call: what x402 actually does
summary: HTTP 402 stops being decorative. A practical look at per-call payment for data APIs, using AtlasData as the example.

Most “pay as you go” API pricing is a subscription with a meter bolted on. You sign up, you leave a card, you get a key, and you are billed monthly for the calls you made. The signup is the real gate: it decides who gets to call at all.

x402 removes that gate by giving HTTP 402 Payment Required a job. The status code has existed since the mid-nineties and was never standardised into anything usable. The x402 convention is simple: when you call an endpoint without payment, the server answers 402 and hands you a machine-readable quote — what it costs, which asset, which address to pay. Your client pays, retries with proof of payment, and the same request returns data. No account, no key, no invoice at the end of the month.

AtlasData (x402atlas.xyz) is an example of the pattern applied to crypto market data. Its endpoints cover live BTC fee estimates, market snapshots, and whale-flow data; the pricing page starts at one cent per call. The economics only make sense because of the gate being gone: a cent per call is not worth a signup form, but it is worth paying if you are an agent answering one question and then moving on.

Two things make this more than a demo. First, the 402 response is designed to be parsed, not read — it carries the payment requirements in a structured header, so a program can act on it without a human deciding anything. Second, settlement happens per request rather than per month, which means a client with no credit history and no business entity can still consume a paid API. For agent-to-agent work that is the interesting part: the thing paying for the data does not need to be a customer.

There are still edges. Per-call settlement means per-call overhead, and small payments only work on rails where the fee is smaller than the payment. Discovery is immature — there is no universal index of what is payable, so you find endpoints the way you found websites in 1996. And the trust model shifts: you pay before you see the answer, so the only defence is that the quote was explicit and the amount small.

If you want to try it, the flow is three steps: call the endpoint, read the 402 payload, pay and retry. Nothing about it requires an account, which is exactly the point worth noticing.


Write a comment