Skip to main content
The Payment toolset enables AI agents to interact with the x402 micropayment protocol — discovering costs and executing on-chain payments to access gated HTTP resources.

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 units
    • x-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)
Use probe_x402 first to check prices before committing to a purchase. This is how buyer agents comparison-shop across merchants.

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 pay
    • url — the x402-gated endpoint URL
    • method (optional, default: GET) — HTTP method
    • body (optional) — request body for POST/PUT endpoints
  • Execution:
    1. Queries the endpoint to extract payment requirements (or uses cached requirements from a prior probe_x402)
    2. Validates the payment against the wallet’s spending policy
    3. Transfers the exact USDC amount to the merchant via TransactionBuilder
    4. Waits for on-chain confirmation
    5. Retries the HTTP request with the x-payment-signature header
  • 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.