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
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:
- Parsed and validated at the edge.
- Dispatched to a pool of healthy upstream RPCs (3+ per chain) with automatic failover.
- Normalized into a stable L4 response shape.
- Metered against your account.
Responses include an x-mc-cache header when served from cache and x-mc-upstream identifying which RPC answered.
Chains #
curl https://metercall.ai/v1/l4/chains \
-H "Authorization: Bearer $MC_KEY"[
{ "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 }
]curl https://metercall.ai/v1/l4/chains/base{
"slug":"base","name":"Base","tier":"L2","evm":true,
"healthy":true,"latest_block":20435192,
"gas":{"gwei":0.03},"tvl":4100000000
}Balance #
curl https://metercall.ai/v1/l4/ethereum/balance/0xd8dA…6045{
"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 #
curl https://metercall.ai/v1/l4/ethereum/tx/0xabc…{
"chain":"ethereum","hash":"0xabc…",
"from":"0x…","to":"0x…","value_wei":"123000000000000000",
"block":20435192,"status":"success","gas_used":21000
}Blocks #
curl https://metercall.ai/v1/l4/arbitrum/block/latest{ "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 #
gwei; others return their native unit.curl https://metercall.ai/v1/l4/base/gas{ "chain":"base","gwei":0.032,"updated_at":1744860000 }Prices #
curl https://metercall.ai/v1/l4/price/ETH{ "symbol":"ETH","usd":3089.12,"change_24h":-1.2 }curl "https://metercall.ai/v1/l4/prices?symbols=ETH,BTC,SOL"{ "ETH":{"usd":3089.12}, "BTC":{"usd":67210.44}, "SOL":{"usd":160.22} }cross/balance #
curl https://metercall.ai/v1/l4/cross/balance/0xd8dA…6045{
"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 #
curl -X POST https://metercall.ai/v1/l4/cross/query \
-H "Content-Type: application/json" \
-d '{"endpoint":"gas","chains":["ethereum","arbitrum","base","optimism"]}'[
{"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 #
curl -X POST https://metercall.ai/v1/l4/dex/quote \
-H "Content-Type: application/json" \
-d '{"chain":"ethereum","in":"USDC","out":"ETH","amount":1000}'{
"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 #
curl https://metercall.ai/v1/l4/protocol/tvl/aave{ "protocol":"aave","tvl":16100000000,"change_1d":-0.3,"chains":["ethereum","polygon","arbitrum","optimism","base","avalanche"] }limit up to 500.curl "https://metercall.ai/v1/l4/protocols/top?limit=20"[
{ "name":"Lido","category":"Liquid Staking","tvl":32400000000,"change_1d":0.8 },
{ "name":"EigenLayer","category":"Restaking","tvl":18200000000,"change_1d":1.2 }
]curl https://metercall.ai/v1/l4/chains/tvl[
{"chain":"ethereum","tvl":62000000000},
{"chain":"solana", "tvl":8200000000},
{"chain":"arbitrum","tvl":5100000000}
]NFT #
curl https://metercall.ai/v1/l4/ethereum/nft/0xBC4C…f13D/1{
"chain":"ethereum","contract":"0xBC4C…f13D","token_id":"1",
"name":"BAYC #1","image":"ipfs://…","traits":[…],
"last_sale_usd":64200,"floor_usd":58900
}ENS #
curl https://metercall.ai/v1/l4/ens/vitalik.eth{
"name":"vitalik.eth",
"addresses":{"ethereum":"0xd8dA…6045","optimism":"0xd8dA…6045","arbitrum":"0xd8dA…6045"},
"avatar":"https://…","text":{"twitter":"VitalikButerin"}
}Usage #
curl https://metercall.ai/api/l4/usage \
-H "Authorization: Bearer $MC_KEY"{ "calls_30d":48213,"chains_touched":17,"avg_latency_ms":42,"spend_30d_usd":12.04 }Recent calls #
curl https://metercall.ai/api/l4/recent \
-H "Authorization: Bearer $MC_KEY"[
{ "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" }
400— bad params401— missing/invalid key402— payment required (Agent Pay flow)404— unknown chain / address not found429— rate limit502— all upstream RPCs failed (we'll retry first)
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"))