# EVM Unit Converter — Parse and Format Token Amounts

> EVM Unit Converter — Parse and Format Token Amounts is a paid API for AI agents from agentresolver.vercel.app, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-18).

Converts EVM token amounts between human-readable decimal and raw base-unit (wei-style) representations for any token with a specified decimal precision.

## Facts

- Endpoint: POST https://agentresolver.vercel.app/api/evm-units
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-18
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/evm-unit-converter-parse-and-format-token-amounts-b776a741
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_caSMx_QP1I_MdLnOC6LVw

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 evm-unit-converter-parse-and-format-token-amounts-b776a741 -d '<json body>'
```

Example prompt: Convert 1.5 USDC (which has 6 decimals) to its raw base-unit amount so I can pass it directly to a smart contract — use parse mode.

## When to prefer this

Use this endpoint when you need a reliable, on-demand conversion between human-readable token amounts and raw EVM base units for any ERC-20 or EVM-compatible token, especially when the token's decimal count varies (e.g. USDC=6, ETH=18, WBTC=8). Prefer this over custom code when working in agent pipelines where introducing arithmetic errors in payment or transfer amounts would be costly.

## Known failure modes

- Invalid mode value (not 'parse' or 'format') returns validation error
- Non-numeric value string causes conversion failure
- Decimals outside 0–255 range rejected by schema
- Floating point precision edge cases may produce unexpected string results
- Payment of 0.005 USDC required per call; missing or invalid payment returns 402

## How this service works

Verify an x402 endpoint before paying: live payTo, USDC quote, network, asset, resource binding, TLS and endpoint safety for $0.001 on Base or Solana.

## Output

Returns a JSON object echoing back the mode, input value, and decimals, along with the converted result as a string and a resultKind field indicating whether the output is in 'base-units' (raw integer) or 'decimal' (human-readable) form.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "mode": {
   "enum": [
    "parse",
    "format"
   ],
   "type": "string"
  },
  "value": {
   "type": "string",
   "maxLength": 256
  },
  "decimals": {
   "type": "integer",
   "maximum": 255,
   "minimum": 0
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {}
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/evm-unit-converter-parse-and-format-token-amounts-b776a741/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agentresolver.vercel.app](https://www.zero.xyz/host/agentresolver.vercel.app/llms.txt)
