When an agent hits an x402 endpoint, it has exactly two moves: build a payment from the challenge it was handed, or walk away. Both are expensive if the challenge is wrong. A signature that no client can build wastes the call; a payment for an offer that misstates its unit wastes the money; a price above the client's default spend cap ends in a silent refusal the seller never sees.
The cheapest moment to find any of that is before the signature โ on the unpaid 402 itself. That request is free, repeatable, and tells you more about the offer than the paid response will.
Every defect below has been seen in the wild, and none of them is a crash. Each one is a 402 that looks fine to a parser and fails later, at the point where money moves.
PAYMENT-REQUIRED header disagree. Some clients read the header, some read the body. If their accepts[] arrays differ, half your callers pay a different price than the other half.exact offer with no extra.name / extra.version. The signing domain is unbuildable. The wallet cannot produce a signature, so the endpoint is effectively closed to every compliant client.amount. Token amounts must be integers in the smallest unit. A float cannot be signed losslessly; rounding it either underpays or overpays by a fraction the seller will never notice.network that is not CAIP-2, or a payTo / asset that is not a 20-byte address. The client has nowhere to send the payment, or sends it somewhere unrecoverable.x402Version: 2 with resource as a string. v2 defines resource as an object. A string that passes a lenient parser is not a v2 document.input.example when the service takes input, or an example that violates its own schema.required, teaches every reader the wrong request. Indexers copy that example and replay it for days.@minia2a/x402-check is a zero-dependency Node โฅ18 CLI. It sends one unpaid request (two when the static-offer check runs), reads the challenge the endpoint actually serves, and prints a verdict with per-finding codes. It never signs and never pays.
$ npx @minia2a/x402-check https://example.com/paid/api
x402-check 0.1.4 https://example.com/paid/api
status 402 verdict PASS (0 fail, 0 warn, 2 info)
INFO static-offer two requests 1.2s apart return an identical offer ...
INFO unpaired-examples output.example is advertised without answerBasis ...
Exit codes are 0 no failures, 1 at least one FAIL, 2 usage or network error โ so it drops into a CI step or an agent's pre-payment routine without parsing prose. --json gives the same report as data. --max-price defaults to 1.00 USD, the reference client's cap; --header lets you reach endpoints behind an auth header.
It does not test whether the endpoint enforces payment โ whether it accepts a forged transaction hash, replays a receipt, or serves data without settling. That question needs a signed payment, which is a different tool and a different risk: the moment the check signs, the check itself is a transaction, and a test you cannot afford to run on every push does not get run. Payment-enforcement auditing is a paid, adversarial exercise. A preflight should be something a buyer runs on every unfamiliar endpoint without thinking about cost.
It also does not judge whether the data is good, whether the seller is honest, or whether the service is worth the price. It judges the offer's shape.
We ran it against 40 endpoints sampled from minia2a's own listings. The honest result:
| verdict | count | why |
|---|---|---|
| PASS | 39 | no defects at the challenge layer |
| FAIL | 1 | a $2.00 endpoint above the default cap โ it discloses the cap, so the tool was working as designed |
| INFO | 36 | unpaired-examples: an output.example with no answerBasis |
| WARN | 2 | empty-input-example on services that do take input |
The 36 INFO findings are our own gap, not a client bug. We advertise an output example for most services, but we do not state that it is the response to the input example next to it. A reader can see the pair and assume the link; nothing in the document asserts it. That is the difference between an example and a claim, and it is on our list.
The single FAIL is the more useful lesson. The tool said no because a $2.00 offer exceeds a $1.00 default โ exactly what the default is for. Raising --max-price turned it green, and the endpoint's own advertisement already disclosed the cap. A preflight that cannot be told "I know what I'm doing" would be ignored after the first false positive.
The first published CLI (0.1.3) reported unpaired-examples on 36 of the 40 endpoints. That count was too high, and why is worth keeping: the check fired on every output.example without an answerBasis key โ including services that publish no input example at all, and services whose output example plainly echoes the input values (q: "hello" in, query: "hello" out). Neither is an unpaired example.
0.1.4 narrows the rule: it fires only when a non-empty input example exists, none of its values appear in the output example, and no answerBasis says otherwise. The same 40 endpoints, re-run on the same day:
unpaired-examples: 36 โ 13. Those 13 are the real list to work through;empty-input-example rows in the table are the same two services that now report no-example-params (INFO) โ the check was renamed and softened in 0.1.2.A preflight that over-reports is a preflight people stop reading. The version number is the honest part of the record: the tool prints its own on the first line.
An offer is a promise. Every promise in the 402 should be checkable without accepting it: the price, the token, the chain, the recipient, the domain, and the example. If a check needs a signature to run, it will run rarely, and the rare check is the one that misses the change.
Run the preflight against endpoints you are allowed to call. If you sell an x402 endpoint, run it against your own โ the failures it finds are the ones your buyers experience as silence.