# Base Mainnet Gas Price Oracle (gas.apitoll.cloud)

> Base Mainnet Gas Price Oracle (gas.apitoll.cloud) is a paid API for AI agents from gas.apitoll.cloud, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Returns real-time EIP-1559 gas fee tiers (slow/standard/fast) plus base fee, latest block number, and median block fullness for the Base mainnet.

## Facts

- Endpoint: GET https://gas.apitoll.cloud/v1/base/gas
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/gas-apitoll-cloud-fd153d5a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_lQ49KainwFSbYEevR-KZx

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-apitoll-cloud-fd153d5a
```

Example prompt: What are the current slow, standard, and fast gas fee tiers on Base mainnet right now? Sample the last 20 blocks so I can decide whether to send my transaction immediately or wait.

## When to prefer this

Use this endpoint when you need real-time, EIP-1559-aware gas estimates specifically for the Base mainnet (Coinbase L2), with p10/p50/p90 fee tiers and block congestion signals. Prefer this over generic Ethereum gas APIs when building Base-native dApps, DeFi bots, or transaction schedulers that need structured slow/standard/fast tiers and block fullness context rather than a single gas price value.

## Known failure modes

- RPC node unavailable — upstream eth_feeHistory call fails, returns 5xx
- Invalid blocks parameter (outside 1-50 range) — request rejected or clamped
- Network misconfiguration — may return data for wrong chain if Base RPC is temporarily rerouted
- Rate limiting or payment failure — 402 response if x402 payment not processed
- Empty or sparse block history — tiers may be unreliable if Base has low recent activity

## How this service works

Base gas oracle / gas price API for AI agents and bots — get the gas price for a transaction on Base in one x402 call. Real-time slow/standard/fast EIP-1559 fee tiers from a live eth_feeHistory call, returned as DROP-IN maxFeePerGas + maxPriorityFeePerGas in wei — plug straight into a viem/ethers transaction, no gwei conversion. Plus base fee, head block, and network fullness. Call it before every Base tx to set a fair fee or wait out congestion.

## Output

A JSON object with three EIP-1559 fee tiers (slow=p10, standard=p50, fast=p90), each containing max_fee_per_gas and max_priority_fee_per_gas in gwei; the predicted next-block base fee in gwei; the latest sampled block number; and stats including timestamp, number of blocks sampled, and median block fullness percentage.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "blocks": 20
  }
 }
}
```

## 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",
     "required": [
      "blocks"
     ],
     "properties": {
      "blocks": {
       "type": "integer",
       "maximum": 50,
       "minimum": 1,
       "description": "Recent blocks to sample for percentile reward (1..50, clamped). Wider = smoother tiers, narrower = more reactive."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "stats": {
       "type": "object",
       "required": [
        "blocks_sampled",
        "median_fullness_pct",
        "ts"
       ],
       "properties": {
        "ts": {
         "type": "string",
         "format": "date-time",
         "description": "ISO 8601 timestamp when snapshot was assembled."
        },
        "blocks_sampled": {
         "type": "integer",
         "description": "Number of recent blocks sampled for percentile calculation."
        },
        "median_fullness_pct": {
         "type": "number",
         "description": "Median (gasUsed / gasLimit) × 100 across sampled blocks. 100 = full, 0 = empty."
        }
       },
       "description": "Sampling metadata: block count and median fullness."
      },
      "tiers": {
       "type": "object",
       "properties": {
        "fast": {
         "type": "object",
         "required": [
          "max_fee_gwei",
          "max_priority_gwei",
          "maxFeePerGas",
          "maxPriorityFeePerGas"
         ],
         "properties": {
          "maxFeePerGas": {
           "type": "string",
           "description": "DROP-IN: exact maxFeePerGas in wei. tx.maxFeePerGas = BigInt(this)."
          },
          "max_fee_gwei": {
           "type": "number",
           "description": "maxFeePerGas in gwei (human-readable)."
          },
          "max_priority_gwei": {
           "type": "number",
           "description": "maxPriorityFeePerGas (tip) in gwei (human-readable)."
          },
          "maxPriorityFeePerGas": {
       
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "stats": {
   "ts": "2026-05-28T15:42:30.000Z",
   "blocks_sampled": 20,
   "median_fullness_pct": 31.5
  },
  "tiers": {
   "fast": {
    "max_fee_gwei": 0.0163,
    "max_priority_gwei": 0.01
   },
   "slow": {
    "max_fee_gwei": 0.0083,
    "max_priority_gwei": 0.002
   },
   "standard": {
    "max_fee_gwei": 0.0103,
    "max_priority_gwei": 0.004
   }
  },
  "network": "base-mainnet",
  "block_number": 16842103,
  "base_fee_gwei": 0.0042
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/gas-apitoll-cloud-fd153d5a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from gas.apitoll.cloud](https://www.zero.xyz/host/gas.apitoll.cloud/llms.txt)
