81trust / 100

Tools Gas

by x402 tools in Onchain & crypto

x402 APIPassing, checked 3 h ago

Use before sending an EVM transaction to pick the cheapest chain and set its fees. Live gas on Ethereum, Base, Arbitrum, Optimism, Polygon and BSC: slow/standard/fast EIP-1559 fee tiers (priority fee, maxFee) from recent blocks, plus the USD cost of a transfer, ERC-20 transfer and swap per tier, cheapest chain first.

GET https://x402-tools-production-2755.up.railway.app/tools/gas

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
178 ms typical, 178 ms slowest 5%
Last check
3 h ago
Next check
any minute now

How to call it

# See the payment challenge (nothing is charged)
curl -i -X GET "https://x402-tools-production-2755.up.railway.app/tools/gas?chains=base%2Cethereum"
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fx402-tools-production-2755.up.railway.app%2Ftools%2Fgas
const res = await pay("https://x402-tools-production-2755.up.railway.app/tools/gas?chains=base%2Cethereum");
console.log(await res.json());

Example input

{
  "chains": "base,ethereum"
}

Example output

{
  "chains": [
    {
      "baseFeeGwei": 0.005,
      "chain": "base",
      "chainId": 8453,
      "costs": {
        "erc20Transfer": {
          "native": 3.9e-7,
          "usd": 0.00107
        },
        "swap": {
          "native": 9e-7,
          "usd": 0.0025
        },
        "transfer": {
          "native": 1.26e-7,
          "usd": 0.00035
        }
      },
      "gasPriceGwei": 0.006,
      "nativeSymbol": "ETH",
      "nativeUsd": 2734.49,
      "tiers": {
        "fast": {
          "costs": {
            "transfer": {
              "native": 5.6e-7,
              "usd": 0.00152
            }
          },
          "effectiveGwei": 0.0266,
          "maxFeeGwei": 0.0316,
          "priorityFeeGwei": 0.0216
        },
        "slow": {
          "costs": {
            "transfer": {
              "native": 1.05e-7,
              "usd": 0.00029
            }
          },
          "effectiveGwei": 0.005,
          "maxFeeGwei": 0.01,
          "priorityFeeGwei": 0
        },
        "standard": {
          "costs": {
            "transfer": {
              "native": 1.26e-7,
              "usd": 0.00035
            }
          },
          "effectiveGwei": 0.006,
          "maxFeeGwei": 0.011,
          "priorityFeeGwei": 0.001
        }
      }
    }
  ],
  "gasUsed": {
    "erc20Transfer": 65000,
    "swap": 150000,
    "transfer": 21000
  }
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
3 h agoPassed402333 ms$0.002
8 h agoPassed402178 ms$0.002