Convert an amount and keep its date
Your agent has a USD invoice and needs a EUR value for a report. exchange-rates returns the rate and, with a single quote currency plus an amount, the converted value. The response also carries a date you can store beside that calculation.
That date needs attention. A request for the latest rate asks for the latest available observation. Your report should carry the response’s date, even if your agent made the request on a different day.
The endpoint accepts JSON at:
POST https://x402.agentutility.ai/exchange-rates Content-Type: application/json
Access is paid through x402 in USDC on Base mainnet. Use a client configured to handle the endpoint’s payment challenge before consuming the successful JSON response.
Set the currency direction explicitly
All four request fields are optional, but explicit inputs make an agent’s intent easier to check.
base is the currency you’re converting from. It defaults to "USD" and accepts a three-letter currency code. quote selects the destination currency, either as a string or an array of strings. Omit it to request all available rates for the base.
date accepts "latest" or a string formatted as YYYY-MM-DD. Leaving it out requests the latest available rates. amount must be a finite JSON number expressed in the base currency.
Here’s the body for converting 1,250 USD into EUR:
{
"base": "USD",
"quote": "EUR",
"date": "latest",
"amount": 1250
}
Read the direction carefully. A value under rates.EUR means EUR per one unit of the returned base. With USD as the base, multiplication gives you the EUR amount.
And send a number. "1250" is a JSON string; 1250 is the numeric input this endpoint expects.
For an LLM choosing tools, route a request here when the task needs currency rates or an amount conversion. Preserve the source currency from the invoice instead of accepting the USD default without checking.
Use historical requests for dated reports
A report tied to a specific day should request that day explicitly:
{
"base": "USD",
"quote": "EUR",
"date": "2026-09-30",
"amount": 1250
}
Inspect the returned date. Keep your requested date separately so the report can distinguish the day you asked for from the date attached to the rate.
The following response excerpt uses an illustrative rate of 0.92. It isn't a claimed historical observation:
{
"base": "USD",
"date": "2026-09-30",
"rates": {
"EUR": 0.92
},
"converted": {
"from_amount": 1250,
"to_currency": "EUR",
"to_amount": 1150
}
}
The calculation is 1250 × 0.92 = 1150. Your billing record can retain the original 1,250 USD alongside the calculated 1,150 EUR, with the response date attached.
Keep the returned precision. Apply your application’s currency rounding rule when producing the final billing value; the endpoint’s multiplication doesn't promise a particular number of decimal places.
Handle several quote currencies differently
Need EUR and GBP columns in the same report? Pass an array:
{
"base": "USD",
"quote": ["EUR", "GBP"],
"date": "2026-09-30"
}
That request returns a rates map. The converted object is conditional: it requires an amount and exactly one requested quote currency with an available numeric rate. Supplying an amount with several quote currencies doesn't produce a collection of converted totals.
So check the response before writing the report. For a single conversion, require the expected destination currency and a numeric converted.to_amount. For several currencies, calculate each value from its matching entry in rates.
Store the response with the invoice or report run. A later request using "latest" can produce a different value, so an archived calculation should retain the rate that produced it. Keep the x402 access payment in a separate expense field: it's the cost of the API call, while the converted amount belongs to the document you're processing.