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). 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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The API URL (https) | |
| body | No | Request body: a string, or an object sent as JSON | |
| 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) |