x402 preflight: inspect a paid endpoint before paying
x402_preflightSends an unpaid GET to an x402 endpoint and reports what it would charge before paying: HTTP status, redirects (max 3, re-validated), v2 PAYMENT-REQUIRED header or v1 body challenge and its validity, each accepts entry (scheme, CAIP-2 network/name, atomic amount, USD for canonical USDC, asset check, payTo, timeout, EIP-712 name/version), OFAC SDN payTo screen, resource, Bazaar extension, risk flags, host context from registry RDAP (registrar, domain age) and Cloudflare DoH. Price: $0.005 per successful call, paid in USDC with x402 v2; failed calls and calls that match nothing are not charged.
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 | https:// URL of the x402 endpoint, including any query string, up to 2048 characters. Default port only; no embedded credentials, IP-address hosts, localhost or private names. |