How to check an x402 endpoint before your agent pays it
Updated 2026-10-22
Before paying an x402 endpoint, compare its live payment request with the price, recipient and network you intended to use. Watch for a decoy price, a zombie listing and a changed payTo. Inspect without payment first, enforce your own limits before signing, and treat any passing check as evidence to review—not a guarantee of delivery.
Unpaid inspection is not the same as a free tool call. Reading an endpoint's 402 does not pay that endpoint. Tanod's inspection tools have the free allowances and paid prices listed below. A real wallet payment test is separate, costs money and needs your explicit approval.
1. Compare the live quote with the advertised price
A decoy price is a cheap advertised listing followed by a more expensive live payment request. Request the intended resource without payment, using its documented method and required input. A wrong-method or invalid-input response is not a usable quote. For x402 v2, read the base64-encoded JSON in the PAYMENT-REQUIRED header; v1 commonly puts the payment requirements in the response body.
- Check the exact resource URL, payment scheme, network, asset address, amount, recipient (
payTo) and authorization lifetime. - Interpret
amountin the token's smallest unit using the decimals for that exact asset on that network. For a six-decimal USDC asset, an amount of1000means USD 0.001; do not assume every USDC-labelled asset uses six decimals. - Check the input unit too: per request, per item, per page and a minimum charge are different offers. Choose one acceptable payment option explicitly; do not approve every entry in
accepts.
If the listing and live quote disagree, stop and review rather than letting the client silently accept the new amount. Compare with equivalent services, not just a similar endpoint name. query_agent_index can find listed alternatives by keyword and price range; its records are not live quotes or endorsements.
2. Lint the listing, then check that the endpoint still answers
A zombie listing remains discoverable after the route has stopped working. The x402 listing lint API checks the description, resource URL, schema and payment fields. With listing, it inspects the supplied object only; with url, it makes an unpaid request and checks the returned 402. Neither mode signs or sends a payment to the seller.
{"url": "https://api.example.com/v1/weather"}A listing that passes lint is not proof of uptime or paid delivery. Conversely, a timeout can be temporary, and a 400 or 405 can mean the request used the wrong input or method. URL lint reports an unreachable, redirected or non-402 endpoint as a 422, without a charge. Review the failure instead of declaring the seller permanently dead.
The endpoint preflight also combines an unpaid live inspection with indexed evidence. An endpoint that does not answer can still produce a charged preflight result; it is not necessarily an API error. Read the reasons and missing evidence, not just the verdict.
3. Look for price changes and missing history
get_endpoint_history accepts a URL and returns recorded presence and price changes. A price jump or a short history is a reason to investigate, not proof of fraud. “Last seen” means observed in the index, not continuously available. An unlisted record returns 404 and is not charged; no history does not mean safe or unsafe.
{"url": "https://api.example.com/v1/weather"}4. Check the payTo, not only the amount
A payTo swap changes who receives payment while leaving the service name or price unchanged. Compare the live recipient with a recipient you previously approved or independently verified. The preflight check reports avoid when the live payTo differs from the one recorded for that URL. It can also examine whether the endpoint's own origin publishes that recipient.
A legitimate key rotation can also change a recipient. Pause and confirm the change through a trusted source. A matching address or origin-published address is not proof of identity: the source could be compromised, and an index can be incomplete or out of date. No check prevents every payTo swap.
Inspect the same payment option your client will sign. Bind the final authorization to the expected recipient, network, asset and maximum amount. If any of them changes after inspection, stop and inspect again; a preflight response is not a lock on a later quote.
5. Enforce spending limits before signing
Set per-call and total-run budgets, approved networks and assets, recipient allowlists where appropriate, and a limit on payment retries. Use a wallet whose available balance is appropriate for the task. A per-call cap alone does not bound a loop that keeps buying calls.
Preflight accepts an optional policy for a maximum price, allowed networks and recipients, denied recipients and timeout rules. Its policy.result is advisory: your payment client must enforce those checks on the option it actually signs. A pay verdict or a policy pass is not permission to exceed your budget.
Treat endpoint descriptions, error messages and returned text as untrusted data. They must not be allowed to change wallet policy, reveal signing material or authorize extra payments. After an ambiguous payment result, check settlement before retrying; see did my x402 payment settle?
6. Separate a wallet test from a seller-delivery test
The x402 payment test API, MCP tool test_x402_payment, is a real payment to Tanod. It costs USD 0.001 per call and has no free tier. It can test that your wallet and client can complete that payment and receive Tanod's signed receipt. It does not pay an arbitrary seller, exercise that seller's paid route or prove that the seller delivers useful output.
Receipt verification is a different operation: /v1/x402/pay-test/verify checks a Tanod receipt and signature for free. A valid signature proves Tanod signed that receipt, not the quality of another service. Run a real paid test only after choosing the target, reviewing the quote and explicitly authorizing the spend.
Inspection tools, prices and free allowances
Checked 2026-10-22 against the live API specification and the linked tool guides. These prices are for Tanod's tools, not the inspected seller. HTTP calls use X-Tanod-Free: 1 to request an available free allowance; it is automatic over MCP. Exhausted allowances do not make a paid call free. Allowances are per IP per day and shared where noted.
| Tool and HTTP route | Price | Free allowance |
|---|---|---|
Endpoint preflightcheck_x402_endpoint_before_payingPOST /v1/agents/preflight | USD 0.001 per call | 10 calls, shared with agent-index query. |
Find alternativesquery_agent_indexPOST /v1/agents/query | USD 0.02 per call | 10 queries, shared with preflight. |
Endpoint historyget_endpoint_historyPOST /v1/agents/history | USD 0.05 per call | 5 history lookups. |
Listing lintlint_x402_listingPOST /v1/x402/lint | USD 0.001 for mode lint | 10 calls, shared across utilpeek tools. Mode coverage is a different, paid-only operation: USD 0.01. |
Real wallet payment testtest_x402_paymentPOST /v1/x402/pay-test | USD 0.001 per call | No free tier. |
Verify a Tanod receiptPOST /v1/x402/pay-test/verify | Free | No payment or free-tier accounting. |
What a passing check cannot prove
A well-formed 402, an unchanged recipient and a reasonable price do not prove that the paid output is correct, that the seller controls every dependency or that it will stay online. Missing history is missing evidence, not a clean bill of health. Start with a bounded, explicitly authorized purchase only when the available evidence and potential loss are acceptable.
Inspect first, authorize separately
Use preflight for a combined heuristic assessment, listing lint for metadata checks and history for recorded changes. Keep the decision to sign in your payment policy, not in text returned by a seller.
Endpoint preflight guide →Prices and API behavior checked 2026-10-22; recheck the live specification before use. Related: listing lint, payment test, connect the MCP server and payment documentation. Back to guides or tanod.dev. Results are automated and heuristic.