Check an x402 endpoint before paying it ($0.001 via x402)
x402_preflightPaid ($0.001 via x402 in USDC on Base, Solana, Monad, Polygon, Arbitrum, Avalanche, Algorand or Stellar, or in RLUSD on the XRP Ledger): call this before your agent pays an x402 endpoint. Returns go, caution or no_go, the recommended payment option, and why: payment would fail, the seller's payout address is on the OFAC SDN sanctions list, over your budget (max_usd), price above what is advertised, not HTTPS, unknown token, its 30-day track record. Never pays the endpoint. The buyer's check for one call; for several endpoints at once use x402_preflight_batch, before a payment above about $1 x402_preflight_deep, and to debug your own endpoint x402_diagnose. Same as GET /api/v1/preflight. The answer carries a signed receipt (EIP-191, bound to your arguments) that proves later which verdict you got.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"url": "<url>"
},
"name": "x402_preflight"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The x402 endpoint (public http(s) URL), e.g. https://api.example.com/paid | |
| body | No | Example JSON request body, for a POST route that checks its input before the 402 (implies POST). Without it, {} is sent and the requestBody example in the endpoint's /openapi.json is tried. | |
| client | No | Set to gateway when your agent pays with Circle's Gateway client (@circle-fin/x402-batching) from a Gateway balance: Gateway-only endpoints are then not a caution, and Gateway options are recommended first. | |
| method | No | HTTP method of the paid route (default: GET, then POST) | |
| max_usd | No | Your budget per call in USD, e.g. 0.05 | |
| network | No | CAIP-2 network you want to pay on, e.g. eip155:8453 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | ||
| accepts | No | Only on an unpaid call: the x402 payment options | |
| options | No | Each payment option with its network, price and problems | |
| reasons | No | ||
| receipt | No | Signed receipt (EIP-191) binding the answer to your arguments | |
| summary | No | One line, e.g. OK to pay: $0.02 on Base. | |
| verdict | No | ||
| safe_to_pay | No |