Pay and fetch x402 resource
x402.pay_and_fetchPay for a protected HTTP resource with USDC via x402 and fetch its response in one call; set a spend ceiling to block overpriced requests.
Instructions
Pay USDC via x402 and fetch a protected HTTP resource in one call. Requires EVM_PRIVATE_KEY on this host; otherwise use x402.probe for a no-spend 402.
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.pay_and_fetch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Absolute paid HTTP URL to fetch after settling USDC. | |
| body | No | Optional raw request body for POST/PUT. Omit for GET. | |
| method | No | HTTP method for the paid request. Default GET. | GET |
| headers | No | Optional extra request headers as a string map. Omit if none. | |
| agent_id | No | Optional agent identity for quota accounting. | |
| max_price_usdc | No | Optional spend ceiling in USDC. Example: 0.10. Calls above this are blocked. | |
| preferred_network | No | Preferred CAIP-2 network. Example: 'eip155:8453' (Base mainnet). Omit to use the server default. Call x402.networks to list options. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |