x402 preflight: is it safe to pay this endpoint?
x402_preflightAnswers "Is it safe to pay this x402 endpoint?" before an agent pays a seller it has not used before. Requests the URL without paying (GET, then POST), reads the 402 challenge (x402 v1 or v2) and checks every payment option: scheme, network, amount, asset, payTo and timeout, testnet vs mainnet, and the price in USD for USDC; whether it declares a valid Bazaar listing; how fast it answers. Screens the payTo wallet against OFAC and, on Base or Ethereum, checks what it is (a wallet, multisig, or a token contract that would swallow the payment). Adds how much the endpoint and its seller are actually used: 30-day calls and unique paying wallets from the Coinbase Bazaar's published figures. Set max_price_usd to enforce a budget. Returns ok_to_pay, caution or do_not_pay with reasons. An unreachable endpoint is an answer (do_not_pay). You are only charged when a result is returned: invalid input (400) and upstream failures (4xx/5xx) are not settled. Costs $0.003 USDC per call via x402. Paid per call with x402 inside MCP (see the server instructions).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The paid endpoint, e.g. https://api.example.com/v1/tool. | |
| via | No | Optional: the tool whose next_calls suggested this call (filled in for you). | |
| method | No | How to request it: auto (default) tries GET, then POST with an empty JSON body. | auto |
| max_price_usd | No | Your budget per call: a higher price makes the verdict do_not_pay. |