# Onchain Balance Lookup (Base & Ethereum)

> Onchain Balance Lookup (Base & Ethereum) is a paid API for AI agents from onchain.x402utils.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-02).

Returns live ETH and USDC balances for a given wallet address on Base or Ethereum, along with the current block number.

## Facts

- Endpoint: GET https://onchain.x402utils.workers.dev/v1/balance?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/onchain-balance-lookup-base-ethereum-1f211a6d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_P_Qpbi7tSoBXy4oDWV-Jh

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 onchain-balance-lookup-base-ethereum-1f211a6d
```

Example prompt: What's the current ETH and USDC balance for wallet 0xdB6381Df2D754965804547940Bc852D9a1bc612f on Base?

## When to prefer this

Use this endpoint when an AI agent needs a lightweight, pay-per-call read of live ETH or USDC balances on Base or Ethereum without setting up a full RPC node or indexer. Ideal for micro-transaction workflows, balance checks before payments, or treasury monitoring where cost predictability ($0.001/call) matters.

## Known failure modes

- Invalid or malformed address (missing 0x prefix or wrong length) returns an error
- Unsupported chain value other than 'base' or 'ethereum' may return an error or default to base
- Missing required 'address' query parameter results in a validation error
- Payment failure via x402 protocol if USDC on Base is insufficient
- Network timeouts or RPC node unavailability causing delayed or failed reads

## How this service works

Live Base and Ethereum reads for AI agents: balances (ETH + USDC), gas, transaction status, ERC-20 metadata. $0.001 per call via x402 (USDC on Base).

## Output

A JSON object containing the ETH balance, USDC balance, current block number, chain name, and the queried address — all reflecting the live on-chain state at the time of the call.

## 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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "address"
     ],
     "properties": {
      "chain": {
       "enum": [
        "base",
        "ethereum"
       ],
       "type": "string",
       "description": "base (default) or ethereum"
      },
      "address": {
       "type": "string",
       "description": "0x-prefixed 20-byte address"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "eth": "0.0",
  "usdc": "0.0",
  "block": 39000000,
  "chain": "base",
  "address": "0xdB6381Df2D754965804547940Bc852D9a1bc612f"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/onchain-balance-lookup-base-ethereum-1f211a6d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from onchain.x402utils.workers.dev](https://www.zero.xyz/host/onchain.x402utils.workers.dev/llms.txt)
