# EVM Gas Price Comparator

> EVM Gas Price Comparator is a paid API for AI agents from kr-x402-mvp.kgy5612.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-31).

Returns live gas prices across Base, Ethereum, Arbitrum, Optimism, Polygon, and BSC converted to USD costs for transfers and swaps, sorted cheapest-first with a chain recommendation.

## Facts

- Endpoint: GET https://kr-x402-mvp.kgy5612.workers.dev/crypto/gas-compare?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/evm-gas-price-comparator-76fae646
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_pmqmZomlmB7tut0lubzq-

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability evm-gas-price-comparator-76fae646
```

Example prompt: Which EVM chain is cheapest right now to do a token swap — compare Base, Arbitrum, Optimism, and Ethereum and tell me how much cheaper the best option is versus Ethereum mainnet.

## When to prefer this

Choose this endpoint when an AI agent needs to make real-time routing decisions about which EVM chain to use for a transaction, especially when minimizing gas costs in USD terms. It is purpose-built for agentic on-chain workflows that must compare multiple chains simultaneously, need USD-denominated cost estimates for different transaction types (transfer, ERC-20, swap), and want a ready-made recommendation rather than raw gwei values. Prefer it over querying individual chain RPCs directly when you need cross-chain comparison in a single call with multi-RPC failover reliability.

## Known failure modes

- All RPCs for a chain fail — that chain may be omitted or return stale data
- Binance/OKX/Coinbase price feeds unavailable — native token USD conversion may fail
- Invalid chain name in filter returns empty or partial results
- Payment not processed (x402) — 402 response with payment instructions
- Rate limiting or Cloudflare Worker timeout under high load

## How this service works

Which EVM chain is cheapest to execute on right now? Live gas price on Base, Ethereum, Arbitrum, Optimism, Polygon and BSC, converted to USD per native transfer (21k gas), ERC-20 transfer (65k) and swap (150k), sorted cheapest first, with cheapest chain, Ethereum-vs-cheapest multiple and a one-line recommendation. chains=base,ethereum,... to filter, gas=N for your own gas units. Multi-RPC failover per chain, native prices Binance>OKX>Coinbase, 30s cache.

## Output

A JSON object containing per-chain data (gas price in gwei, USD cost for native transfer, ERC-20 transfer, and swap, upstream RPC URL, latency, native token price), sorted cheapest-first by swap cost, plus a top-level 'cheapest' chain name, Ethereum-vs-cheapest multiplier, a one-line human-readable recommendation, and a timestamp of when prices were last updated.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "properties": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "chains": [
   {
    "chain": "base",
    "native": "ETH",
    "chain_id": 8453,
    "swap_usd": 0.0011,
    "upstream": "https://base.drpc.org",
    "latency_ms": 80,
    "native_usd": 3850.1,
    "transfer_usd": 0.000154,
    "gas_price_gwei": 0.0019,
    "erc20_transfer_usd": 0.000476,
    "rollup_l1_fee_extra": true
   }
  ],
  "cheapest": "base",
  "gas_units": {
   "swap": 150000,
   "transfer": 21000,
   "erc20_transfer": 65000
  },
  "sorted_by": "swap_usd",
  "updated_at": "2026-10-30T01:30:00Z",
  "recommendation": "Execute on base (~180x cheaper than Ethereum L1); ...",
  "cheapest_swap_usd": 0.0011,
  "ethereum_vs_cheapest_x": 180
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/evm-gas-price-comparator-76fae646/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from kr-x402-mvp.kgy5612.workers.dev](https://www.zero.xyz/host/kr-x402-mvp.kgy5612.workers.dev/llms.txt)
