# Solana Token Amount Converter (Base Units ↔ Human Readable)

> Solana Token Amount Converter (Base Units ↔ Human Readable) is a paid API for AI agents from solana-pulse-gateway-1021990235790.us-central1.run.app, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-13).

Converts between human-readable token amounts and on-chain base units using a token's real on-chain decimal precision, preventing transaction errors from decimal mismatches.

## Facts

- Endpoint: POST https://solana-pulse-gateway-1021990235790.us-central1.run.app/api/tools/convert_amount?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/solana-token-amount-converter-base-units-human-readable-ed1710f3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_MPFvcmYTe7Xz-tPt7qhP1

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 solana-token-amount-converter-base-units-human-readable-ed1710f3 -d '<json body>'
```

Example prompt: Before I build this transaction, convert 5 USDC to its correct base unit amount using the real on-chain decimals for the USDC mint on Solana — I don't want to send the wrong amount.

## When to prefer this

Use this endpoint whenever an agent needs to translate a user-specified token amount (e.g. '5 USDC') into the exact base units required by Solana transaction instructions, or vice versa. It is essential before signing any SPL token transfer to avoid sending 1000x too much or too little due to decimal errors. Prefer this over hardcoding decimals (e.g. assuming 6 for USDC) because token decimals must be fetched from on-chain state and may differ per token.

## Known failure modes

- Invalid or unrecognized token mint address returns an error
- Token not found on-chain or not yet indexed
- Network timeout when fetching decimals from Solana RPC
- Input amount cannot be parsed or is negative
- Mint address provided for wrong network (e.g. devnet vs mainnet)

## How this service works

Use before putting any token amount into a transaction. "5 USDC" is 5,000,000 base units; getting decimals wrong sends 1,000x too much or too little. Converts between human amounts and base units using the token's real on-chain decimals.

## Output

Returns the converted amount in the target unit (base units or human-readable), along with the token's on-chain decimal count used for the conversion, enabling agents to safely construct or validate Solana transactions with correct numeric precision.

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/solana-token-amount-converter-base-units-human-readable-ed1710f3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from solana-pulse-gateway-1021990235790.us-central1.run.app](https://www.zero.xyz/host/solana-pulse-gateway-1021990235790.us-central1.run.app/llms.txt)
