x402_fetch
Fetch a URL and pay HTTP 402 (x402) requests from a configured wallet only when domain, recipient, asset, and spending limits pass; returns paid, not-required, refused, or failed JSON.
Instructions
Fetch a URL and, if it answers HTTP 402 (x402), pay from the configured wallet only when every rule passes before signing: allowed domain (X402_ALLOWED_DOMAINS), trusted recipient (X402_TRUSTED_PAY_TO), allowed asset (USDC by default; PREQ only if listed; A402 (v1) is deprecated), per-payment and daily limits, and human confirmation above the configured amount. Signs at most once per call. Pass quoteId from x402_quote to refuse if the requirements changed. The wallet key never leaves this machine. Returns JSON with result: "paid" (with the response, amount and settlement transaction) or "not_required" (the URL did not ask for payment; its response is returned); "refused" (with reasons) means nothing was signed; "failed" means a payment was signed but the paid request did not complete (see payment_history). Use x402_quote first to see the price without paying.
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": "x402_fetch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Full https URL of the paid API endpoint. Its host must be in X402_ALLOWED_DOMAINS. | |
| body | No | Request body for POST, as text (at most 100,000 characters). | |
| method | No | HTTP method (default GET). | |
| headers | No | Extra request headers, for example content-type. Payment headers are added by the tool. | |
| quoteId | No | quoteId returned by x402_quote. If set, the payment is refused unless amount, asset and recipient still match that quote. |