# Gas Prices — Base, Optimism & Ethereum Mainnet

> Gas Prices — Base, Optimism & Ethereum Mainnet is a paid API for AI agents from x402-audit.tatschluizguilherme.workers.dev, paid per call via x402, $0.1/call, status unknown (last checked 2026-09-14).

Returns live gas prices (gasPrice, maxPriorityFee EIP-1559) and latest block number for Base, Optimism, and/or Ethereum Mainnet via public RPCs.

## Facts

- Endpoint: GET https://x402-audit.tatschluizguilherme.workers.dev/gas
- Price: $0.1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/gas-prices-base-optimism-ethereum-mainnet-37161a66
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_DYy6xXJvL2uMj2jn5FVRL

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 gas-prices-base-optimism-ethereum-mainnet-37161a66
```

Example prompt: What are the current gas prices on Base, Optimism, and Ethereum Mainnet right now — including gasPrice and maxPriorityFee for EIP-1559?

## When to prefer this

Choose this endpoint when you need real-time, cross-chain gas price data (gasPrice + EIP-1559 maxPriorityFee) for Base, Optimism, and/or Ethereum Mainnet without managing your own RPC connections or API keys. It's ideal for pre-transaction gas estimation, cross-chain fee comparison, or monitoring gas conditions programmatically. It supports querying all three chains in a single call via 'all'.

## Known failure modes

- Public RPC unavailable or rate-limited — upstream provider error returned
- Invalid chain enum value — query param ignored or error returned
- Network timeout — Cloudflare Worker fails to fetch from public RPC in time
- Payment not fulfilled — x402 payment required, 402 returned if USDC not sent

## How this service works

Pay-per-call on-chain API for AI agents and developers: wallet audits, token safety audits (honeypot detection), live gas prices, token prices, transaction receipts, balances, ENS resolution, block data, ERC-20 allowances, transaction simulation, swap quotes and multicall batches — all computed on-chain via public RPCs (no external market API). Pay per request in USDC on Base via the x402 exact scheme (EIP-3009 transferWithAuthorization). No API key, no signup, no subscription.

## Output

A JSON object with a 'chains' map keyed by chain name (base, op, mainnet), each containing gasPrice in wei, maxPriorityFee in wei (EIP-1559), and latest block number, plus a top-level requestedAt ISO timestamp.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "chain": {
       "enum": [
        "base",
        "op",
        "mainnet",
        "all"
       ],
       "type": "string",
       "description": "Chain(s) to query — comma-separated or 'all' (default)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "chains"
     ],
     "properties": {
      "chains": {
       "type": "object"
      },
      "requestedAt": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "chains": {
   "base": {
    "chain": "base",
    "timestamp": "2026-08-04T22:00:00.000Z",
    "blockNumber": 24400000,
    "gasPriceGwei": 0.021,
    "maxPriorityFeeGwei": 0.002
   }
  },
  "requestedAt": "2026-08-04T22:00:00.000Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/gas-prices-base-optimism-ethereum-mainnet-37161a66/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-audit.tatschluizguilherme.workers.dev](https://www.zero.xyz/host/x402-audit.tatschluizguilherme.workers.dev/llms.txt)
