x402AgentTools

💰ERC-20 Token Balance

Read an ERC-20 token balance for any wallet on Base or Ethereum via public RPC eth_call — no key, no indexer. Returns the raw balance, human-readable amount (decimals applied) and token symbol.

Worked examples

USDC on Base — Base bridge

GET /api/v1/crypto/token-balance?token=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&holder=0x4200000000000000000000000000000000000006&chain=base

Result: 167.55 USDC

WETH on Ethereum — Binance 8

GET /api/v1/crypto/token-balance?token=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2&holder=0x28C6c06298d514Db089934071355E5743bf21d60&chain=ethereum

Result: 825.93 WETH

USDT on Ethereum — Binance 8

GET /api/v1/crypto/token-balance?token=0xdAC17F958D2ee523a2206206994597C13D831ec7&holder=0x28C6c06298d514Db089934071355E5743bf21d60&chain=ethereum

Result: 544,857,551.56 USDT

Machine API (x402)

$0.003 / call

This tool is also a JSON API for AI agents. Requests without payment receive 402 Payment Required plus instructions; agents pay USDC on Base via the x402 protocol — no accounts, no API keys.

GET /api/v1/crypto/token-balance?token=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&holder=0x4200000000000000000000000000000000000006&chain=base HTTP/1.1
Host: localhost:3000

→ 402 (payment required, instructions in headers)
→ 200 (after X-PAYMENT header; JSON body below)

{
  "tool": "crypto/token-balance",
  "input": {"token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","holder":"0x4200000000000000000000000000000000000006","chain":"base"},
  "result": { "value": 167.551481, "answer": "167.55 USDC" }
}

Agent docs: /llms.txt · OpenAPI spec · integration guide

About this tool

Query any ERC-20 token balance for any wallet directly from chain state via public RPC — no API key, no indexer, no rate-limit anxiety. Works on Base and Ethereum mainnet for every standard ERC-20.

Frequently asked questions

Does this include native ETH?

No — ERC-20 tokens only. Use wallet-snapshot for native balances, or a direct RPC eth_getBalance call.

Does it work for NFTs (ERC-721/1155)?

Not for individual items — ERC-1155 balances are returned raw but most NFTs need their own collection tools.

Related tools