# Optimism Gas Price History

> Optimism Gas Price History is a paid API for AI agents from agent-data-tools.revmesh2074.workers.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-30).

Returns per-block base fee, gas usage ratio, and percentile priority fees for the last N blocks on Optimism, plus window-level fee summaries.

## Facts

- Endpoint: GET https://agent-data-tools.revmesh2074.workers.dev/op/gas-history?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Provider: agent-data-tools.revmesh2074.workers.dev
- Website: https://agent-data-tools.revmesh2074.workers.dev
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent-data-tools-revmesh2074-workers-dev-optimism-gas-price-history-ef51926e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_S5AhJqec3M_tE8vijgmMd

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 agent-data-tools-revmesh2074-workers-dev-optimism-gas-price-history-ef51926e
```

Example prompt: Pull the Optimism gas fee history for the last 50 blocks — I want to see how the base fee has moved and what priority fee percentiles look like so I can decide whether to send my transaction now.

## When to prefer this

Use this endpoint when you need historical context about Optimism gas fees — fee trends, block congestion levels, or a basis for choosing a priority fee. If you only need the current gas price on Optimism, prefer the op_gas endpoint instead. Choose this over generic Ethereum gas tools when the user specifically wants Optimism L2 fee data.

## Known failure modes

- blocks parameter out of range (must be 5-100) — likely returns a 400 or validation error
- RPC node unavailable or rate-limited — may return 5xx or timeout
- Payment not provided or insufficient credits — returns 402 Payment Required
- Blocks value not an integer — schema validation error

## How this service works

Gas price history on Optimism (eth_feeHistory): base fee in gwei for each of the last N blocks (5-100, default 20), how full each block was, and the 10th, 50th and 90th percentile priority fees, with the low, average and high base fee over the window. Use to judge whether fees are rising, pick a priority fee or time a transaction; for the current price alone use op_gas.

## Output

A JSON object containing: an array of per-block entries (block number, base fee in gwei, gas used ratio, and [p10, p50, p90] priority fees), the block range covered, chain name and ID, and aggregate summaries — low/average/high/latest/next base fee in gwei, plus window-level p10/p50/p90 priority fees.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "blocks": {
   "type": "integer",
   "description": "How many recent blocks, 5-100 (default 20)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "chain": {
   "type": "string"
  },
  "blocks": {
   "type": "number"
  },
  "chainId": {
   "type": "number"
  },
  "history": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "block": {
      "type": "number"
     },
     "baseFeeGwei": {
      "type": "number"
     },
     "gasUsedRatio": {
      "type": "number"
     },
     "priorityFeeGwei": {
      "type": "array",
      "items": {
       "type": "number"
      }
     }
    }
   }
  },
  "toBlock": {
   "type": "number"
  },
  "fromBlock": {
   "type": "number"
  },
  "baseFeeGwei": {
   "type": "object",
   "properties": {
    "low": {
     "type": "number"
    },
    "high": {
     "type": "number"
    },
    "next": {
     "type": "number"
    },
    "latest": {
     "type": "number"
    },
    "average": {
     "type": "number"
    }
   }
  },
  "priorityFeeGwei": {
   "type": "object",
   "properties": {
    "p10": {
     "type": "number"
    },
    "p50": {
     "type": "number"
    },
    "p90": {
     "type": "number"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-data-tools-revmesh2074-workers-dev-optimism-gas-price-history-ef51926e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent-data-tools.revmesh2074.workers.dev](https://www.zero.xyz/host/agent-data-tools.revmesh2074.workers.dev/llms.txt)
