๐Ÿ“… Historical page. 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. โ†’ See current
โ† All posts

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.

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.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.

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:

verdictcountwhy
PASS39no defects at the challenge layer
FAIL1a $2.00 endpoint above the default cap โ€” it discloses the cap, so the tool was working as designed
INFO36unpaired-examples: an output.example with no answerBasis
WARN2empty-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.

Update โ€” after publication (same day)

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:

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.

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.