MeterCall L4 Get started

Layer 4 (L4) API

MeterCall L4 is the aggregation layer on top of every chain. One API, one key, 30+ chains, 500+ protocols. Your agent hits one URL; we route to the right chain and protocol. You pay per call.

Overview #

Every L4 endpoint lives under /v1/l4/*. Account endpoints live under /api/l4/*. All responses are JSON. All chain-scoped endpoints take a :chain path segment (see Chains).

Base URL: https://metercall.ai

Zero-Claude-cost architecture L4 runs server-side — pure Go/Rust RPC fan-out, not Claude. There is no LLM tax per call. That's why it's cheap enough to meter at the individual-call level. Use L4 for the data. Use MeterCall core when you want reasoning on top.

Authentication #

Pass your key as a Bearer token:

GET /v1/l4/chains
Authorization: Bearer mc_live_xxx

Get a key at /keys. Agents can pay per call with no key via x402 (Agent Pay).

Architecture #

Every call is:

  1. Parsed and validated at the edge.
  2. Dispatched to a pool of healthy upstream RPCs (3+ per chain) with automatic failover.
  3. Normalized into a stable L4 response shape.
  4. Metered against your account.

Responses include an x-mc-cache header when served from cache and x-mc-upstream identifying which RPC answered.

Chains #

GET/v1/l4/chains
List every chain L4 supports, with tier (L1/L2/L3), EVM flag, and a health indicator.
request
curl https://metercall.ai/v1/l4/chains \
  -H "Authorization: Bearer $MC_KEY"
response
[
  { "slug":"ethereum","name":"Ethereum","tier":"L1","evm":true,"healthy":true },
  { "slug":"arbitrum","name":"Arbitrum","tier":"L2","evm":true,"healthy":true },
  { "slug":"solana","  name":"Solana","  tier":"L1","evm":false,"healthy":true }
]
GET/v1/l4/chains/:chain
Single chain's metadata + live RPC health, latest block, gas, and total TVL on the chain.
request
curl https://metercall.ai/v1/l4/chains/base
response
{
  "slug":"base","name":"Base","tier":"L2","evm":true,
  "healthy":true,"latest_block":20435192,
  "gas":{"gwei":0.03},"tvl":4100000000
}

Balance #

GET/v1/l4/:chain/balance/:address
Native + top token balances for an address on one chain.
request
curl https://metercall.ai/v1/l4/ethereum/balance/0xd8dA…6045
response
{
  "chain":"ethereum",
  "address":"0xd8dA…6045",
  "native":{"symbol":"ETH","amount":1246.31,"usd_value":3850000},
  "tokens":[
    {"symbol":"USDC","amount":18400,"usd_value":18400},
    {"symbol":"WBTC","amount":0.8,"usd_value":57000}
  ]
}

Transactions #

GET/v1/l4/:chain/tx/:hash
Fetch a single transaction. Returns a normalized shape across EVM and non-EVM chains.
request
curl https://metercall.ai/v1/l4/ethereum/tx/0xabc…
response
{
  "chain":"ethereum","hash":"0xabc…",
  "from":"0x…","to":"0x…","value_wei":"123000000000000000",
  "block":20435192,"status":"success","gas_used":21000
}

Blocks #

GET/v1/l4/:chain/block/latest
Latest finalized block for any chain.
request
curl https://metercall.ai/v1/l4/arbitrum/block/latest
response
{ "chain":"arbitrum","number":286431004,"hash":"0x…","timestamp":1744860000 }

Contracts & events #

L4 exposes contract reads through the per-chain cross/query fan-out (see below) with an endpoint:"contract/read" or endpoint:"logs" shape. Full dedicated routes ship next release.

Gas #

GET/v1/l4/:chain/gas
Current gas price for a chain. EVM chains return gwei; others return their native unit.
request
curl https://metercall.ai/v1/l4/base/gas
response
{ "chain":"base","gwei":0.032,"updated_at":1744860000 }

Prices #

GET/v1/l4/price/:symbol
Spot price for a token, via CoinGecko passthrough. Cached ~5s.
request
curl https://metercall.ai/v1/l4/price/ETH
response
{ "symbol":"ETH","usd":3089.12,"change_24h":-1.2 }
GET/v1/l4/prices?symbols=ETH,BTC,SOL
Batch prices. One call, many symbols.
request
curl "https://metercall.ai/v1/l4/prices?symbols=ETH,BTC,SOL"
response
{ "ETH":{"usd":3089.12}, "BTC":{"usd":67210.44}, "SOL":{"usd":160.22} }

cross/balance #

GET/v1/l4/cross/balance/:address
The killer endpoint. One address, every chain, one response.
request
curl https://metercall.ai/v1/l4/cross/balance/0xd8dA…6045
response
{
  "address":"0xd8dA…6045",
  "balances":[
    {"chain":"ethereum","symbol":"ETH","amount":1246.31,"usd_value":3850000},
    {"chain":"arbitrum","symbol":"ETH","amount":18.44,  "usd_value":57000},
    {"chain":"base",    "symbol":"ETH","amount":2.01,   "usd_value":6200},
    {"chain":"solana",  "symbol":"SOL","amount":38.2,   "usd_value":6120}
  ],
  "total_usd":3919320
}

cross/query #

POST/v1/l4/cross/query
Fan out an endpoint across multiple chains in one call.
request
curl -X POST https://metercall.ai/v1/l4/cross/query \
  -H "Content-Type: application/json" \
  -d '{"endpoint":"gas","chains":["ethereum","arbitrum","base","optimism"]}'
response
[
  {"chain":"ethereum","gas":{"gwei":8.1}},
  {"chain":"arbitrum","gas":{"gwei":0.08}},
  {"chain":"base",    "gas":{"gwei":0.03}},
  {"chain":"optimism","gas":{"gwei":0.05}}
]

DEX #

POST/v1/l4/dex/quote
DEX aggregator quote. Returns best route across Uniswap, Curve, Jupiter, etc. on the specified chain.
request
curl -X POST https://metercall.ai/v1/l4/dex/quote \
  -H "Content-Type: application/json" \
  -d '{"chain":"ethereum","in":"USDC","out":"ETH","amount":1000}'
response
{
  "chain":"ethereum","in":"USDC","out":"ETH",
  "in_amount":1000,"out_amount":0.32412,
  "route":["USDC -> ETH via Uniswap V3 0.05%"],
  "price_impact":0.04
}

Protocols & TVL #

GET/v1/l4/protocol/tvl/:protocol
TVL for a single protocol, via DeFiLlama passthrough.
request
curl https://metercall.ai/v1/l4/protocol/tvl/aave
response
{ "protocol":"aave","tvl":16100000000,"change_1d":-0.3,"chains":["ethereum","polygon","arbitrum","optimism","base","avalanche"] }
GET/v1/l4/protocols/top?limit=50
Top protocols by TVL. limit up to 500.
request
curl "https://metercall.ai/v1/l4/protocols/top?limit=20"
response
[
  { "name":"Lido","category":"Liquid Staking","tvl":32400000000,"change_1d":0.8 },
  { "name":"EigenLayer","category":"Restaking","tvl":18200000000,"change_1d":1.2 }
]
GET/v1/l4/chains/tvl
TVL rolled up by chain.
request
curl https://metercall.ai/v1/l4/chains/tvl
response
[
  {"chain":"ethereum","tvl":62000000000},
  {"chain":"solana",  "tvl":8200000000},
  {"chain":"arbitrum","tvl":5100000000}
]

NFT #

GET/v1/l4/:chain/nft/:contract/:id
NFT metadata (name, image, traits, last sale, floor) on any chain.
request
curl https://metercall.ai/v1/l4/ethereum/nft/0xBC4C…f13D/1
response
{
  "chain":"ethereum","contract":"0xBC4C…f13D","token_id":"1",
  "name":"BAYC #1","image":"ipfs://…","traits":[…],
  "last_sale_usd":64200,"floor_usd":58900
}

ENS #

GET/v1/l4/ens/:name
Resolve an ENS name to addresses on every chain that supports it, plus text records and avatar.
request
curl https://metercall.ai/v1/l4/ens/vitalik.eth
response
{
  "name":"vitalik.eth",
  "addresses":{"ethereum":"0xd8dA…6045","optimism":"0xd8dA…6045","arbitrum":"0xd8dA…6045"},
  "avatar":"https://…","text":{"twitter":"VitalikButerin"}
}

Usage #

GET/api/l4/usage
Your account's L4 usage rollup. Requires auth.
request
curl https://metercall.ai/api/l4/usage \
  -H "Authorization: Bearer $MC_KEY"
response
{ "calls_30d":48213,"chains_touched":17,"avg_latency_ms":42,"spend_30d_usd":12.04 }

Recent calls #

GET/api/l4/recent
Last ~100 calls you made. Useful for dashboards.
request
curl https://metercall.ai/api/l4/recent \
  -H "Authorization: Bearer $MC_KEY"
response
[
  { "ts":1744860000123,"chain":"ethereum","endpoint":"/v1/l4/cross/balance/0xd8dA…6045","ms":87,"status":200 }
]

Errors #

Non-2xx responses are JSON:

{ "error":"chain_unsupported", "message":"no RPC pool for chain 'foo'", "hint":"see /v1/l4/chains" }

Rate limits #

Default: 60 rps per key, burst 120. Cross-chain fan-out counts as one billable call; the underlying RPC calls do not count against your per-chain rate. Upgrade at /pricing.

SDKs #

Two tiny, zero-dep SDKs:

// browser
const l4 = new MeterCallL4({ key: "mc_live_..." });
const bal = await l4.crossBalance("0xd8dA…6045");
# python
from l4 import MeterCallL4
l4 = MeterCallL4(key="mc_live_...")
print(l4.cross_balance("0xd8dA…6045"))