# Base Mainnet Gas Estimator

> Base Mainnet Gas Estimator is a paid API for AI agents from x402.agentindex.world, paid per call via x402, $0.004/call, status unknown (last checked 2026-10-30).

Estimates gas required for a transaction or contract call on Base mainnet using eth_estimateGas, without broadcasting the transaction.

## Facts

- Endpoint: GET https://x402.agentindex.world/base/estimate-gas?utm_source=zero.xyz
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/base-mainnet-gas-estimator-0891b92c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap__Qime9gnIT1yXJPBzs2xn

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-mainnet-gas-estimator-0891b92c
```

Example prompt: Before I send this swap transaction, estimate how much gas it'll use on Base mainnet — the call goes to 0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD with calldata 0x3593564c... and I'm sending 0 ETH from 0xYourWalletAddress.

## When to prefer this

Use this endpoint when you need a gas estimate specifically for Base mainnet (Coinbase's L2) before submitting a transaction. Prefer this over generic Ethereum gas estimators when you're operating on Base. Ideal for pre-flight checks in DeFi agents, smart contract deployment pipelines, or any workflow where you want to validate feasibility and budget gas costs without risking a failed on-chain transaction.

## Known failure modes

- Transaction would revert on-chain — eth_estimateGas returns an error if the simulated call would fail (e.g. insufficient token balance, access control rejection)
- Invalid address format for 'to' or 'from_address' — returns a validation or RPC error
- Malformed calldata — may cause revert simulation or RPC error
- Network congestion or RPC node unavailability — request may time out or return an error
- Missing required 'to' field — returns a 422 or bad request error

## How this service works

Gas estimate for a Base mainnet swap or any other call (to/from/value/data) via eth_estimateGas, without broadcasting a transaction.

## Output

Returns the estimated number of gas units required to execute the specified transaction or call on Base mainnet, computed via eth_estimateGas without actually broadcasting the transaction. This lets agents budget for gas costs, detect likely reverts, and validate transaction feasibility before committing on-chain.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "to": {
   "type": "string",
   "title": "To"
  },
  "data": {
   "anyOf": [
    {
     "type": "string"
    },
    {
     "type": "null"
    }
   ],
   "title": "Data",
   "default": null
  },
  "value_wei": {
   "type": "integer",
   "title": "Value Wei",
   "default": 0
  },
  "from_address": {
   "anyOf": [
    {
     "type": "string"
    },
    {
     "type": "null"
    }
   ],
   "title": "From Address",
   "default": null
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/base-mainnet-gas-estimator-0891b92c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.agentindex.world](https://www.zero.xyz/host/x402.agentindex.world/llms.txt)
