# FastX402 Token Unit Converter

> FastX402 Token Unit Converter is a paid API for AI agents from fastx402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-17).

Converts a token amount between its human-readable decimal form and its on-chain atomic (integer) unit representation given a token's decimal precision.

## Facts

- Endpoint: GET https://fastx402.tools/token-units?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fastx402-token-unit-converter-0668a885
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_c8fzzxQD0mCoPbDppJBFe

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 fastx402-token-unit-converter-0668a885
```

Example prompt: Convert 1.5 USDC to its atomic unit value — USDC has 6 decimals, so go to_atomic direction.

## When to prefer this

Use this endpoint when you need a quick, reliable, pay-per-call conversion between human-readable token amounts and their on-chain atomic integer equivalents for any ERC-20 or EVM-compatible token, without needing to set up an account or API key. Prefer it over manual arithmetic for precision-sensitive DeFi or contract interactions.

## Known failure modes

- Missing required query parameters (value, decimals, direction) returns an error
- Invalid direction enum value (not 'to_atomic' or 'from_atomic') causes rejection
- Non-numeric 'value' string causes a parse error
- Decimals outside 0-36 range may cause unexpected results
- Passing a non-integer string when direction is from_atomic may fail parsing

## How this service works

146 pay-per-call tools for AI agents, from $0.001 per request in USDC on Base or Solana with x402. No account, no API key.

## Output

Returns a JSON object with three fields: 'atomic' (the integer/smallest-unit representation as a string), 'decimal' (the human-readable decimal string), and 'decimals' (the integer number of decimal places used in the conversion).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "value",
      "decimals",
      "direction"
     ],
     "properties": {
      "value": {
       "type": "string",
       "description": "Amount: a decimal like 1.5 for to_atomic, or an integer like 1500000 for from_atomic"
      },
      "decimals": {
       "type": "string",
       "description": "Token decimals, 0-36 (USDC 6, ETH 18)"
      },
      "direction": {
       "enum": [
        "to_atomic",
        "from_atomic"
       ],
       "type": "string",
       "description": "to_atomic or from_atomic"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "atomic": {
       "type": "string"
      },
      "decimal": {
       "type": "string"
      },
      "decimals": {
       "type": "integer"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "atomic": "1500000",
  "decimal": "1.5",
  "decimals": 6
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fastx402-token-unit-converter-0668a885/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from fastx402.tools](https://www.zero.xyz/host/fastx402.tools/llms.txt)
