# EVM Transaction Gas Estimator

> EVM Transaction Gas Estimator is a paid API for AI agents from chain.openverbs.com, paid per call via x402, $0.004/call, status unknown (last checked 2026-09-14).

Simulates an EVM transaction using eth_estimateGas and returns estimated gas units and fee in wei/ETH, or a decoded revert reason if the transaction would fail.

## Facts

- Endpoint: POST https://chain.openverbs.com/v1/gas-estimate
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/evm-transaction-gas-estimator-bd8b1678
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_BIUC9KVHAFHBEmjc9o1_J

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 evm-transaction-gas-estimator-bd8b1678 -d '<json body>'
```

Example prompt: Before I sign, can you simulate this ERC-20 transfer on Base — from 0xAbC...123 to 0xDeF...456 with calldata 0xa9059cbb... — and tell me the estimated gas units and fee in ETH?

## When to prefer this

Choose this endpoint when you need to pre-validate or cost-estimate an EVM transaction before signing and broadcasting, especially when you want a decoded revert reason on failure rather than a raw RPC error. Prefer it over raw eth_estimateGas RPC calls because it adds automatic node failover, fee conversion to ETH, and graceful revert decoding. Use it across Ethereum, Base, Arbitrum, Optimism, and Polygon. Not suitable for Bitcoin or non-EVM chains.

## Known failure modes

- Transaction simulation reverts — returns ok:false with decoded revertReason instead of gas estimate
- Invalid address format — request rejected before reaching the node
- Unsupported chain value — must be one of ethereum, base, arbitrum, optimism, polygon
- Node endpoint unavailable — automatic fallback attempted, but if all nodes fail the request errors
- Malformed calldata hex — rejected if data does not match ^0x([0-9a-fA-F]{2})*$ pattern
- Value field unparseable — must be decimal integer or 0x-prefixed hex string

## How this service works

Simulate a transaction before signing: runs `eth_estimateGas` for `{ to, from?, data?, value? }` and returns the estimated gas units and estimated fee (current gas price x gas, in wei + ETH). If the node rejects the call it returns `ok:false` with the decoded `revertReason` (why it would fail) instead of erroring. Reads live on-chain state with automatic endpoint fallback.

## Output

Returns a JSON object with ok:true and the estimated gas units (integer) plus the estimated fee expressed both in wei and in ETH at the current gas price. If the node rejects the simulated call, returns ok:false with a human-readable revertReason explaining why the transaction would fail, without throwing an error.

## Request schema (JSON Schema)

```json
{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "type": "string",
     "enum": [
      "POST"
     ]
    },
    "bodyType": {
     "type": "string",
     "enum": [
      "json",
      "form-data",
      "text"
     ]
    },
    "body": {
     "type": "object",
     "properties": {
      "to": {
       "type": "string",
       "pattern": "^0x[0-9a-fA-F]{40}$",
       "description": "Destination address (contract or wallet)."
      },
      "from": {
       "type": "string",
       "pattern": "^0x[0-9a-fA-F]{40}$",
       "description": "Sender address (optional; affects state-dependent estimates)."
      },
      "data": {
       "type": "string",
       "pattern": "^0x([0-9a-fA-F]{2})*$",
       "description": "Calldata hex (optional; e.g. an ERC-20 transfer)."
      },
      "value": {
       "type": "string",
       "description": "Native value in wei, decimal or 0x-hex (optional)."
      },
      "chain": {
       "type": "string",
       "enum": [
        "ethereum",
        "base",
        "arbitrum",
        "optimism",
        "polygon"
       ],
       "description": "EVM chain to query. One of: ethereum, base, arbitrum, optimism, polygon. Default \"ethereum\"."
      }
     },
     "additionalProperties": false
    }
   },
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "additionalProperties": false
  }
 },
 "required": [
  "input"
 ]
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/evm-transaction-gas-estimator-bd8b1678/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from chain.openverbs.com](https://www.zero.xyz/host/chain.openverbs.com/llms.txt)
