x402AgentTools

⛽Live Gas Price

Fetch the live gas price from public RPC nodes on Base or Ethereum: wei per unit gas, converted to gwei, with a USD estimate for a standard 21,000-gas transfer using your own ETH price input. No API key needed.

Worked examples

Base gas price

GET /api/v1/crypto/gas-price?chain=base&ethPriceUsd=3000

Result: 0.01 gwei on base

Ethereum gas price

GET /api/v1/crypto/gas-price?chain=ethereum&ethPriceUsd=3000

Result: 0.06 gwei on ethereum

Machine API (x402)

$0.002 / call

This tool is also a JSON API for AI agents. Requests without payment receive 402 Payment Required plus instructions; agents pay USDC on Base via the x402 protocol — no accounts, no API keys.

GET /api/v1/crypto/gas-price?chain=base&ethPriceUsd=3000 HTTP/1.1
Host: localhost:3000

→ 402 (payment required, instructions in headers)
→ 200 (after X-PAYMENT header; JSON body below)

{
  "tool": "crypto/gas-price",
  "input": {"chain":"base","ethPriceUsd":3000},
  "result": { "value": 0.01, "answer": "0.01 gwei on base" }
}

Agent docs: /llms.txt · OpenAPI spec · integration guide

About this tool

Live gas price from public RPC nodes on Base or Ethereum, converted to gwei and USD. Feed this into transaction-explain or your own agent loop to decide whether to send now or wait for cheaper gas.

Frequently asked questions

Is this the same as Base fees on EIP-1559 chains?

Close — eth_gasPrice returns the suggested price including the current base fee plus a priority-fee estimate. Exact base fee per block is available from the block header.

Related tools