When your agent has to pay

Charging for a tool is the easy half. The real shift is software that pays for tools on its own.

Almost everything written about x402 covers the seller side: wrap a tool, set a price, collect USDC per call. We covered that, and it comes down to a few lines of config.

But a payment has two ends. For every tool that charges, something has to pay and the paying end is where the real shift is. Charging is a server setting. Paying, with no human in the loop, is a different kind of software than we've been building.

Your server is already a buyer

If you've used xmcp to connect to external MCPs, you've already shipped a consumer. A clients.ts entry turns a remote server's tools into typed functions your own tools can call:

src/clients.ts

Today those external tools are free, or they're gated behind an API key you went and provisioned by hand. That works because you were there to sign up. The moment the thing doing the calling is an agent — discovering tools at runtime, with no operator standing by — the hand-provisioned key stops being an option.

Why paying is the hard half

Charging is config. Paying autonomously asks the buyer to do four things a credit card flow never had to:

  • Learn the price at call time. The buyer didn't know the cost in advance. The 402 response hands it back, machine-readable.
  • Decide if it's worth it. Against a budget, not a saved card. Some calls are worth a cent; some aren't.
  • Produce payment in milliseconds. A signed stablecoin authorization, not a checkout page.
  • Do it without anyone clicking "approve." No human in the loop, by design.

Cards, invoices, and seat licenses can't do any of that. They assume an account that exists before the transaction and a person who set it up. x402 inverts it: the price arrives with the request, and the buyer answers with a signature on the spot. That's what makes agentic payment real: the buyer behaving like a buyer, autonomously.

What it unlocks: composition with a price tag

Once paying is cheap and automatic, tool use stops being a closed set you wired up ahead of time. An agent hits a capability it doesn't have, finds a tool that does, checks the price, pays, and keeps going. The unit of trust becomes a budget instead of a pile of credentials. One agent can pay another for a single call and never establish a relationship beyond that.

This isn't far-off. A payment standard for agents is consolidating in the open — the x402 Foundation launched in early 2026 with Google, Microsoft, AWS, Visa, Mastercard, Stripe, Coinbase, and Circle behind it, and the protocol is being folded into Google's AP2 effort. The rails for the buyer side are being poured now.

Both halves, one loop

Info

Seller side — charging for your tools with the paid() wrapper — lives in Pay-per-use MCP tools with x402. This post is the buyer side. Together they're the full loop.

The way to think about an xmcp server is that it sits on both ends. Its own tools can charge via paid(). Its clients.ts connections consume other servers' tools — and when those start costing money, x402 is how it settles, per call, without a human or an API key in sight.

That's the loop a machine economy runs on: servers that can charge, and buyers that can pay, talking the same protocol. The seller side is shipped. The buyer side is where agentic payment lives.

If you're building agents that need to pay for what they use, come tell us what you're working on in Discord.

One framework to rule them all