# AgentTools Gas Fee Calculator

> AgentTools Gas Fee Calculator is a paid API for AI agents from agenttools-hub.vercel.app, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-02).

Calculates Ethereum transaction cost in both ETH and USD from gas units, gas price in gwei, and current ETH price using exact BigInt arithmetic.

## Facts

- Endpoint: GET https://agenttools-hub.vercel.app/api/v1/crypto/gas-fee-calculator?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agenttools-gas-fee-calculator-76979770
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xNR0-0fwXExg20J7Wb3VM

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 agenttools-gas-fee-calculator-76979770
```

Example prompt: What will this Ethereum transaction cost me? It uses 21000 gas units at a gas price of 30 gwei, and ETH is currently trading at $3200.

## When to prefer this

Use this endpoint when you need a precise, BigInt-accurate gas fee calculation in both ETH and USD and you already have the gas units, gwei price, and ETH/USD price on hand. It is ideal for AI agents that need to display transaction cost estimates to users before they approve a blockchain transaction, especially when precision at the wei level matters.

## Known failure modes

- Missing required query parameters (gasUnits, gweiPrice, or ethPriceUsd) returns a 400 error
- Non-numeric or negative values for gas parameters may return validation errors
- Extremely large gas unit values may cause unexpected precision issues depending on the server's BigInt implementation
- Network or server errors on the Vercel host return 500-level responses

## How this service works

Calculate a transaction's gas fee: gas units × gas price (gwei) gives the ETH cost, multiplied by the ETH price for USD. Exact BigInt math for the wei amounts. Use this when an agent needs to transaction cost in ETH and USD from gas × gwei.

## Output

Returns the transaction gas fee expressed in ETH and USD, computed using exact BigInt arithmetic on the wei-level amounts (gasUnits × gweiPrice × 1e9 for wei, converted to ETH and then to USD via the provided ETH price).

## 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": [
      "gasUnits",
      "gweiPrice",
      "ethPriceUsd"
     ],
     "properties": {
      "gasUnits": {
       "type": "number",
       "description": "Gas units"
      },
      "gweiPrice": {
       "type": "number",
       "description": "Gas price (gwei)"
      },
      "ethPriceUsd": {
       "type": "number",
       "description": "ETH price (USD)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agenttools-gas-fee-calculator-76979770/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agenttools-hub.vercel.app](https://www.zero.xyz/host/agenttools-hub.vercel.app/llms.txt)
