# EVM Gas Estimation

> EVM Gas Estimation is a paid API for AI agents from twin.unykorn.org, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-01).

Estimates the gas a transaction would consume on a given EVM chain before it is signed or submitted, using the UnyKorn Operator Network.

## Facts

- Endpoint: POST https://twin.unykorn.org/evm-estimate-gas?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/evm-gas-estimation-fa18bac8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_E7Rh6U0nPlZ-tT99dWZtM

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-gas-estimation-fa18bac8 -d '<json body>'
```

Example prompt: Before I sign this transaction, estimate how much gas it would use — it's sending 0.5 ETH from 0xAbCd...1234 to 0xDEaD...5678 on Base with no calldata.

## When to prefer this

Choose this endpoint when you need to estimate gas for a transaction on a supported EVM chain (Ethereum, Base, Polygon, Arbitrum, Optimism, BSC, Avalanche, Gnosis, Linea, Scroll) before signing or broadcasting it. It is ideal for agents that need to pre-flight transactions for cost budgeting, UX warnings, or revert detection without committing any funds. Prefer it over raw RPC calls when you want a managed, pay-per-call API with receipts and no node infrastructure to manage.

## Known failure modes

- Invalid or malformed Ethereum address in 'to' or 'from' fields returns a validation error
- Unsupported chain name causes rejection — only the enumerated chains are accepted
- Malformed or non-hex calldata in 'data' field triggers a pattern mismatch error
- Transaction that would revert on-chain may return an error or revert reason
- Payment failure via x402 protocol prevents the call from being processed
- Network congestion or RPC errors on the target chain may cause timeouts

## How this service works

Estimate the gas a transaction would use, before signing it — Genesis402 / UnyKorn Operator Network

## Output

Returns a JSON object with ok=true, the estimation type ('evm-estimate-gas'), a receipt object containing a transaction hash, the cost in USD, and a unique receipt ID, plus an ISO 8601 timestamp of when the estimate was generated.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "params": {
   "type": "object",
   "properties": {
    "to": {
     "type": "string",
     "pattern": "^0x[0-9a-fA-F]{40}$"
    },
    "data": {
     "type": "string",
     "pattern": "^0x[0-9a-fA-F]*$"
    },
    "from": {
     "type": "string",
     "pattern": "^0x[0-9a-fA-F]{40}$"
    },
    "chain": {
     "enum": [
      "ethereum",
      "base",
      "polygon",
      "arbitrum",
      "optimism",
      "bsc",
      "avalanche",
      "gnosis",
      "linea",
      "scroll"
     ],
     "type": "string"
    },
    "value": {
     "type": "string"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "type": "evm-estimate-gas",
  "receipt": {
   "tx_hash": "0x<64hex>",
   "amount_usd": 0.003,
   "receipt_id": "g402-<16hex>"
  },
  "generated_at": "<iso8601>"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/evm-gas-estimation-fa18bac8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from twin.unykorn.org](https://www.zero.xyz/host/twin.unykorn.org/llms.txt)
