# Agent402 UK Token Amount Scaler

> Agent402 UK Token Amount Scaler is a paid API for AI agents from agent402.co.uk, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Converts ERC-20-style token amounts between human-readable and atomic (wei-style) units for any decimal precision from 0 to 36.

## Facts

- Endpoint: POST https://agent402.co.uk/v1/utils/token-amount
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-uk-token-amount-scaler-f14bed69
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap__NPIilrUNe1SF373hdocB

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 agent402-uk-token-amount-scaler-f14bed69 -d '<json body>'
```

Example prompt: Convert 1.5 USDC to atomic units — USDC has 6 decimals, so scale it to_atomic for me so I can pass it directly to a smart contract.

## When to prefer this

Use this endpoint when an AI agent needs to programmatically convert token amounts between human-readable and raw atomic representations for any ERC-20-compatible token with arbitrary decimal precision (0–36). It is especially useful as glue logic inside DeFi workflows where exact integer amounts are required for on-chain calls, avoiding floating-point errors that arise from manual conversion. Prefer this over writing ad-hoc BigInt arithmetic in agent code when you need a reliable, API-accessible conversion with validation feedback.

## Known failure modes

- Invalid decimals value outside 0–36 range returns valid:false
- Non-numeric or malformed amount string returns valid:false
- Invalid direction value (not 'to_atomic' or 'to_human') causes rejection
- Negative amount strings may be rejected depending on implementation
- Network timeout or payment failure returns HTTP 402 or 5xx

## How this service works

Don't burn tokens on deterministic work. Go/no-go jobs first: payout preflight, text firewall (PII/secrets), budget check — then rails, calendars, finmath. x402 USDC on Base. UK + global. agent402.co.uk — not agent402.tools. $0.001–$0.002 USDC on Base. No API keys.

## Output

Returns a JSON object with a boolean 'valid' field indicating whether the inputs were acceptable, and a 'result' string containing the converted amount (e.g. '1500000'). The result is always a string to preserve large integer precision.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "amount": {
   "type": "string",
   "description": "Amount string"
  },
  "decimals": {
   "type": "string",
   "description": "0-36"
  },
  "direction": {
   "type": "string",
   "description": "to_atomic | to_human"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "valid": true,
  "result": "1500000"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-uk-token-amount-scaler-f14bed69/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.co.uk](https://www.zero.xyz/host/agent402.co.uk/llms.txt)
