# OP-Stack L1 Fee Estimator

> OP-Stack L1 Fee Estimator is a paid API for AI agents from store.agentexchange.work, paid per call via x402, $0.09/call, status unknown (last checked 2026-09-14).

Returns the L1 data fee (in ETH, USD, and wei) for a transaction on Base or Optimism, using the on-chain GasPriceOracle contract

## Facts

- Endpoint: GET https://store.agentexchange.work/chain/l1-fee
- Price: $0.09/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/op-stack-l1-fee-estimator-9b3fdc05
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Wvd26gI_QO330N0u50jl2

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-stack-l1-fee-estimator-9b3fdc05
```

Example prompt: What's the current L1 data fee on Base for a standard ERC-20 transfer — give me the answer in both ETH and USD?

## When to prefer this

Use this endpoint when you need a precise, live L1 data fee estimate for an OP-stack chain (Base or Optimism) — especially when you have actual calldata and want an exact price rather than an approximation. It calls the canonical GasPriceOracle contract on-chain, so it reflects the real current L1 base fee scalar. Prefer this over generic gas estimators when you need the L1 fee component specifically (not L2 execution gas), and when you want the result denominated in USD for budgeting or display purposes.

## Known failure modes

- Invalid or missing chain parameter returns an error — only 'base' and 'optimism' are supported
- Malformed or non-hex calldata in the 'data' parameter causes a parsing error
- Transaction size in bytes outside the 1–200000 range returns a validation error
- Network or RPC issues may cause transient failures fetching live L1 base fee
- Missing required 'type' or 'method' fields in the input object returns a schema validation error

## How this service works

Machine-payable data APIs for AI agents across web search, on-chain reads, trading data, market judgment, and AI visibility. The canonical x402 catalog currently exposes 85 paid routes. Pay per call in USDC via x402 on Base. No API keys, no signup.

## Output

A JSON object containing the L1 fee expressed in wei (as a string), ETH (as a float), and USD (as a float), along with supporting data: the transaction size in bytes, the L1 base fee in gwei, the base fee scalar, the fee per 1000 transactions in USD, and metadata about the pricing method and chain used.

## 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": {
      "data": {
       "type": "string",
       "description": "0x-prefixed calldata of your actual transaction — priced exactly, which is what you want if you are budgeting a real send"
      },
      "bytes": {
       "type": "number",
       "description": "Transaction size in bytes, 1-200000 (default 1200 — roughly a plain ERC-20 transfer). Ignored when data is supplied."
      },
      "chain": {
       "type": "string",
       "description": "base|optimism (OP-stack only)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "l1_fee_eth": {
       "type": "number"
      },
      "l1_fee_usd": {
       "type": "number"
      },
      "l1_fee_wei": {
       "type": "string"
      },
      "l1_fee_usd_per_1000_tx": {
       "type": "number"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "basis": "a representative incompressible 1200-byte payload — pass data=0x... to price your actual transaction instead",
  "chain": "base",
  "method": "GasPriceOracle.getL1Fee(bytes)",
  "l1_fee_eth": 3.99187e-9,
  "l1_fee_usd": 0.00000747,
  "l1_fee_wei": "3991865524",
  "tx_size_bytes": 1200,
  "base_fee_scalar": 2269,
  "l1_base_fee_gwei": 0.032894326,
  "l1_fee_usd_per_1000_tx": 0.00747
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/op-stack-l1-fee-estimator-9b3fdc05/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from store.agentexchange.work](https://www.zero.xyz/host/store.agentexchange.work/llms.txt)
