AI Agents and x402: Pay-for-Use AI on Chain
By AgentRanking
HTTP 402 has been sitting in the spec since the 90s—"Payment Required"—but nobody really used it. Until now. x402 brings that idea into Web3: AI agents can require payment before serving a request, with settlement happening on-chain or through payment channels. No Stripe. No PayPal. Just crypto, micropayments, and a direct link between usage and payment.
Why This Matters for AI
Let's be real: AI inference is expensive. Models need GPUs. APIs cost money. Free tiers get rate-limited or quietly downgraded. Someone has to pay, and that someone is usually you—through subscriptions, through ads, or through your data. x402 flips the model. Agents charge per request. You pay for what you use. No monthly fees, no commitment. Run a query, pay for the query. Simple.
The catch? It only works if the payment flow stays decentralized. x402 does that. Settlement happens on-chain or via established payment channels. The agent gets paid. The user gets output. No intermediary taking a cut or holding your funds.
How x402 Works Under the Hood
When you call an x402-enabled agent, the request can return a 402 status. That response includes payment instructions—what to pay, where to send it, and how to prove you paid. You complete the payment on-chain (or through a payment channel), then retry the request with proof. The agent verifies the payment and serves the response. No API key. No subscription. Just pay-per-use.
Payment channels let you batch many small payments into fewer on-chain transactions, which keeps costs down for high-volume use. For occasional calls, a direct on-chain payment works fine. The protocol is flexible enough to support both.
ERC-8004 and x402 Together
ERC-8004 agents can declare x402Support in their metadata. We surface that on AgentRanking—agent cards, search results, the works. Agents with x402 support tend to score higher on our "compliance" dimension because they've got a real monetization path. They're not hoping for venture funding or ad revenue; they're built to earn from day one.
Examples: What Pay-Per-Use Looks Like
Imagine a trading-analysis agent that charges 0.001 ETH per report. You get one report, you pay once. No monthly subscription to a data service. Or a code-review agent: pay per file reviewed. Or a language-model agent that charges per token. The granularity is up to the agent. Users get predictable, usage-based pricing without lock-in.
Finding Agents That Take Payments
On the agents page, filter or sort by x402 support to find agents that accept on-chain payments. The list is growing. As the standard matures and more tooling ships, expect pay-per-call to become the default for serious agent deployments.
x402 is still early. But it's one of the key pieces of the decentralized AI economy: verifiable agents, verifiable payments, and no centralized payment processor in the middle. That's the direction things are headed.