agent402.tools/api/l2-gas-comparison
Current gas snapshot across Ethereum + supported L2s (Base, Polygon, Arbitrum, Optimism), sorted cheapest-first. Returns gas price in gwei, latest block number, chain id, and an isL2 flag per chain. Use to route a transaction to the cheapest viable L2 or to track L1→L2 gas spread.
POST
https://agent402.tools/api/l2-gas-comparisonUptime100% of 4 checks in 30 days
30 days agoToday
Try it
Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.
The response shows up here.
Call it from an agent
// npm install fourohtwo
import { createPayer } from "fourohtwo";
// One agent key pays USDC on Base or USDG on Robinhood Chain, inside your spending rules.
const pay = createPayer({ privateKey: process.env.AGENT_KEY, maxPerCallUsd: "0.05" });
const res = await pay("https://agent402.tools/api/l2-gas-comparison", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({"networks":["ethereum","base","arbitrum","optimism","polygon"]}),
});
console.log(await res.json());Example input
{
"networks": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon"
]
}