# Token Unit Converter (wei/gwei/ether)

> Token Unit Converter (wei/gwei/ether) is a paid API for AI agents from flat-rate-llm.kikoribera03.workers.dev, paid per call via x402, $0.0025/call, status unknown (last checked 2026-09-15).

Converts cryptocurrency token amounts between wei, gwei, ether, or any custom decimal precision using exact integer arithmetic — no floating-point errors.

## Facts

- Endpoint: POST https://flat-rate-llm.kikoribera03.workers.dev/v1/util/units
- Price: $0.0025/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/token-unit-converter-wei-gwei-ether-7e12d482
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_bbUPGX_8FSB1QyUj-Xlcu

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability token-unit-converter-wei-gwei-ether-7e12d482 -d '<json body>'
```

Example prompt: Convert 1500000000000000000 wei to ether — I need an exact decimal string, no floating-point rounding.

## When to prefer this

Choose this endpoint when you need guaranteed exact integer arithmetic for Ethereum unit conversions and cannot risk floating-point rounding errors — especially when preparing transaction inputs, displaying token balances, or working with ERC20 tokens that have non-standard decimal counts (e.g. USDC with 6 decimals). Prefer it over manual conversion in code to avoid the classic off-by-1000 decimals mistake that causes real financial loss.

## Known failure modes

- Missing required field (`from`, `to`, or `amount`) returns an error
- Unrecognized unit string (not wei/gwei/ether or a valid decimal integer) causes a parsing error
- Amount passed as a float (e.g. 1.5e18) instead of a string may cause precision loss before the API even receives it
- Very large numbers beyond JavaScript safe integer range could behave unexpectedly if not passed as strings

## How this service works

60 paid endpoints with no metering, no API key and no account. Each endpoint has one flat price per call, whatever the size of the request: LLM completions with automatic failover across several large models, read-only EVM tooling over Base, Ethereum, Polygon, Arbitrum and Optimism, and pure crypto utilities that touch no network.

## Output

A JSON object with the fields `to`, `from`, `amount` (echoed back), and `result` — the converted value as an exact decimal string, computed with integer math to avoid any floating-point rounding loss.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "to",
  "from",
  "amount"
 ],
 "properties": {
  "to": {
   "type": "string",
   "description": "wei | gwei | ether, or a number of decimals."
  },
  "from": {
   "type": "string",
   "description": "wei | gwei | ether, or a number of decimals."
  },
  "amount": {
   "type": "string",
   "description": "The quantity, as a string to avoid float loss."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "to": {
   "type": "string"
  },
  "from": {
   "type": "string"
  },
  "amount": {
   "type": "string"
  },
  "result": {
   "type": "string"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/token-unit-converter-wei-gwei-ether-7e12d482/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from flat-rate-llm.kikoribera03.workers.dev](https://www.zero.xyz/host/flat-rate-llm.kikoribera03.workers.dev/llms.txt)
