# ERC-20 Token Balance Lookup on Base (x402)

> ERC-20 Token Balance Lookup on Base (x402) is a paid API for AI agents from kr-x402-mvp.kgy5612.workers.dev, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-31).

Returns the ERC-20 token balance of a wallet address on the Base chain, including symbol, decimals, raw and human-readable balance, and current block number.

## Facts

- Endpoint: GET https://kr-x402-mvp.kgy5612.workers.dev/api/erc20-balance?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/erc-20-token-balance-lookup-on-base-x402-0a3d8940
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_WpqflBFV4191_XVQ2WNw3

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 erc-20-token-balance-lookup-on-base-x402-0a3d8940
```

Example prompt: What's the current USDC balance of wallet 0xe4be4d0bd82d8e68203deff81f79ede0529f2617 on Base? The USDC contract address is 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913.

## When to prefer this

Choose this endpoint when you need a real-time ERC-20 token balance for any wallet on the Base chain without setting up API keys — ideal for AI agents that pay per call in USDC via the x402 protocol. Prefer it over full node RPC calls when you want a simple REST interface with no infrastructure setup, and over free public RPCs when reliability and structured JSON output matter.

## Known failure modes

- Invalid token or wallet address format (must be 0x-prefixed 40-hex-char address) returns a 4xx error
- Token contract does not exist on Base returns zero balance or RPC error
- Payment not included or insufficient USDC payment via x402 returns HTTP 402
- RPC node congestion or Base chain downtime may cause timeouts
- Querying an EOA address as a token contract returns nonsensical results

## How this service works

Pay-per-call crypto microdata for trading/onchain AI agents via x402 (USDC on Base): Base gas, token risk, balances, multi-venue prices, Hyperliquid book/funding, kimchi premium. No API keys.

## Output

A JSON object containing the block number at which the balance was read, chain name ('base'), token contract address, token symbol, wallet address, human-readable balance (float), number of decimals, and the raw integer balance string (e.g. '61000' for 0.061 USDC).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "token",
      "wallet"
     ],
     "properties": {
      "token": {
       "type": "string",
       "pattern": "^0x[0-9a-fA-F]{40}$",
       "examples": [
        "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
       ],
       "description": "Base ERC-20 contract"
      },
      "wallet": {
       "type": "string",
       "pattern": "^0x[0-9a-fA-F]{40}$",
       "examples": [
        "0xe4be4d0bd82d8e68203deff81f79ede0529f2617"
       ],
       "description": "Wallet"
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "block": 53204016,
  "chain": "base",
  "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "symbol": "USDC",
  "wallet": "0xe4be4d0bd82d8e68203deff81f79ede0529f2617",
  "balance": 0.061,
  "decimals": 6,
  "balance_raw": "61000"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/erc-20-token-balance-lookup-on-base-x402-0a3d8940/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from kr-x402-mvp.kgy5612.workers.dev](https://www.zero.xyz/host/kr-x402-mvp.kgy5612.workers.dev/llms.txt)
