Your 402 advertisement is a second implementation of your API
This content reflects minia2a as of its publication date and is kept for the record. Current model: x402 pay-per-call in USDC on Base only, 5 free trial calls per signed wallet, no credits and no top-up rail.
This content reflects minia2a as of its publication date and is kept for the record. Current model: x402 pay-per-call in USDC on Base only, 5 free trial calls per signed wallet, no credits and no top-up rail.
Your 402 advertisement is a second implementation of your API
2026-11-28 ยท from a sweep of 135 advertised output shapes
When an agent meets a pay-per-call endpoint, the first thing it reads is the unpaid 402. Inside it is a machine-readable advertisement: an input example, and an output example naming the keys the answer will carry. That advertisement is what an agent writes its parser against before it ever pays.
The trouble is that the advertisement is not produced by the handler. It is a separate artifact โ a generated table, a probe run, a snapshot โ and nothing in most deployments compares it to what the handler actually returns. It is, in effect, a second implementation of the API, written by a different program, and never exercised by a customer's call. Second implementations drift, and the drift is silent because the advertisement still looks machine-checkable.
On 2026-11-28 we judged every first-party service that advertises an output shape โ 135 of them โ by comparing the two shape fields inside each PAYMENT-REQUIRED document against each other and against a real call. Nineteen advertised a candidates list that does not match the example in the same document. Eighteen of those say so: the document carries an answerBasis field warning that the shape was measured on a call with no input. One does not, and it is also the one whose example is three weeks stale.
Two fields, two calls
The x402 bazaar extension carries two descriptions of the answer under extensions.bazaar.info.output:
| field | where it comes from | what it actually describes |
|---|---|---|
candidates |
a probe that called the endpoint with empty input {}
|
what an unparameterised call returns |
example |
a probe that called the endpoint with the advertised input | what the call in the same document returns |
answerBasis |
derived from the service's published input example | a prose warning that the first two describe different calls |
Those are two different requests. When a handler branches on input โ and every interesting one does โ the two requests can return different objects. Usually the difference is a handful of keys. Sometimes it is the shape of the whole answer. Our gateway discloses this in answerBasis โ "measured on a call with no input; the published example may return a different shape" โ which is honest and, being prose, is not something a parser can act on.
Live, from a x402-country 402 document:
"input": { "method": "GET", "queryParams": { "code": "FR" } },
"candidates": [ "count", "countries" ], // an empty call: a list
"example": { "ok": true,
"result": { "name": "France", "capital": "Paris",
"continent": "Europe", "currency": "EUR" } } // the advertised call: one object
A buyer that follows candidates writes resp.result.countries.map(...). The advertised call never returns a countries array; result.countries is undefined and the parse throws on the first element. The answerBasis field in the same document does warn that the example may differ โ but a warning about a different shape is not a schema, and the two fields still name different answers with nothing machine-readable saying which one the advertised input takes.
Same problem, milder, on x402-iban-validate: candidates is [reason, valid] (the shape of a rejected IBAN), while the advertised call โ a valid German IBAN โ returns {valid: true, country: "DE"}. country is in no candidate list. Same for x402-validate-email (domain, local), x402-validate-url (host, port, protocol), x402-chain-registry (chainId, explorer, rpc, symbol), x402-celo, and twelve more.
Both fields are true statements, and the document says so.
candidatescorrectly describes the empty call;examplecorrectly describes the advertised call;answerBasissays the two are different measurements. What remains is the gap between a prose caveat and a machine-checkable claim: 18 of the 19 were disclosed this way, and a parser built fromcandidatesstill breaks on the advertised input.
Drift is not only keys โ it is semantics
Keys are the easy case. The expensive case is a field whose meaning changed in the handler and did not change in the advertisement, because the example was captured months earlier.
x402-poly-volume advertises {"limit": 1} and an example with "count": 1 and one market. Read literally that teaches: count is how many markets you asked for. The live answer to that exact input:
advertised: { "count": 1, "markets": [ ... ] } # 4 keys; count echoes the requested limit
live: { "count": 60, "returnedMarkets": 1,
"marketsTruncated": true, ... } # 6 keys; count = markets matching the filter
count is not the page size. It is the size of the filtered set, and returnedMarkets is the page size, and marketsTruncated says the two differ. An agent that budgets from the advertisement ("one market, small payload") gets a number sixty times larger than it expected, with no field in the example that warned it. answerBasis does not cover this class: it speaks about the shape of a no-input call, not about whether the example is still what the handler returns.
x402-market-census is the same failure one level up. Its example carries categoryCount: 10 and ten categories. The live answer:
advertised (snapshot 2026-11-06): categoryCount 10, 13 keys
live (2026-11-28T08:28Z): categoryCount 26, returnedCategories 10,
categoriesTruncated true, 15 keys
The number in the advertisement is the length of the array that was returned. Today categoryCount is the total number of categories in the snapshot, the array is a page of ten, and categoriesTruncated discloses the gap. An agent that read the old example and summed categoryCount as "categories present" was, as of today, off by sixteen โ and the two fields that would have told it so are absent from the advertisement entirely. This is the one service in the sweep with no answerBasis: its published input example is empty ({}), and the gateway only emits the warning when the example carries fields. So the only shape a buyer can read here is a stale one, with no caveat attached.
Why the two probes were not enough
The shape probe that produced candidates also had a cap: it kept sorted(keys)[:12]. A twelve-key response and a fifteen-key response produced the same advertisement, and nothing marked the difference โ the same "a count that counts the slice" defect we wrote about yesterday, now living inside the generator of the advertisement rather than inside a paid answer. Measured across 717 rows of the shape table, exactly three sat on the boundary; one of them (x402-market-census) really was over it. The cap was raised to 24 with a self-test that proves a 15-key response loses nothing and a 40-key response is still bounded โ but the honest fix is a candidatesTruncated disclosure at the emission site, not a bigger number.
What to do if you publish endpoints
-
Generate the advertisement from the call you advertise. If
input.queryParamssayscode=FR, theoutput.examplemust come from that exact request โ and the shape list next to it must describe the same request, not a default one. -
Do not paper over the branch with a union. Merging the two key sets produces a list that describes neither call โ for
x402-countryit would read[capital, continent, count, countries, currency, name], which is still not the advertised answer and no longer the empty-input one. Keep the no-input shape labelled as such (ideally machine-readably, not only in prose), and publish the shape of the call you actually advertise. - Disclose truncation in the advertisement too. If the shape list has a bound, the document needs a field that says the bound was hit. Silent capping inside the generator is the same lie as silent capping inside the handler.
-
Guard the two fields against each other. Replay the published input once, diff the observed key set against
candidatesandexample, and fail the build on a mismatch the document does not declare. That single comparison found all nineteen here, and it costs one free call per service.
What to do if you consume endpoints
- Treat the advertisement as a hint, not a schema. It is generated, it is stale-aware only if someone made it so, and it is not exercised by your call.
-
Fingerprint once. On your first paid call, record the key set of
resultand parse against that. A small amount of defensive parsing (key in result, optional chaining, a shape canary) survives drift that no schema can. -
Never infer a total from an example count.
count: 1next tolimit: 1is the most misleading number in an advertisement, because it looks like a fact and is really an echo of your request. -
Prefer the document's
exampleovercandidateswhen they disagree, because the example is the call you are about to make. But verify: a good server will either make them agree or say in a field which one applies to the input it advertised.
The advertisement is the cheapest part of a pay-per-call API to generate and the cheapest to check, which makes it the least defensible place for drift. If a buyer can find nineteen key gaps with one free call per endpoint, so can the seller โ and only the seller can fix them once, at the source.
The marketplace is at minia2a.uk โ 1,958 pay-per-call endpoints in USDC on Base, 5 free trial calls per signed wallet on the endpoints that offer trials, no registration. The corrections described here are staged for the next gateway build: refreshed output examples for the endpoints whose handler changed under them, including poly-volume and market-census. We also withdrew a fix we had staged earlier the same day โ a union of the two probes' key sets โ because it would have made answerBasis false: after a union, the list is no longer "measured on a call with no input". A caveat that lies is worse than a gap that is disclosed.
Correction, same day. The first version of this post said the 19 advertisements were self-contradictory with "no reconciliation". That was wrong: 18 of the 19 carry
answerBasis, which says in prose that the example may return a different shape. We measured it within minutes of publication, and corrected the claim, the fix guidance (the union was withdrawn for the same reason), and the count distinction โ 18 disclosed, 1 undisclosed (x402-market-census, which has no fielded input example to trigger the warning).
Originally published at minia2a.uk.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes โ full credit and traffic to the original publisher.