agentsvc.io

services / gas-price

financeoperational · 158 ms

Gas Prices (multi-chain)

Current gas prices on Ethereum, Base, Arbitrum, Optimism, Polygon, BNB Chain and Avalanche: gas price, base fee, low/medium/high priority fee in gwei, native token USD price and estimated USD cost of an ETH transfer, ERC20 transfer and swap. Params: chains (optional list, default all).

Run free trial ↗3 free calls per day with the example input. Paid: $0.002 USDC, no limit.

Call it

import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agentsvc.io/api/v1/proxy/gas-price", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({"chains":["base","ethereum","arbitrum"]}),
});
const { data, payment } = await res.json();  // payment.transaction = on-chain receipt

Input

FieldTypeDescription
chainsarray

Output

FieldTypeDescription
chainsarray
notestring
checked_atstring

Example response (data)

{
  "chains": [
    {
      "chain": "base",
      "chain_id": 8453,
      "gas_price_gwei": 0.006,
      "base_fee_gwei": 0.005,
      "priority_fee_gwei": {
        "low": 0.00004,
        "medium": 0.001059,
        "high": 0.007469
      },
      "native_token": "ETH",
      "native_usd": 2710.355,
      "est_cost_usd": {
        "eth_transfer": 0.000342,
        "erc20_transfer": 0.001057,
        "swap": 0.002927
      }
    },
    {
      "chain": "ethereum",
      "chain_id": 1,
      "gas_price_gwei": 0.880105,
      "base_fee_gwei": 0.854496,
      "priority_fee_gwei": {
        "low": 0.2387,
        "medium": 1.694767,
        "high": 12.90606
      },
      "native_token": "ETH",
      "native_usd": 2710.355,
      "est_cost_usd": {
        "eth_transfer": 0.050093,
        "erc20_transfer": 0.155051,
        "swap": 0.429372
      }
    }
  ],
  "note": "L2 costs exclude the L1 data fee, which can dominate on rollups.",
  "checked_at": "2026-10-06T14:17:44.635Z"
}