Gas price

$0.001 per call · USDC via x402 · GET /api/gas-estimate · Cached 30s

Current gas price on Base, Polygon, Arbitrum, Optimism, Ethereum, Monad, Celo, Avalanche, Sei, or Robinhood Chain - for an agent budgeting a transaction: returns network, gasPriceGwei and gasPriceWei (decimal strings) from the chain's own eth_gasPrice, the node's suggested all-in price per gas unit. Send GET /api/gas-estimate with no required fields (1 optional) and pay $0.001 per call over x402 or MPP (there is no free tier). It returns a JSON object with network, gasPriceGwei and gasPriceWei.

Multiply by the gas a transaction uses (21000 for a plain transfer) for its fee. Read-only. ?network=base

Category: Payments & x402 · Tags: gas gas-price fees gwei multichain robinhood usdg · Also found as: estimate-gas eth_estimategas

TRY IN PLAYGROUND →

Parameters

NameTypeRequiredDescription
networkstringnochain: base | polygon | arbitrum | optimism | ethereum | monad | celo | avalanche | sei | robinhood (default base)

Example request

curl -i "https://agent402.tools/api/gas-estimate?network=base"

Without payment this returns HTTP 402 Payment Required with the exact price for gas-estimate; any x402 v2 or MPP client pays it and retries.

Example response

{
  "network": "base",
  "gasPriceGwei": "0.0051",
  "gasPriceWei": "5100000"
}
FieldTypeAlways presentIn the example
networkstringyesbase
gasPriceGweistringyes0.0051
gasPriceWeistringyes5100000

From an MCP client

catalog.call {
  "slug": "gas-estimate",
  "params": {
    "network": "base"
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for gas-estimate; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.

Errors and behavior

Paid call (JavaScript agent)

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

const client = new x402Client();
client.setSpendControls?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/gas-estimate?network=base");

Part of these workflows

Gas price is one step in these 3 skill packs, each sold as a single call:

Related tools

Transaction status

$0.001 · GET /api/tx-status

Check the confirmation status of a transaction by hash on Base/Polygon/Arbitrum/Optimism/Ethereum/Monad/Celo/Avalanche/S…

Build USDC transfer authorization

$0.003 · POST /api/transfer-authorization

Build the EIP-3009 transferWithAuthorization typed data for a gasless USDC transfer on Base/Polygon/Arbitrum/Optimism/Et…

USDC balance

$0.003 · GET /api/usdc-balance

Read the USDC balance of any address on Base, Polygon, Arbitrum, Optimism, Ethereum, Monad, Celo, Avalanche, or Sei. Rea…

Verify x402 settlement

$0.004 · GET /api/x402-verify

Confirm a USDC payment actually settled: given a tx hash (and network), returns whether it succeeded and the USDC transf…

Gas snapshot (slow / standard / fast)

$0.005 · POST /api/gas-snapshot

Live gas price snapshot for a chain - slow / standard / fast tiers in gwei, plus the latest base fee. Sampled from eth_f…

B20 activation check

$0.002 · GET /api/b20-activation-check

Is B20 live on Base mainnet? Queries the Activation Registry precompile for base.b20_asset and base.b20_stablecoin (or a…