Agentic Commerce 101

The 402 handshake: how agents pay their own way

HTTP status code 402 "Payment Required" sat reserved and unused since 1997. Now it powers a real pattern: an AI agent calls a paid API, gets a 402, pays in USDC from its own wallet on Base, and retries — no human, no signup form, no credit card.

Drag to rotate. Press Run.
402

The reserved status code

Defined in HTTP/1.1 (RFC 2616, 1997) as "Payment Required" and marked "reserved for future use." The x402 pattern finally uses it: a server replies 402 with machine-readable payment terms (amount, asset, chain, pay-to address) in headers.

$0.001+

Why stablecoins, why Base

Card rails charge ~$0.30 + 2.9% per transaction — impossible for a 5-cent API call. USDC on an L2 like Base settles in ~2 seconds for a fraction of a cent, making true micropayments viable for machine-to-machine commerce.

0 forms

No accounts, no API keys

Classic paid APIs require a human: create account, verify email, enter a card, copy an API key. The 402 flow replaces all of that with a cryptographic payment proof attached to the retried request — the payment is the authentication.

4 steps

The loop

1) Agent calls the tool. 2) Server returns 402 + terms. 3) Agent's wallet signs a USDC transfer and re-sends the request with an X-PAYMENT proof header. 4) Server verifies, runs the job, returns 200.

Worked example: a research agent's day

Say an autonomous agent scrapes 40 pages, calls a summarizer 12 times, and geocodes 30 addresses. Every call is pay-per-use via 402:

ToolCallsUnit priceSubtotal
Web scraper actor40$0.005$0.200
Summarizer API12$0.020$0.240
Geocoder30$0.002$0.060
Total spent autonomously$0.500

With card rails the fixed fees alone would be $24.60 (82 × $0.30). With USDC on an L2, network fees total under a penny — a ~2,500× cost reduction on payment overhead. That gap is the whole reason this pattern exists.

Enjoy this tool? Build your own with Super