x402 endpoint preflight API: should my agent pay this endpoint? pay, caution or avoid, per call

Updated 2026-10-13

Use when an agent must decide whether to pay an x402 endpoint: live 402, payTo change, price outlier, listing age.

Before your agent pays an unknown x402 endpoint, ask for a verdict. POST https://tanod.dev/v1/agents/preflight takes the endpoint URL, makes one unpaid request to its live 402 (nothing is paid), compares what it finds with the Tanod agent index, and returns pay, caution or avoid with the reasons and the evidence values behind them. It costs USD 0.001, paid in USDC on Base, Polygon, Solana, BNB Chain or Arbitrum through x402. That is a tenth of the median listed x402 price in the Coinbase Bazaar (USD 0.01 on 2026-10-13, from /agents/latest.json), so the check costs less than the typical call it protects. It shares the agent-index free pool of 10 free calls per IP per UTC day (header X-Tanod-Free: 1). It is also the MCP tool check_x402_endpoint_before_paying at https://tanod.dev/mcp. The manual version of these checks is in how to check an x402 endpoint before your agent pays it.

What you send

url is the public https URL of the endpoint, with a host name (no IP address) on port 443. A URL that is not public https, or a host that resolves to a private address, is a 422 and is not charged. An optional policy adds policy.result to the answer, see spend policy.

curl -s -X POST https://tanod.dev/v1/agents/preflight \
  -H "Content-Type: application/json" -H "X-Tanod-Free: 1" \
  -d '{"url": "https://api.example.com/v1/weather"}'

What you get

verdict; reasons, each with a code, a severity (avoid, caution, info or ok), a message and the evidence values that triggered it; and evidence with the live 402 (state, price, payTo, payment options), the listing (listed price, first seen, still listed), the payTo comparison, the domain binding, the price comparison and the host's farm score. The reply also carries the thresholds, the index snapshot and the time of the check.

The rules

Avoid when the payTo changed since the index last saw it, when the price is at least 10 times the median of similar listings and at least USD 1, or when the 402 is malformed (no usable payment option). Caution when the endpoint does not answer a payment request, was first listed fewer than 7 days ago, costs at least 3 times the category median, sits on a host with a high listing-farm score (0.5 or more), is not bound to its domain (the origin publishes payment addresses but not this one), changed payTo in the index history in the last 30 days, asks at least twice its listed price, or has a maxTimeoutSeconds on the payment option checked that is missing or invalid, under 10 seconds (a buyer may not be able to settle in time) or over 3,600 seconds (a long-lived signed authorization). On 2026-10-13 we sent one unpaid request to each of 130 listed endpoints. Of the 106 that answered with a usable 402, 74 (70%) set 300 seconds, 15 set 60 and 7 set 120, and none fell below 10 or above 3,600. So this rule only flags outliers. Otherwise pay. A check that cannot run, such as a URL that is not in the index, is an info reason and does not change the verdict. The payTo rule comes first because buyers weigh it most. On 2026-10-13 a buyer replying to our question on Moltbook said they paid 1 USDC for an audit of 20 x402 endpoints. A payTo that no longer matched the listing disqualified endpoints; a high price did not.

What to do with each verdict

Agent builders answering our question on Moltbook described the same practice: a changed payTo is a hard stop, price drift is a reason to probe with a cap rather than to stop, and a URL that doesn't answer is skipped.

Does the live 402 match the listing?

A buyer who found the endpoint in a directory wants to know, before signing, whether the 402 it just got still matches what the directory recorded. Preflight compares the two on every call when the URL is in the agent index (the CDP x402 Bazaar and PayAI listings):

A URL that is not in the index gets not_listed (info) and no listing comparison. Add "require_listed": true to the policy below to fail those outright.

Using it as a spend-policy gate

Companies are giving agents wallets with spend controls. Ramp, for example, added x402 agent wallets on Solana for its business customers in August 2026, with corporate controls and audit trails. A cap on price per call is the easy part. The harder questions are whether this payee is the same one as last week, and whether this price is normal for the category. Preflight answers both from evidence a local policy cannot see. Send your rules as an optional policy and read policy.result (pass or fail) in the same call:

curl: one call, verdict and policy
curl -s -X POST https://tanod.dev/v1/agents/preflight \
  -H "Content-Type: application/json" -H "X-Tanod-Free: 1" \
  -d '{"url": "https://api.example.com/v1/weather",
       "policy": {"max_price_usd": "0.05", "networks": ["base", "solana"],
                  "pay_to_deny": ["0x0000000000000000000000000000000000000bad"],
                  "max_timeout_seconds": 600, "max_median_ratio": 5, "allow_caution": false}}'

The reply adds "policy": {"result": "fail", "failed": [{"clause", "message", "evidence"}], "unknown": [], "checked": ["payable", "max_price_usd", ...], "strict": false}. The verdict and reasons are unchanged, and no extra request is made: the policy is judged on the payment options the one unpaid request already read. All fields are optional:

Option clauses pass when some payment option passes them, and the policy also needs one option that passes all of them together (clause single_option). An endpoint with no usable payment option always fails the clause payable. A malformed policy is a 422 and is not charged. With allow_caution left at true, an avoid verdict does not fail the policy by itself, so treat avoid as a no regardless. If you would rather keep the policy on your side, match on the reason codes of one plain preflight answer instead:

Python: the same idea, kept local
def allowed(pre, max_usd=0.05, max_ratio=5):
    codes = {r["code"]: r for r in pre["reasons"]}
    if pre["verdict"] == "avoid":
        return False, "preflight says avoid"
    price = next((codes[c] for c in ("price_in_range", "price_outlier", "price_extreme_outlier") if c in codes), None)
    if price and price["evidence"]["price_usd"] > max_usd:
        return False, "over the per-call cap"
    if price and price["evidence"]["ratio"] > max_ratio:
        return False, "far above the category median"
    if "payto_changed_recently" in codes or "payto_unbound" in codes:
        return False, "payee changed recently or is not published by the endpoint's origin"
    return True, pre["verdict"]

Either way, treat caution as "allowed, but log it". A changed payee (payto_changed) or a price far above the median (price_extreme_outlier) already makes the verdict avoid. Each reason also carries a severity (ok, info, caution or avoid), so a policy can count cautions instead of naming codes. The local snippet was tested on 13 October 2026 against the example answer in our OpenAPI.

Where the signals come from

Limits

See also the price benchmark and the Bazaar data pages.

Use it from Claude without writing code: in claude.ai or Claude Desktop, add https://tanod.dev/mcp/agents?via=x402-endpoint-preflight-api as a custom connector (steps), then ask in plain words, for example "Before I pay https://example.com/api/price, check that the endpoint still answers with a live 402 and the price is not an outlier." The free daily allowance is applied automatically over MCP. Beyond it a call needs an x402 payment, which these clients can make.

Related guides: what x402 endpoint trust checks cost, address poisoning check before a transfer, checking an endpoint by hand, agent index API, MCP server check API. Updated 2026-10-13. All guides, or back to tanod.dev. Results are automated.