{"openapi":"3.1.0","info":{"title":"ChainRead","version":"1.0.0","contact":{"name":"ChainRead","url":"https://github.com/Imac2014Ville/baselens"},"description":"Cheap EVM read utilities for AI agents on Base and Ethereum mainnet: gas and fees, blocks, balances, ERC-20 metadata, contract inspection, transaction status, ENS/Basename resolution, bulk balances. No API key: pay USDC on Base per call via x402.","x-guidance":"Pay-per-call USDC on Base via x402, no API key. All tools take chain (base default, or ethereum). POST /gas {chain} ($0.001): gas price, priority fee, and what a transfer/swap costs in USD. POST /block {chain, number?} ($0.001): latest or specific block. POST /balance {chain, address, tokens?[]} ($0.002): ETH + ERC-20 balances. POST /erc20 {chain, token} ($0.002): name, symbol, decimals, supply, owner, proxy. POST /contract {chain, address} ($0.002): contract vs wallet, proxy, EIP-7702, selectors. POST /tx-status {chain, hash} ($0.001): status, confirmations, fee. POST /resolve {name} ($0.002): ENS .eth or Basename .base.eth to address. POST /multicall-balances {chain, addresses[]<=20, token?} ($0.005): bulk balances. GET with query params also works. Malformed input returns 400 and failed lookups return non-2xx, so you are not charged."},"servers":[{"url":"https://chainread.imac2014ville.workers.dev"}],"paths":{"/gas":{"get":{"operationId":"gasGet","summary":"Gas price and transaction cost in USD (Base, Ethereum)","description":"Current gas price and fee suggestion on Base or Ethereum: base fee, priority fee (low/standard/fast), max fee to set, and what an ETH transfer, ERC-20 transfer and DEX swap cost right now in gwei, ETH and USD (Chainlink ETH/USD). Know what a transaction costs before you send it.","tags":["gas","gas-price","fees","base","ethereum"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.001"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true,"chain":"base","baseFeeGwei":0.0053,"priorityFeeGwei":{"low":0.001,"standard":0.0012,"fast":0.002},"ethUsd":2450.3,"estimates":{"ethTransfer":{"gasUnits":21000,"costEth":1.2e-7,"costUsd":0.0003}}}}}},"402":{"description":"Payment Required"}},"parameters":[{"name":"chain","in":"query","required":false,"schema":{"type":"string","enum":["base","ethereum"],"description":"Chain to read (default base)"},"description":"Chain to read (default base)"}]},"post":{"operationId":"gasPost","summary":"Gas price and transaction cost in USD (Base, Ethereum)","description":"Current gas price and fee suggestion on Base or Ethereum: base fee, priority fee (low/standard/fast), max fee to set, and what an ETH transfer, ERC-20 transfer and DEX swap cost right now in gwei, ETH and USD (Chainlink ETH/USD). Know what a transaction costs before you send it.","tags":["gas","gas-price","fees","base","ethereum"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.001"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true,"chain":"base","baseFeeGwei":0.0053,"priorityFeeGwei":{"low":0.001,"standard":0.0012,"fast":0.002},"ethUsd":2450.3,"estimates":{"ethTransfer":{"gasUnits":21000,"costEth":1.2e-7,"costUsd":0.0003}}}}}},"402":{"description":"Payment Required"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"chain":{"type":"string","enum":["base","ethereum"],"description":"Chain to read (default base)"}}}}}}}},"/block":{"get":{"operationId":"blockGet","summary":"Latest or specific block (Base, Ethereum)","description":"Latest block or any block by number on Base or Ethereum: hash, timestamp, age in seconds, transaction count, gas used and utilization, base fee. Cheap chain-head and block lookup for agents.","tags":["block","rpc","base","ethereum"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.001"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true,"chain":"base","number":41000000,"hash":"0xabc…","ageSeconds":1,"txCount":118,"gasUtilizationPct":22.4,"baseFeeGwei":0.0053}}}},"402":{"description":"Payment Required"}},"parameters":[{"name":"chain","in":"query","required":false,"schema":{"type":"string","enum":["base","ethereum"],"description":"Chain to read (default base)"},"description":"Chain to read (default base)"},{"name":"number","in":"query","required":false,"schema":{"type":"string","description":"Block number (decimal or 0x hex) or latest (default latest)"},"description":"Block number (decimal or 0x hex) or latest (default latest)"}]},"post":{"operationId":"blockPost","summary":"Latest or specific block (Base, Ethereum)","description":"Latest block or any block by number on Base or Ethereum: hash, timestamp, age in seconds, transaction count, gas used and utilization, base fee. Cheap chain-head and block lookup for agents.","tags":["block","rpc","base","ethereum"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.001"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true,"chain":"base","number":41000000,"hash":"0xabc…","ageSeconds":1,"txCount":118,"gasUtilizationPct":22.4,"baseFeeGwei":0.0053}}}},"402":{"description":"Payment Required"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"chain":{"type":"string","enum":["base","ethereum"],"description":"Chain to read (default base)"},"number":{"type":"string","description":"Block number (decimal or 0x hex) or latest (default latest)"}}}}}}}},"/balance":{"get":{"operationId":"balanceGet","summary":"ETH + ERC-20 wallet balances","description":"Wallet balance check on Base or Ethereum: native ETH (with USD value) plus ERC-20 token balances with symbol and decimals already applied. Pass your own token list or get the common ones (USDC, WETH, ...).","tags":["balance","wallet","erc20","base","ethereum"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.002"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true,"chain":"base","address":"0x4200000000000000000000000000000000000006","native":{"balance":"1523.4","usd":3732000},"tokens":[{"symbol":"USDC","decimals":6,"balance":"5120.33"}]}}}},"402":{"description":"Payment Required"}},"parameters":[{"name":"chain","in":"query","required":false,"schema":{"type":"string","enum":["base","ethereum"],"description":"Chain to read (default base)"},"description":"Chain to read (default base)"},{"name":"address","in":"query","required":true,"schema":{"type":"string","description":"Wallet or contract address (0x…)"},"description":"Wallet or contract address (0x…)"},{"name":"tokens","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"description":"ERC-20 addresses, max 20 (GET: comma-separated; default: common tokens)"},"description":"ERC-20 addresses, max 20 (GET: comma-separated; default: common tokens)"}]},"post":{"operationId":"balancePost","summary":"ETH + ERC-20 wallet balances","description":"Wallet balance check on Base or Ethereum: native ETH (with USD value) plus ERC-20 token balances with symbol and decimals already applied. Pass your own token list or get the common ones (USDC, WETH, ...).","tags":["balance","wallet","erc20","base","ethereum"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.002"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true,"chain":"base","address":"0x4200000000000000000000000000000000000006","native":{"balance":"1523.4","usd":3732000},"tokens":[{"symbol":"USDC","decimals":6,"balance":"5120.33"}]}}}},"402":{"description":"Payment Required"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"chain":{"type":"string","enum":["base","ethereum"],"description":"Chain to read (default base)"},"address":{"type":"string","description":"Wallet or contract address (0x…)"},"tokens":{"type":"array","items":{"type":"string"},"description":"ERC-20 addresses, max 20 (GET: comma-separated; default: common tokens)"}},"required":["address"]}}}}}},"/erc20":{"get":{"operationId":"erc20Get","summary":"ERC-20 token metadata, owner, proxy","description":"ERC-20 token metadata on Base or Ethereum in one call: name, symbol, decimals, total supply, owner (and whether ownership is renounced), and proxy/upgradeable implementation address.","tags":["erc20","token","metadata","base","ethereum"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.002"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true,"chain":"base","token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","name":"USD Coin","symbol":"USDC","decimals":6,"totalSupply":"4100000000","isProxy":true,"proxyKind":"EIP-1967","implementation":"0x2ce6311ddae708829bc0784c967b7d77d19fd779"}}}},"402":{"description":"Payment Required"}},"parameters":[{"name":"chain","in":"query","required":false,"schema":{"type":"string","enum":["base","ethereum"],"description":"Chain to read (default base)"},"description":"Chain to read (default base)"},{"name":"token","in":"query","required":true,"schema":{"type":"string","description":"ERC-20 contract address (0x…)"},"description":"ERC-20 contract address (0x…)"}]},"post":{"operationId":"erc20Post","summary":"ERC-20 token metadata, owner, proxy","description":"ERC-20 token metadata on Base or Ethereum in one call: name, symbol, decimals, total supply, owner (and whether ownership is renounced), and proxy/upgradeable implementation address.","tags":["erc20","token","metadata","base","ethereum"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.002"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true,"chain":"base","token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","name":"USD Coin","symbol":"USDC","decimals":6,"totalSupply":"4100000000","isProxy":true,"proxyKind":"EIP-1967","implementation":"0x2ce6311ddae708829bc0784c967b7d77d19fd779"}}}},"402":{"description":"Payment Required"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"chain":{"type":"string","enum":["base","ethereum"],"description":"Chain to read (default base)"},"token":{"type":"string","description":"ERC-20 contract address (0x…)"}},"required":["token"]}}}}}},"/contract":{"get":{"operationId":"contractGet","summary":"Contract vs wallet, proxy, EIP-7702, selectors","description":"Inspect any address on Base or Ethereum: is it a contract or a wallet, code size, proxy detection (EIP-1967, beacon, EIP-1167), EIP-7702 delegation detection, and which well-known function selectors it implements (ERC-20/721/1155, ownable, mintable, pausable, upgradeable, multicall).","tags":["contract","proxy","eip-7702","base","ethereum"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.002"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true,"chain":"base","address":"0x4200000000000000000000000000000000000006","isContract":true,"codeSize":2200,"isProxy":false,"traits":["erc20-like"],"selectorsOfInterest":[{"selector":"0xa9059cbb","signature":"transfer(address,uint256)"}]}}}},"402":{"description":"Payment Required"}},"parameters":[{"name":"chain","in":"query","required":false,"schema":{"type":"string","enum":["base","ethereum"],"description":"Chain to read (default base)"},"description":"Chain to read (default base)"},{"name":"address","in":"query","required":true,"schema":{"type":"string","description":"Address to inspect (0x…)"},"description":"Address to inspect (0x…)"}]},"post":{"operationId":"contractPost","summary":"Contract vs wallet, proxy, EIP-7702, selectors","description":"Inspect any address on Base or Ethereum: is it a contract or a wallet, code size, proxy detection (EIP-1967, beacon, EIP-1167), EIP-7702 delegation detection, and which well-known function selectors it implements (ERC-20/721/1155, ownable, mintable, pausable, upgradeable, multicall).","tags":["contract","proxy","eip-7702","base","ethereum"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.002"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true,"chain":"base","address":"0x4200000000000000000000000000000000000006","isContract":true,"codeSize":2200,"isProxy":false,"traits":["erc20-like"],"selectorsOfInterest":[{"selector":"0xa9059cbb","signature":"transfer(address,uint256)"}]}}}},"402":{"description":"Payment Required"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"chain":{"type":"string","enum":["base","ethereum"],"description":"Chain to read (default base)"},"address":{"type":"string","description":"Address to inspect (0x…)"}},"required":["address"]}}}}}},"/tx-status":{"get":{"operationId":"txStatusGet","summary":"Transaction status, confirmations, fee","description":"Transaction status lookup on Base or Ethereum: pending, success or failed, confirmations, block, from/to, gas used and the fee paid in ETH and USD (including Base L1 data fee).","tags":["transaction","receipt","base","ethereum"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.001"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true,"chain":"base","status":"success","confirmations":12,"gasUsed":51234,"feeEth":0.0000021,"feeUsd":0.005}}}},"402":{"description":"Payment Required"}},"parameters":[{"name":"chain","in":"query","required":false,"schema":{"type":"string","enum":["base","ethereum"],"description":"Chain to read (default base)"},"description":"Chain to read (default base)"},{"name":"hash","in":"query","required":true,"schema":{"type":"string","description":"Transaction hash (0x + 64 hex)"},"description":"Transaction hash (0x + 64 hex)"}]},"post":{"operationId":"txStatusPost","summary":"Transaction status, confirmations, fee","description":"Transaction status lookup on Base or Ethereum: pending, success or failed, confirmations, block, from/to, gas used and the fee paid in ETH and USD (including Base L1 data fee).","tags":["transaction","receipt","base","ethereum"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.001"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true,"chain":"base","status":"success","confirmations":12,"gasUsed":51234,"feeEth":0.0000021,"feeUsd":0.005}}}},"402":{"description":"Payment Required"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"chain":{"type":"string","enum":["base","ethereum"],"description":"Chain to read (default base)"},"hash":{"type":"string","description":"Transaction hash (0x + 64 hex)"}},"required":["hash"]}}}}}},"/resolve":{"get":{"operationId":"resolveGet","summary":"ENS and Basename to address","description":"Resolve an ENS name (.eth, on Ethereum) or a Basename (.base.eth, on Base) to its wallet address through the on-chain registry and resolver. Returns the resolver used.","tags":["ens","basename","resolve","base","ethereum"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.002"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true,"name":"jesse.base.eth","address":"0x849151d7D0bF1F34b70d5caD5149D28CC2308bf1","resolvedOn":"base"}}}},"402":{"description":"Payment Required"}},"parameters":[{"name":"name","in":"query","required":true,"schema":{"type":"string","description":"ENS name or Basename, e.g. vitalik.eth or jesse.base.eth"},"description":"ENS name or Basename, e.g. vitalik.eth or jesse.base.eth"}]},"post":{"operationId":"resolvePost","summary":"ENS and Basename to address","description":"Resolve an ENS name (.eth, on Ethereum) or a Basename (.base.eth, on Base) to its wallet address through the on-chain registry and resolver. Returns the resolver used.","tags":["ens","basename","resolve","base","ethereum"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.002"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true,"name":"jesse.base.eth","address":"0x849151d7D0bF1F34b70d5caD5149D28CC2308bf1","resolvedOn":"base"}}}},"402":{"description":"Payment Required"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"ENS name or Basename, e.g. vitalik.eth or jesse.base.eth"}},"required":["name"]}}}}}},"/multicall-balances":{"get":{"operationId":"multicallBalancesGet","summary":"Bulk balances for up to 20 addresses","description":"Bulk balance check for up to 20 addresses on Base or Ethereum in a single Multicall3 call: native ETH, or one ERC-20 token for all addresses. Returns per-address balances and the total.","tags":["multicall","balances","bulk","base","ethereum"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true,"chain":"base","asset":{"symbol":"USDC","decimals":6},"count":2,"total":"1234.5","balances":[{"address":"0x4200000000000000000000000000000000000006","balance":"1000"}]}}}},"402":{"description":"Payment Required"}},"parameters":[{"name":"chain","in":"query","required":false,"schema":{"type":"string","enum":["base","ethereum"],"description":"Chain to read (default base)"},"description":"Chain to read (default base)"},{"name":"addresses","in":"query","required":true,"schema":{"type":"array","items":{"type":"string"},"description":"1-20 addresses (GET: comma-separated)"},"description":"1-20 addresses (GET: comma-separated)"},{"name":"token","in":"query","required":false,"schema":{"type":"string","description":"Optional ERC-20 address; omit for native ETH"},"description":"Optional ERC-20 address; omit for native ETH"}]},"post":{"operationId":"multicallBalancesPost","summary":"Bulk balances for up to 20 addresses","description":"Bulk balance check for up to 20 addresses on Base or Ethereum in a single Multicall3 call: native ETH, or one ERC-20 token for all addresses. Returns per-address balances and the total.","tags":["multicall","balances","bulk","base","ethereum"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true,"chain":"base","asset":{"symbol":"USDC","decimals":6},"count":2,"total":"1234.5","balances":[{"address":"0x4200000000000000000000000000000000000006","balance":"1000"}]}}}},"402":{"description":"Payment Required"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"chain":{"type":"string","enum":["base","ethereum"],"description":"Chain to read (default base)"},"addresses":{"type":"array","items":{"type":"string"},"description":"1-20 addresses (GET: comma-separated)"},"token":{"type":"string","description":"Optional ERC-20 address; omit for native ETH"}},"required":["addresses"]}}}}}}},"x-discovery":{"ownershipProofs":["0xacf53d18bee5738e940dfcb7a53cfb6253553b15faa2467b9171742a3f1dd18e63bc561c2e045bb6e8d2739749eed17a58d5e9dfdf185638e4e5223a65073d431c"]}}