# Ontario Protocol Base Gas Fee Estimator

> Ontario Protocol Base Gas Fee Estimator is a paid API for AI agents from ontarioprotocol.com, paid per call via x402, $0.0015/call, status unknown (last checked 2026-10-30).

Returns live Base network gas fee data including base fee, priority fee percentiles, suggested maxFeePerGas/maxPriorityFeePerGas for slow/normal/fast inclusion, L1 data fee upper bound, and estimated total transaction costs in wei.

## Facts

- Endpoint: GET https://ontarioprotocol.com/api/x402/base/gas?utm_source=zero.xyz
- Price: $0.0015/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/ontario-protocol-base-gas-fee-estimator-a6f19a31
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_nwZL5QsPKg1Qeo-2omEg_

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 ontario-protocol-base-gas-fee-estimator-a6f19a31
```

Example prompt: What are the current gas fees on Base — give me the base fee, priority fee percentiles, and the recommended maxFeePerGas and maxPriorityFeePerGas for slow, normal, and fast transactions, sampled over the last 20 blocks?

## When to prefer this

Choose this endpoint when you need live, current Base network gas fee data with multi-tier inclusion speed suggestions (slow/normal/fast) and want both L1 and L2 fee components included in a single call. It is particularly useful for agents that need to set EIP-1559 gas parameters before submitting transactions, estimate transaction costs before execution, or display current network fee conditions to users. Prefer it over generic Ethereum gas endpoints because it is Base-specific and accounts for the L1 data fee component unique to Base as an L2.

## Known failure modes

- Base RPC read failure — no charge, endpoint returns an error indicating the live data could not be fetched
- Invalid blocks parameter (outside 5–50 range) — likely returns a 400 or validation error
- Network connectivity issue to Base RPC — transient failure with no charge per stated policy
- Stale or delayed block data during high network congestion — estimates may lag slightly behind true mempool state

## How this service works

What does a Base transaction cost right now? Base fee, priority-fee p25/p50/p90 over the last 20 blocks, suggested maxFeePerGas and maxPriorityFeePerGas for slow, normal and fast inclusion, an L1 data-fee upper bound, and estimated total cost in wei for an ETH transfer and an ERC-20 transfer, read live from Base RPC with the block number. $0.0015 USDC on Base. Failed read, no charge. No account, no API key. Estimates, not inclusion guarantees. By Ontario Protocol.

## Output

A JSON object containing: the current block number, Base network identifier, timestamp, base fee in wei, priority fee p25/p50/p90 across sampled blocks, suggested maxFeePerGas and maxPriorityFeePerGas for slow/normal/fast inclusion, L1 data fee upper bound for ETH and ERC-20 transfers, estimated total transaction cost in wei for both transfer types, and the assumptions used in calculations (gas limits, formula, bytes). All wei amounts are returned as decimal strings.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "input",
  "output"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "queryParams"
   ],
   "properties": {
    "queryParams": {
     "type": "object",
     "properties": {
      "blocks": {
       "type": "integer",
       "default": 20,
       "maximum": 50,
       "minimum": 5,
       "description": "Optional number of recent blocks the fee percentiles cover, 5 to 50. Default 20."
      }
     },
     "additionalProperties": false
    }
   }
  },
  "output": {
   "type": "object",
   "required": [
    "example"
   ],
   "properties": {
    "example": {
     "type": "object",
     "additionalProperties": true
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "example": {
  "note": "Estimates, not inclusion guarantees. Wei amounts are decimal strings.",
  "block": 53049909,
  "schema": "ontario.base_gas.v1",
  "source": "Base RPC",
  "network": "eip155:8453",
  "read_at": "2026-10-25T00:46:05Z",
  "suggested": {
   "fast": {
    "max_fee_per_gas": "15800000",
    "max_priority_fee_per_gas": "5800000"
   },
   "slow": {
    "max_fee_per_gas": "11000000",
    "max_priority_fee_per_gas": "1000000"
   },
   "normal": {
    "max_fee_per_gas": "11000000",
    "max_priority_fee_per_gas": "1000000"
   }
  },
  "assumptions": {
   "base_fee": "base fee of the next block",
   "blocks_sampled": 20,
   "max_fee_formula": "2 * base_fee + priority_fee",
   "estimate_formula": "gas * (base_fee + p50 tip) + L1 data-fee upper bound",
   "eth_transfer_gas": 21000,
   "erc20_transfer_gas": 65000,
   "priority_fee_method": "median across the sampled blocks of each block's gas-weighted 25th, 50th and 90th percentile tip (eth_feeHistory)",
   "eth_transfer_unsigned_tx_bytes": 110,
   "erc20_transfer_unsigned_tx_bytes": 175
  },
  "base_fee_wei": "5000000",
  "priority_fee_wei": {
   "p25": "1000000",
   "p50": "1000000",
   "p90": "5800000"
  },
  "estimated_total_wei": {
   "eth_transfer": "126389167165",
   "erc20_transfer": "390565949161"
  },
  "l1_fee_upper_bound_wei": {
   "eth_transfer": "389167165",
   "erc20_transfer": "565949161"
  },
  "estimate_includes_l1_fee": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/ontario-protocol-base-gas-fee-estimator-a6f19a31/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from ontarioprotocol.com](https://www.zero.xyz/host/ontarioprotocol.com/llms.txt)
