Call a paid x402 service (spends USDC)
call_paid_serviceCalls an x402 endpoint, automatically pays its USDC price from the configured wallet, enforces a maxPriceUsdc cap, and returns the response with a payment receipt.
Instructions
Call an x402 endpoint and automatically pay its USDC price from the configured wallet. Refuses to pay above maxPriceUsdc (default 0.25). Returns the response plus payment receipt (txid).
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": "call_paid_service"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| via | No | 'direct' (default) pays the endpoint straight from your wallet. 'relay' routes through Caravan's safe-passage relay: you authorize up to $0.05, are charged actual cost + 20%, and FAILED CALLS ARE FREE (payment cancelled). Prefer relay for unfamiliar merchants. | |
| body | No | JSON body for POST/PUT | |
| query | No | Query params to append | |
| method | No | HTTP method, default GET | |
| network | No | ||
| maxPriceUsdc | No | Hard cap on what this call may cost (USDC). Default 0.25 | |
| approvalToken | No | Human-approval token from a prior needs_approval response. Only pass this after the human explicitly approved the payment. |