Call any x402 endpoint
call_x402Call a pay-per-call x402 endpoint from the public index (find it with search_x402) — any host, not only FiatDock listings. TO BUY: call once WITHOUT payment to get the endpoint's 402 decoded (its price, its payTo, the EIP-712 domain) plus step-by-step instructions, sign ONE entry of accepts — the one on a network you can pay — with your own wallet, then call again with the same url/method/body plus payment set to the base64 x402 payload; the money goes straight from your wallet to the endpoint's payTo, FiatDock takes no fee and never touches it. No wallet? npx fiatdock-mcp with AGENT_PRIVATE_KEY and a maxPriceUsd ceiling signs and pays automatically. The endpoint's answer comes back as result with its settlement receipt when it settled. Reaches only hosts the public index lists; a FiatDock listing is called with call_service.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The endpoint URL from search_x402 (https). Fill any path parameter (e.g. :email) yourself | |
| body | No | JSON body to send (default {}). Its shape is the endpoint's — read its description, or the 402's own hint | |
| method | No | HTTP method (default POST — most x402 endpoints take a JSON body) | |
| payment | No | Base64 of ONE x402 v2 PaymentPayload you signed for ONE entry of the endpoint's accepts (from the first call's 402 — pick the network you can pay). Sent to the ENDPOINT as its PAYMENT-SIGNATURE header, never read by FiatDock. Omit on the first call to receive the challenge |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | true when the endpoint answered 2xx | |
| url | Yes | The URL that was called | |
| hint | No | Present on a 405: the endpoint refused this HTTP method — call again with the other one (the index records no method) | |
| note | No | Present only when truncated | |
| paid | Yes | true when a payment header travelled with the request — yours, or one this package signed | |
| allow | No | The endpoint's Allow header on a 405, when it sent one | |
| method | Yes | GET or POST | |
| result | No | The endpoint's response body — parsed JSON when it returned JSON, otherwise the raw text | |
| status | Yes | The ENDPOINT's HTTP status (a 402 comes back as isError with the decoded challenge instead) | |
| truncated | No | True when the body was cut at 256 KB | |
| settlement | No | The endpoint's decoded PAYMENT-RESPONSE header when it settled: the x402 settlement receipt (tx hash, network, payer) |