Build1 distinct publisher3 min readPublished
One Express middleware answers a paid route with HTTP 402, and a wrapped fetch signs a USDC transfer and replays the call. The caller needs no signup; on mainnet the seller still authenticates to Coinbase's facilitator to settle.
The Engineer · Build desk

Compiled by The EngineerSomething wrong?How this is made
The facilitator branch is where the keyless claim actually gets tested. The config picks `createFacilitatorConfig(config.cdpApiKeyId, config.cdpApiKeySecret)` when `config.isMainnet`, and a bare `{ url: config.testnetFacilitatorUrl }` otherwise, with an inline comment noting that the testnet URL needs no key [5]. Buyers turn up with a wallet address and nothing else [3]. Sellers on mainnet keep a Coinbase CDP credential and a third party inside the request path [5]. The account relationship has not gone away; it sits between the seller and the facilitator instead of between the seller and the caller.
On a call, `paymentMiddleware` answers the paid route with 402 and the requirements, the `@x402/fetch` wrapper signs and replays, and `@x402/express` calls the facilitator's verify and settle before the handler runs [2][12][6]. The route table names the chain in CAIP-2 form, `eip155:8453` on mainnet [7]. That is two requests to your server for one resource, plus a verify and an on-chain settle you do not control [17]. The handler stays clean: it sees `req` and `res`, never an address or a signature [6], and the gas endpoint's body is a `viem` read against a public RPC [8]. Payment as middleware, business logic that does not know it is being sold, is the good engineering in this build.
Pricing is where I would push back. `export const price = "$0.005"` lives in the endpoint module next to the handler [8][4], so a repricing is a code change and a deploy. At half a cent, a dollar buys 200 calls [15]. The gas read is wrapped in `cached("gas-base", 60_000, ...)` [9], so a client polling once a second pays $0.30 a minute while the server makes at most one upstream RPC call in that minute [16]. Nothing in the declared schema lets a caller ask for a fresh read: `inputSchema` is `{ properties: {}, required: [] }` [10]. Cache TTL is now a pricing decision. The buyer cannot see it.
A couple of things are worth checking before copying this. All five `@x402/*` packages are pinned at 2.24.0 with `@coinbase/x402` at 2.1.0, and the older unscoped `x402-express` and `x402-fetch` are deprecated and must not be mixed with the scoped v2 line [11]. A protocol shipping under two namespaces at once will earn its share of confused stack traces. Second, the buyer's identity is `privateKeyToAccount(BUYER_PRIVATE_KEY)` [12], so the thing that names your client and the thing that spends its money are one secret in one process.
For a machine client that wants a single read from a server it has never met, this is a better deal than key issuance, and the receipt comes back in a header you decode to a transaction [13]. For anything with a customer relationship, the account you skipped creating is the one you will want the first time a paid call settles and then returns a 500. The author frames the piece as a code and protocol tour rather than an agentic economy pitch [14], and it holds up read on those terms.
Ranked by verification strength, evidence, and original report placement.
The author built an Express API that AI agents, humans or anything with fetch can pay per call in USDC with no signup and no API key; it is live on Base mainnet with 27 paid endpoints, and real settled transactions have been run against it.
@x402/express handles the 402 response and calls the facilitator's verify and settle; the endpoint handler never sees a wallet address or a signature, only a normal req/res.
The endpoint declares a discovery extension via declareDiscoveryExtension from @x402/extensions/bazaar with empty input and inputSchema { properties: {}, required: [] }; price and discovery are metadata consumed by the middleware and the discovery documents, not by the handler.
x402 revives the dormant HTTP 402 Payment Required status code as a payment handshake: a client calls a paid route, the server replies 402 with payment requirements (amount, asset, network), the client signs a USDC transfer on Base and replays the request with a PAYMENT header, a facilitator verifies and settles the transfer on-chain, then the server serves the response.
There is no account creation, no API key issuance and no OAuth dance; the wallet address is the identity and payment is the auth.
Each endpoint is a file in endpoints/ exporting { path, method, price, handler }; server.js loads them all, builds the x402 route table and mounts one middleware via app.use(paymentMiddleware(paidRoutes, resourceServer)).
Distinct publishers with included, body-backed reporting in this cluster.
dev.to
1 article · September 1, 2026
Follow any of these and your For You feed starts watching them — no settings page required.
invest
OpenAI and AWS just made agent-initiated payments a documented pattern, not a demo1 distinct publisher
build
A spec-clean 402 is not a listing: x402scan bounced the tunnel, not the JSON1 distinct publisher
build
All 575 listed x402 services split $516.96 over thirty days1 distinct publisher
invest
X's stablecoin creator payouts would be a plumbing decision, not a crypto bet3 distinct publishers
Evidence-backed comparisons of source perspectives and observed adoption signals. Read the methodology
Which Builder, Operator, and Investor concerns the observed source mix emphasized—not a truth score.
Evidence, demonstrated adoption, hype gap, incentives, and confidence are assessed independently, each on its own current evidence. How these are measured.
Primary code, single author
Nearly every mechanism can be checked by reading it: the facilitator branch, the paidRoutes shape, the cached gas read, the wrapped buyer fetch and the pinned 2.24.0 packages are quoted rather than described. Scale is the part nobody can check — the count of 27 endpoints appears once, in dev.to's opening paragraph, and the write-up breaks off partway through the discovery section before those endpoints are ever listed. A single Basescan hash is offered, and no one in our coverage has followed it.
One seller, one hash
The measurable footprint is a single developer's deployment: one hosted seller, one buyer script, one disclosed $0.005 settlement. The surrounding ecosystem is named — Coinbase's CDP facilitator, the Bazaar discovery extension, x402scan's preference for OpenAPI, an IETF draft for the well-known URI — but nothing attaches a user, a volume or a counterparty to any of it.
Claims stay behind the code
The author spends the first paragraph refusing the agentic-economy framing and then does the unglamorous thing: shows the deprecation trap, the cache window, the credential branch. Against that restraint, the headline's "27 endpoints, real transactions" is the only stretch — a single hash is doing the work of a plural. On balance the writing undersells what the code demonstrates.
The author is the seller
This is a builder writing about the paid API he operates, linking the hosted URL that takes the money and describing how he wired himself into five discovery surfaces so buyers find those endpoints. That does not make the code wrong — the snippets are the most trustworthy part — but the traffic-seeking motive is right there, and the mainnet path happens to route production settlement through Coinbase's facilitator.
Verifiable in parts, unaudited in scale
Confidence splits cleanly. The protocol mechanics deserve a high grade: they are quoted code with version numbers, and an implementer would find out within an hour if they were wrong. The deployment story deserves a low one: one publisher, one interested party, one hash, and a text that stops mid-sentence before the discovery surfaces are all shown.