# Base Gas Oracle (x402)

> Base Gas Oracle (x402) is a paid API for AI agents from base-gas-x402-production.up.railway.app, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-15).

Returns live EIP-1559 gas fee tiers and estimated transaction costs for Base mainnet, payable per-call via x402.

## Facts

- Endpoint: GET https://base-gas-x402-production.up.railway.app/gas/compare
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/base-gas-oracle-x402-d4a79a14
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_m3s5PB5aT3kf_MGgFKGBM

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 base-gas-oracle-x402-d4a79a14
```

Example prompt: What does gas cost right now on Base mainnet for a standard ETH transfer — give me the current base fee, priority fee tiers, estimated cost in ETH and gwei, and how it compares to Ethereum.

## When to prefer this

Choose this endpoint when you need real-time, live-read gas data specifically for Base mainnet (chain ID 8453) with no API key or subscription setup — just pay 0.005–0.01 USDC per call via x402. Ideal for agents that need on-demand gas estimates before submitting transactions, for cost-routing decisions between Base and Ethereum, or for monitoring gas conditions without managing credentials. Prefer this over generic multi-chain gas APIs when Base is your target chain and you want EIP-1559-structured output with a built-in cost comparison.

## Known failure modes

- Payment not included or insufficient USDC — returns HTTP 402 with x402 payment required details
- Invalid gasLimit value (below 21000 or above 30,000,000) — returns 400 bad request
- RPC node temporarily unavailable — chain may appear in 'unavailable' array with no data
- Network timeout reading live chain data — may return partial results or 503

## How this service works

Live gas cost comparison across Base, OP Mainnet, Arbitrum One, and Ethereum in one call, ranked cheapest first.

## Output

A JSON object containing: current gas price in gwei, EIP-1559 baseFeePerGas, estimated transaction cost in ETH and gwei for the specified gasLimit (default 21000), the block number the data was read from, a fetchedAt timestamp, a ranking of Base versus other chains, the cheapest chain label, and a human-readable Base-vs-Ethereum cost comparison string (e.g. 'Base is 240x cheaper than Ethereum').

## 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": [],
     "properties": {
      "gasLimit": {
       "type": "integer",
       "default": 21000,
       "maximum": 30000000,
       "minimum": 21000,
       "description": "Gas units to price each chain against. Defaults to 21000 (a plain ETH transfer)."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "basis": "current gas price x gasLimit",
  "chains": [
   {
    "chain": "base",
    "label": "Base",
    "chainId": 8453,
    "gasPrice": "0.006",
    "blockNumber": "49106604",
    "baseFeePerGas": "0.005",
    "estimatedCost": {
     "eth": "0.000000126",
     "gwei": "126",
     "gasLimit": 21000
    }
   }
  ],
  "baseRank": 1,
  "cheapest": "base",
  "gasLimit": 21000,
  "fetchedAt": "2026-07-25T18:02:36.639Z",
  "unavailable": [],
  "baseVsEthereum": "Base is 240.5x cheaper than Ethereum"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/base-gas-oracle-x402-d4a79a14/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from base-gas-x402-production.up.railway.app](https://www.zero.xyz/host/base-gas-x402-production.up.railway.app/llms.txt)
