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.
Preflight the 402 before your agent pays for it
2026-12-05 · what an unpaid request can tell you, and what it cannot
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.
Structurally valid is not the same as payable
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.
-
Body and
PAYMENT-REQUIREDheader disagree. Some clients read the header, some read the body. If theiraccepts[]arrays differ, half your callers pay a different price than the other half. -
An EIP-712
exactoffer with noextra.name/extra.version. The signing domain is unbuildable. The wallet cannot produce a signature, so the endpoint is effectively closed to every compliant client. -
A non-integer
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. -
A
networkthat is not CAIP-2, or apayTo/assetthat is not a 20-byte address. The client has nowhere to send the payment, or sends it somewhere unrecoverable. -
x402Version: 2withresourceas a string. v2 definesresourceas an object. A string that passes a lenient parser is not a v2 document. - A price above the reference client's default $1 per-call cap, with no disclosure. The client refuses before it signs. The seller sees no error, no traffic, and no reason.
-
An advertised example the handler would refuse. An empty
input.examplewhen the service takes input, or an example that violates its ownschema.required, teaches every reader the wrong request. Indexers copy that example and replay it for days. - Two identical reads with no nonce or expiry. That is not a quote; it is a cached document. Fine for a static price, worth knowing before you build retry logic on it.
What we shipped: an unpaid-only preflight
@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.3 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.
What it refuses to check, and why
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.
What it found in our own catalog
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 rule that generalises
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.
Originally published at minia2a.uk.
Update — same day, after publication
The first published CLI (0.1.3) reported unpaired-examples on 36 of the 40 endpoints. That number 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 the same day:
- verdicts unchanged — 39 PASS, 1 FAIL (the $2 endpoint above the default cap);
-
unpaired-examples: 36 → 13. Those 13 are the real list to work through; - the two
empty-input-examplerows in the table are the same two services, now reported asno-example-params(INFO) — 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.
Top comments (1)
The finding that stuck with me is not the one FAIL — it's the 36 INFOs. A $2.00 endpoint above the $1.00 cap at least fails loudly to the tool; an output.example with no answerBasis fails quietly to the buyer, because the agent pays and then has no stated basis to check what it got. Your own catalog having 36 of those, against 39 of 40 endpoints passing at the challenge layer, is an honest result to publish. Two questions: of the defects you list, which one actually showed up most often in the wild — the body/header price disagreement, or the EIP-712 offer with no extra.name/version that makes the signing domain unbuildable? And after the preflight passes, what is the one check you still wish existed before the signature — something about the seller, or something about the data itself?