DEV Community

edvyno
edvyno

Posted on

What a paid x402 endpoint looks like in production

Most writing about machine payments stops at the demo: a 402 status code, a cheerful "and then the agent paid!" and no numbers. This is the unglamorous version — the actual HTTP conversation, what we ship behind it, and what a month of running a paid endpoint taught us, including the part where almost nobody bought anything.

I run a small market-data service for AI agents (the trading desk behind it is mine, so treat the self-interest as disclosed). Everything below is measured on that endpoint, not projected.

The protocol is a status code and a header

x402 revives HTTP 402 Payment Required. The server answers an unpaid request with the price, the asset and the address, in a payment-required header; the client pays and retries with proof in X-PAYMENT. No signup, no API key, no monthly commitment.

$ curl -i "https://your-endpoint.example/x402/ta?symbol=BTC"
HTTP/2 402
payment-required: <base64 {scheme, network: eip155:8453, asset: USDC,
                            amount, payTo, resource, nonce}>
content-type: application/json

{"error":"payment_required","price_usd":"0.02"}
Enter fullscreen mode Exit fullscreen mode

A paying client does three things: read the challenge, settle it through a facilitator (Coinbase CDP, or any compatible one), and retry the same URL with the proof header. The server verifies the receipt and returns the JSON it already computed. That round trip is the whole integration — about fifteen lines in most SDKs, and nothing at all if your agent framework speaks x402 natively.

Two details that bite in practice. First, the 402 body and the payment-required header must stay byte-identical to what your middleware emits, or clients that parse either one will disagree with each other. Second, price belongs in the challenge, so changing a price is a config change, not a deploy — that is also how you discover you priced something wrong.

What we actually ship

Free, and deliberately so, because it is the demo:

  • /market.json — machine-readable catalog of every paid resource, with price and category
  • /board — a live edge board (sports and market edges, refreshed)
  • /mcp — a JSON-RPC MCP endpoint exposing the same tools, with the price in _meta.x402.price_usd
  • /llms.txt — plain-language index so a model can find the above without a crawler

Paid: twenty-six routes, from $0.02 per call up to a $15 market report, with a $5 / 30-day pass in between.00 — a price feed, technical-analysis summaries, Hyperliquid market state, wallet intel (single, batch, deep), a trade-plan generator, a confluence scorer, sentiment, and a couple of creation endpoints. The cheap ones exist because agents buy in volume; the $0.25–$1.00 ones exist because a single call replaces ten minutes of the buyer's work.

The honest numbers

In roughly a month: three external buyers, $0.06 in total. Not a typo, not a rounding artifact. A public survey of listed x402 sellers puts the market in the same shape — tens of thousands of listings, a median price near $0.03, most earning nothing, and a handful of wallets taking the majority of volume. Any claim that "agents will discover and pay you" without distribution is marketing.

What did move the needle, measurably: directory listings (two registries, one catalog that now indexes all twenty-six routes (and counts each one honestly)), the MCP wrapper, and a free endpoint good enough that people return to it. What did not: tweets, price cuts, and a nicer landing page.

Five things I would tell the next builder

  1. Discovery is the product. A perfect endpoint nobody can find earns zero. Ship a catalog and register with every honest directory before you write another feature.
  2. One free endpoint, genuinely useful. Mine is the edge board. It is the only thing that consistently produces repeat traffic, and repeat traffic is what converts.
  3. Price the expensive call for the work it replaces. $0.02 is the market's default and also its floor; the only way out of the race is selling fewer, better calls.
  4. Idempotency beats dashboards. Your buyers are programs. They care that a retried call does not double-charge, not that your settings page is pretty.
  5. Instrument the funnel, not the vibe. Clicks, 402s issued, payments settled, repeat payers. If a step has no number, it is not working — it is just happening.

Where it lives

Free to poke at: market.json, the board, and the MCP endpoint. The catalog is the honest description of what is paid and what it costs.

The broader lesson stands on its own: machine payments work, the plumbing is boring in the best way, and the hard part was never the protocol. It is being findable, being worth $0.02, and being honest about which of those two you are missing.

Top comments (0)