probe_x402
Discover the cost and requirements of a protected endpoint without paying.
- Input:
url— the x402-gated endpoint URL
- Execution: Sends an HTTP GET request. If the server returns
402 Payment Required, parses the payment headers:x-payment-amount— cost in token base unitsx-payment-mint— the SPL token mint address (e.g., USDC)x-payment-address— the merchant’s receiving wallet
- Returns: Payment requirements (amount, token, merchant address, network)
pay_x402_invoice
Execute the full x402 payment flow in a single call — pay the merchant and receive the data.
- Input:
wallet_id— the agent wallet that will payurl— the x402-gated endpoint URLmethod(optional, default:GET) — HTTP methodbody(optional) — request body for POST/PUT endpoints
- Execution:
- Queries the endpoint to extract payment requirements (or uses cached requirements from a prior
probe_x402) - Validates the payment against the wallet’s spending policy
- Transfers the exact USDC amount to the merchant via
TransactionBuilder - Waits for on-chain confirmation
- Retries the HTTP request with the
x-payment-signatureheader
- Queries the endpoint to extract payment requirements (or uses cached requirements from a prior
- Returns: The merchant’s HTTP response data + transaction signature + Explorer link
The entire flow — discover price → transfer USDC → verify on-chain → retry with signature → return data — happens in a single tool invocation. The agent never needs to orchestrate multiple steps.