# x402 Chain Tools – ERC-20 Token Balance

> x402 Chain Tools – ERC-20 Token Balance is a paid API for AI agents from blockchain-api.x402-chain-tools.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Returns the ERC-20 token balance (raw, formatted, and decimal-adjusted) for a given wallet address on Base Mainnet.

## Facts

- Endpoint: POST https://blockchain-api.x402-chain-tools.workers.dev/chain/token-balance
- 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/x402-chain-tools-erc-20-token-balance-d1d2be33
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_yi7PQVgmPfqD0SHo3lbat

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 x402-chain-tools-erc-20-token-balance-d1d2be33 -d '<json body>'
```

Example prompt: What's the USDC balance on Base for wallet address 0xAbCd...1234? The USDC contract on Base is 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913.

## When to prefer this

Choose this endpoint when you need the ERC-20 token balance of a specific wallet on Base Mainnet and require both the raw on-chain value and the human-readable formatted amount. It is ideal for agents that need to verify token holdings before executing a transfer, checking DeFi portfolio positions, or monitoring treasury balances. Prefer this over native ETH balance endpoints when the asset is an ERC-20 token rather than ETH itself.

## Known failure modes

- Invalid token contract address format (not a valid 0x ERC-20 address) returns an error
- Invalid wallet address format (not a valid 0x address) returns an error
- Token contract address does not correspond to a deployed ERC-20 on Base returns zero or error
- Network congestion or RPC unavailability may cause timeouts
- Payment failure (insufficient x402 balance) blocks the request

## How this service works

Get an ERC-20 token balance for a Base address.

## Output

Returns a JSON object with ok status, the queried token contract address, the wallet address, and a balance object containing the raw integer balance string, the token's decimal precision, and a human-readable formatted balance string, plus the network identifier (eip155:8453 for Base Mainnet).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "token": {
   "type": "string",
   "pattern": "^0x[0-9a-fA-F]{40}$",
   "description": "ERC-20 token contract address on Base."
  },
  "address": {
   "type": "string",
   "pattern": "^0x[0-9a-fA-F]{40}$",
   "description": "Base wallet address."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "token": "0x0000000000000000000000000000000000000002",
  "address": "0x0000000000000000000000000000000000000001",
  "balance": {
   "raw": "0",
   "decimals": 6,
   "formatted": "0"
  },
  "network": "eip155:8453"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-chain-tools-erc-20-token-balance-d1d2be33/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from blockchain-api.x402-chain-tools.workers.dev](https://www.zero.xyz/host/blockchain-api.x402-chain-tools.workers.dev/llms.txt)
