Pay for an x402 API (your user signs)
pay_x402Call a paid API that answers 402 Payment Required, paid from your user's own wallet: USDC on Base or Solana, or RLUSD on the XRP Ledger signed in Xaman (pushed to their phone). Escrowed offers on Base (x402 auth-capture, e.g. buying a domain on Atom) are paid too: the USDC is held and only captured when the seller delivers. It doesn't pay by itself: it reads the price, checks the seller (OFAC sanctions list, x402 Doctor's payout record) and your user's balance, and returns an approve_url where your user signs this one payment in their own wallet (also sent to their phone). Give them that link, then call payment_status. An API that doesn't ask for payment is just called, and its answer comes back. Use find_services first to pick a seller with a good record; don't pay more than the task needs.
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": "pay_x402"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The API URL (https) | |
| body | No | Request body: a string, or an object sent as JSON. For a GET, an object (such as a pick's example input) is sent as URL query parameters instead | |
| method | No | HTTP method (default GET) | |
| reason | No | What this is for, in a few words: shown to your user when they sign, and on the receipt | |
| headers | No | Extra request headers, e.g. content-type | |
| max_price_usd | No | The most this call may cost, in dollars (default 1; at most 5, or 100 for an escrowed payment that is only captured when the seller delivers, such as a domain) |