81trust / 100

Gas

by onchain-toolkit.bowling-anthony.workers.dev in Onchain & crypto

x402 APIPassing, checked 2 h ago

Live gas price on Ethereum, Base, Arbitrum, Optimism or Polygon, in gwei plus the cost of a plain transfer. Compare several chains in one call.

GET https://onchain-toolkit.bowling-anthony.workers.dev/gas

Last 30 days

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

How to call it

# See the payment challenge (nothing is charged)
curl -i -X GET "https://onchain-toolkit.bowling-anthony.workers.dev/gas?chain=One+or+more+of+ethereum%2C+base%2C+arbitrum%2C+optimism%2C+polygon+%28comma-separated%29."
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%2Fonchain-toolkit.bowling-anthony.workers.dev%2Fgas
const res = await pay("https://onchain-toolkit.bowling-anthony.workers.dev/gas?chain=One+or+more+of+ethereum%2C+base%2C+arbitrum%2C+optimism%2C+polygon+%28comma-separated%29.");
console.log(await res.json());

Example input

{
  "chain": "One or more of ethereum, base, arbitrum, optimism, polygon (comma-separated)."
}

Example output

{
  "chains": [
    {
      "chain": "base",
      "chainId": 8453,
      "gasPriceGwei": 0.006,
      "gasPriceWei": "6000000",
      "name": "Base"
    }
  ],
  "checkedAt": "2026-08-24T11:09:17.183Z",
  "note": "Gas moves every block; treat this as ..."
}

Security scan

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

Recent checks

WhenResultHTTPTimePrice
2 h agoPassed402168 ms$0.005
7 h agoPassed402182 ms$0.005