code402 / tools / erc20-balance
$0.000999 per call · 20 free calls/day · no signup · pay with card credits or a signed USDC voucher (x402)
Raw + formatted ERC-20 balanceOf for an address at any token contract on Base. Decimals read on-chain. Preflighted so you never pay during an RPC outage.
curl -X POST https://code402.dev/v1/tools/erc20-balance/call \
-H "content-type: application/json" \
-d '{"address":"0xc59c85e661d34084a7769f955d17fd38254a6235","token_address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}'
No key needed for the free tier. When the free quota is used up, the API replies HTTP 402 with the exact price — agents sign the x402 voucher and retry; humans buy card credits. Every paid response carries a signed receipt you can verify offline.
| Field | Type | Meaning |
|---|---|---|
address (required) | string | Holder EVM address, 0x-prefixed. |
token_address (required) | string | ERC-20 token contract address, 0x-prefixed. |
decimals | number | Token decimals override (optional). |
Top-level fields: tool, valid, address, token_address, balance_raw, decimals, decimals_source, balance, reason, retryable, scope. Paid responses also carry a signed XDR-1 receipt.
Machine-readable catalog: llms-full.txt · MCP manifest · OpenAPI. Operated by JUANA LIMITED (UK Co. No. 14043409). Non-custodial: USDC settles payer→seller directly on Base.