Optimism ERC-20 balance
Read one wallet's balance of one ERC-20 token on Optimism: raw amount, decimals, symbol and the human-readable amount, live from the token contract. Use to check stablecoin or token holdings before a transfer or trade; for the native coin use op_balance. Both inputs are 0x addresses (40 hex characters); no contract returns 404 and a non-ERC-20 contract 422, both uncharged.
Inputs
| Name | Type | Description |
|---|---|---|
token (required) | string | 0x ERC-20 token contract address |
address (required) | string | 0x wallet address |
Request
Over HTTP, with a card key from /credits:
curl -H "Authorization: Bearer adt_…" "https://agent-data-tools.revmesh2074.workers.dev/op/token-balance?token=0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85&address=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
Or one of your 25 free calls, no key:
curl "https://agent-data-tools.revmesh2074.workers.dev/op/token-balance?token=0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85&address=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&trial=1"
Without a key, the same URL answers 402 Payment Required with x402 and MPP terms, so an agent with a wallet pays per call in USDC (Base, Polygon, Arbitrum, Monad, World Chain or Tempo) and retries.
Example result
{
"chain": "Optimism",
"chainId": 10,
"token": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
"symbol": "USDC",
"decimals": 6,
"address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"raw": "2500000",
"balance": "2.5"
}
From an AI agent (MCP)
Add the MCP server to Claude, Cursor or any MCP client. This tool is op_token_balance, and the first 25 successful calls are free:
https://agent-data-tools.revmesh2074.workers.dev/mcp