Tools · finance
FX rates + conversion (live, with the ECB rate beside it)
Live exchange rates and a conversion for ~170 currencies and the major crypto assets, with the European Central Bank reference rate beside each live one and the deviation between them - an independent check in the same answer. {from, to, amount}; send {} for USD against eight majors. Pay-per-call via x402.
$0.001 per call, paid in USDC on Base or Solana with x402 — no account, no API key. POST https://fiatdock.com/v1/fx/rates (or GET with the same fields as query parameters) · MCP tool fx_rates. An answer the tool cannot produce is refused with 4xx/5xx and is not charged.
Inputs
| Field | Type | Description | Example |
|---|---|---|---|
from | string | Currency to convert FROM (ISO code like USD, EUR, or a crypto like BTC), default USD | "USD" |
to | string | Currencies to convert TO, up to 20 (default EUR,GBP,JPY,CNY,CHF,CAD,AUD,INR) (comma-separated, or a JSON array) | "EUR,GBP" |
amount | number | Amount of the FROM currency to convert (default 1) | 100 |
Example
Request body
{"from":"USD","to":"EUR,GBP","amount":100}
Answer (the published example)
{"from":"USD","amount":100,"rates":[{"to":"EUR","rate":0.851,"converted":85.1,"ecbRate":0.8512,"deviationFromEcbPct":-0.024},{"to":"GBP","rate":0.742,"converted":74.2,"ecbRate":0.7419,"deviationFromEcbPct":0.013}],"ecbDate":"2026-10-02","source":"Coinbase exchange rates (live mid) + ECB reference rates via Frankfurter","asOf":"2026-10-05T00:00:00.000Z","note":"rate = units of each target one USD buys (a mid rate, before any spread or fee)."}
Call it
curl
# 1) ask: an unpaid call answers 402 with the exact price (free)
curl -i -X POST https://fiatdock.com/v1/fx/rates -H 'content-type: application/json' -d '{"from":"USD","to":"EUR,GBP","amount":100}'
# 2) pay: any x402 client signs that 402 and resends — see Node or Python below
Node
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";
const pay = wrapFetchWithPaymentFromConfig(fetch, {
schemes: [{ network: "eip155:*", client: new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_PRIVATE_KEY)) }],
});
const r = await pay("https://fiatdock.com/v1/fx/rates", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({"from":"USD","to":"EUR,GBP","amount":100}),
});
console.log(r.status, await r.json());
Python
# pip install "x402[httpx,evm]"
import asyncio, json, os
from eth_account import Account
from x402 import x402Client
from x402.http.clients import x402HttpxClient
from x402.mechanisms.evm.exact import register_exact_evm_client
async def main():
client = register_exact_evm_client(x402Client(), Account.from_key(os.environ["AGENT_PRIVATE_KEY"]))
async with x402HttpxClient(client) as http:
r = await http.post("https://fiatdock.com/v1/fx/rates", json=json.loads("{\"from\":\"USD\",\"to\":\"EUR,GBP\",\"amount\":100}"))
print(r.status_code, r.json())
asyncio.run(main())
MCP (Claude, Cursor, any MCP client)
{"mcpServers":{"fiatdock":{"command":"npx","args":["-y","fiatdock-mcp"],"env":{"AGENT_PRIVATE_KEY":"0x<your agent wallet key>"}}}}
// then call the tool "fx_rates" — the package pays each call from that wallet
The wallet needs USDC on Base. Prefer no install? The remote server https://fiatdock.com/mcp answers the 402 as tool output for an agent that signs its own payments.
Related tools
- Token safety check — $0.0045
- Token report (price + safety) — $0.0045
- Stablecoin supply and peg — $0.002
- Perp market + funding (Hyperliquid, Binance, Bybit) — $0.001
- Prediction markets (Polymarket) — $0.0045
- Best DeFi yields by chain and token (DefiLlama) — $0.001
Machine-readable: OpenAPI · tools.json · llms.txt · /.well-known/x402