# FastX402 Lab Token Units Converter

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

Converts token amounts between human-readable decimal and blockchain atomic (integer) units given a token's decimal precision

## Facts

- Endpoint: GET https://lab.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-lab-token-units-converter-bc956aca
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_oc4g8_bdXFqfJW6PIC-j7

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-lab-token-units-converter-bc956aca
```

Example prompt: Convert 1.5 USDC to its atomic integer form — USDC has 6 decimals, use the to_atomic direction.

## When to prefer this

Use this endpoint when an AI agent needs a quick, stateless, no-signup conversion between human-readable token amounts and raw blockchain integer units — especially useful before constructing smart contract calls or formatting on-chain balances for display. Prefer this over manual arithmetic when precision for high-decimal tokens (18 decimals) matters and you want a verified result.

## Known failure modes

- Missing required query parameters (value, decimals, direction) returns a 400 error
- Invalid direction value (not to_atomic or from_atomic) returns validation error
- Non-numeric value string causes a parsing error
- Decimals out of 0-36 range may produce unexpected results
- Payment failure over x402 protocol results in 402 response requiring USDC payment on Base

## How this service works

FastX402 Lab: small pay-per-call tools for AI agents, paid per request in USDC on Base over x402. No signup, no API key.

## Output

Returns a JSON object containing the atomic integer string representation, the decimal string representation, and the number of decimals used — e.g. {"atomic":"1500000","decimal":"1.5","decimals":6}.

## 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-lab-token-units-converter-bc956aca/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from lab.fastx402.tools](https://www.zero.xyz/host/lab.fastx402.tools/llms.txt)
