Dev.to · 2 min read

Currency Conversion API for AI Agents: ECB Reference Rates, Pay Per Conversion

Currency Conversion API for AI Agents: ECB Reference Rates, Pay Per Conversion

Agent workflows price, report, and budget in more than one currency. The usual routes to a conversion are a subscription FX feed, another API key to babysit, or pretending a reference rate is a tradable quote. SML FX Convert is the pay-per-call primitive instead — with the source named up front. Measured live on 2026-10-19 GET /api/fx/info (free) identifies the source in the response itself: European Central Bank EXR daily reference rates — "Source: ECB statistics." Price: $0.001 USDC per accepted conversion on Base mainnet. GET /api/fx/convert?from=USD&to=EUR&amount=100 without payment → HTTP 402 with a PAYMENT-REQUIRED header quoting exactly 1,000 atomic USDC, network eip155:8453, scheme exact. No SML API key. No account. The 402 challenge is the entire checkout. A 100-conversion credit pack runs 0.005 USDC — 0.00005 USDC per successful conversion when fully used. Fail-closed by contract: "No real rate => no settlement; caller receives a free alternative route." Invalid codes, malformed amounts, or unavailable reference data are never silently transformed into a paid, fabricated conversion. The honest limit This is an ECB reference-rate calculation — not a bank, card, exchange, or broker execution quote. It does not custody fiat, trade currencies, guarantee a spread, or promise that a reference rate is executable anywhere. What it is for: normalizing vendor prices, comparing API costs quoted in different currencies, converting budget limits before tool selection, and keeping agent-commerce reporting in a single reference currency — where source provenance matters more than pretending a reference rate is a live dealing price. Fresh x402 target terms remain authoritative immediately before spend; a 402 challenge is not settlement, and settlement is not acceptance. Full evidence and claim receipts: the canonical link on this article.

This is a summary aggregated from Dev.to. Read the complete article on the original site:

Read full article at Dev.to

More AI & Machine Learning News