# 1gateway Base Onchain Balances

> 1gateway Base Onchain Balances is a paid API for AI agents from 1gateway.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-13).

Fetches ETH balance, ERC-20 token balances, nonce, contract status, and block metadata for any Base mainnet address in a single call

## Facts

- Endpoint: GET https://1gateway.dev/v1/onchain/base/balances?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/1gateway-base-onchain-balances-4c4fea8c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_YojJbnb5V6U1drW0YJLL_

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 1gateway-base-onchain-balances-4c4fea8c
```

Example prompt: Check the ETH balance plus USDC and WETH holdings for 0x6246eee0355Dd7A93C888fE59e1151388A0cC5a1 on Base mainnet and tell me if it's a contract or EOA.

## When to prefer this

Choose this endpoint when you need a comprehensive Base mainnet wallet snapshot — ETH plus up to 20 ERC-20 balances — in a single HTTP call instead of making separate RPC calls per token. It is ideal when you need block-timestamped, normalized decimal balances alongside contract detection and nonce in one response. It does not return token prices, so if you only need price data use a price feed instead. Best for agents auditing wallet state, verifying deposits, or building portfolio summaries on Base.

## Known failure modes

- 400 returned for malformed address (not 0x + 40 hex or invalid EIP-55 checksum) — not charged
- 400 returned if more than 20 token addresses are supplied
- Token listed as status: not_an_erc20 if the contract address is not a valid ERC-20
- Network or RPC errors may return 5xx if Base node is unreachable
- Invalid or unknown token contracts return null for symbol/decimals/balance with an error status

## How this service works

Use when an agent needs what a Base address holds in one call instead of one RPC call per token. Input: address; optional tokens (up to 20 ERC-20 addresses, comma-separated; default USDC, EURC, USDbC, WETH, cbBTC, cbETH, wstETH). Output: JSON block+time, ETH balance, per-token symbol, decimals, raw and decimal balance, nonce, isContract. Chain state only, no prices. Bad input: 400, not charged. Example: ?address=0x6246eee0355Dd7A93C888fE59e1151388A0cC5a1

## Output

Returns a JSON object with chain metadata (chain name, chainId, block number, block timestamp), ETH balance in wei and decimal, per-token entries with symbol, decimals, raw and decimal balance, address contract/EOA status with code size, transaction count (nonce), and the RPC source used. Tokens not found or not ERC-20 compliant are flagged with a status field.

## 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": [
      "address"
     ],
     "properties": {
      "tokens": {
       "type": "string",
       "examples": [
        "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913,0x4200000000000000000000000000000000000006"
       ],
       "maxLength": 900,
       "description": "Up to 20 comma-separated ERC-20 contract addresses on Base. Omit for the default set. A contract that is not an ERC-20 is listed with status not_an_erc20."
      },
      "address": {
       "type": "string",
       "pattern": "^0x[0-9a-fA-F]{40}$",
       "examples": [
        "0x6246eee0355Dd7A93C888fE59e1151388A0cC5a1"
       ],
       "description": "Wallet or contract on Base mainnet (0x + 40 hex; mixed case must be a valid EIP-55 checksum). Bad input → 400 (not charged)"
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "chain",
      "chainId",
      "address",
      "block",
      "isContract",
      "codeSize",
      "transactionCount",
      "eth",
      "tokenSet",
      "tokens",
      "nonZeroTokens",
      "rpc",
      "note"
     ],
     "properties": {
      "eth": {
       "type": "object",
       "properties": {
        "wei": {
         "type": "string"
        },
        "balance": {
         "type": "number"
        }
       }
      },
      "rpc": {
       "type": "object",
       "properties": {
        "kind": {
         "type": "string"
        },
        "source": {
         "type": "string"
        }
       }
      },
      "note": {
       "type": "string"
      },
      "block": {
       "type": "object",
       "properties": {
        "number": {
         "type": "integer"
        },
        "timestamp": {
         "type": "string"
        }
       }
      },
      "chain": {
       "type": "string"
      },
      "tokens": {
       "type": "array",
       "items": {
        "type": "object",
      
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/1gateway-base-onchain-balances-4c4fea8c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 1gateway.dev](https://www.zero.xyz/host/1gateway.dev/llms.txt)
