Fetch, paying the paywall if there is one
pay_and_fetchFetches an HTTP(S) URL and, on a 402 x402 paywall, pays through Spend Guard only when policy checks pass; otherwise holds larger or unknown payments for dashboard approval.
Instructions
Fetch a URL and, if it answers HTTP 402 (an x402 paywall), pay it through the user's Spend Guard. The payment goes out only if it fits the user's budget, goes to an address the service is known to use and is not a price spike; larger payments and unknown services wait for the user to approve them on the dashboard. Returns the HTTP status, what was paid (amount, payee, transaction) and the response body. Redirects are not followed. A refused payment is final: tell the user what was refused and why, and do not try to pay another way.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The http(s) URL to fetch. | |
| body | No | Request body, for POST, PUT and PATCH. | |
| method | No | Default GET. | |
| headers | No | Extra request headers, e.g. {"accept": "application/json"}. Payment, cookie and origin headers are set by the guard or dropped. |