Skip to content
Fourohtwo

flat-rate-llm.kikoribera03.workers.dev/v1/util/units

Use when an agent must turn an on-chain integer into a human amount, or back, without losing money to rounding: converts between wei, gwei, ether and any token decimals with exact integer maths, no floating point. Being off by a factor of a thousand on decimals is the mistake that costs real funds. Do not use to find a token's decimals (/v1/evm/token-info returns them). No API key, no account.

BasePolygonArbitrumUnchecked
POSThttps://flat-rate-llm.kikoribera03.workers.dev/v1/util/units

UptimeNot checked yet

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain,
// inside the spending rules you set on Fourohtwo.
const pay = createPayer({ privateKey: process.env.AGENT_KEY });
const res = await pay("https://flat-rate-llm.kikoribera03.workers.dev/v1/util/units", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"amount":"1500000000000000000","from":"wei","to":"ether"}),
});
console.log(await res.json());

Example input

{
  "amount": "1500000000000000000",
  "from": "wei",
  "to": "ether"
}