# OP Mainnet Gas Oracle

> OP Mainnet Gas Oracle is a paid API for AI agents from onchaincheck.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-29).

Returns current OP Mainnet gas conditions including block number, base fee, gas price, priority fee in gwei, and estimated ETH and USD cost for native and ERC-20 transfers.

## Facts

- Endpoint: GET https://onchaincheck.dev/optimism/gas?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/op-mainnet-gas-oracle-5c77392a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_JwGw6zXjG8LPxhvtq1GXa

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 op-mainnet-gas-oracle-5c77392a
```

Example prompt: What are the current gas fees on OP Mainnet — give me the base fee, gas price, and how much a native ETH transfer and an ERC-20 transfer would cost in both ETH and USD right now?

## When to prefer this

Use this endpoint when you need real-time gas fee data specifically for OP Mainnet (Optimism), including human-readable USD cost estimates for common transaction types. Prefer this over generic gas trackers when you need Chainlink-priced USD estimates or when your workflow is specifically targeting Optimism L2. Use the Base or Arbitrum sibling endpoints for those chains instead.

## Known failure modes

- RPC node unavailability may cause stale or missing block data
- Chainlink ETH/USD price feed may be slightly delayed
- Network congestion on Optimism could cause rapid fee changes between fetch and use
- Response may not include L1 data fee component, understating true transaction cost

## How this service works

Current OP Mainnet gas conditions: block number, base fee, gas price and priority fee in gwei, and the estimated cost in ETH and USD of a native transfer and an ERC-20 transfer (Chainlink ETH/USD).

## Output

A JSON object containing: the current Optimism block number and timestamp, base fee, gas price, and max priority fee in gwei, the current ETH/USD price from Chainlink, and estimated costs (in both ETH and USD) for a native ETH transfer and an ERC-20 transfer. Includes a note that L1 data fees are excluded.

## Request schema (JSON Schema)

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

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "note": "Excludes OP Mainnet's L1 data fee, which adds a small amount per transaction.",
  "chain": "optimism",
  "blockTime": "2026-10-22T15:50:33.000Z",
  "nativeUsd": 2394.09,
  "baseFeeGwei": "0.000000304",
  "blockNumber": 158542728,
  "gasPriceGwei": "0.001000304",
  "nativeSymbol": "ETH",
  "estimatedCost": {
   "erc20Transfer": {
    "usd": 0.0001557,
    "native": "0.00000006501976"
   },
   "nativeTransfer": {
    "usd": 0.00005029,
    "native": "0.000000021006384"
   }
  },
  "maxPriorityFeeGwei": "0.001"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/op-mainnet-gas-oracle-5c77392a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from onchaincheck.dev](https://www.zero.xyz/host/onchaincheck.dev/llms.txt)
