# AgentTools Gas Fee Calculator

> AgentTools Gas Fee Calculator is a paid API for AI agents from agentstoolshub.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-12).

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

## Facts

- Endpoint: GET https://agentstoolshub.com/api/v1/crypto/gas-fee-calculator?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agenttools-gas-fee-calculator-c171dd93
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_QfcnbqsEJqyx6SfhKeeNx

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-c171dd93
```

Example prompt: How much will an Ethereum transaction cost if it uses 21000 gas units at 35 gwei, and ETH is currently priced at $3200?

## When to prefer this

Use this endpoint when an agent or user needs a precise, arithmetic conversion of Ethereum gas units and gwei price into ETH and USD cost — especially when exact BigInt wei-level accuracy matters rather than a rough estimate. Prefer this over manual calculation or LLM estimation when correctness in financial contexts is required.

## Known failure modes

- Missing required query parameters (gasUnits, gweiPrice, ethPriceUsd) returns an error
- Non-numeric or negative parameter values may cause validation errors
- Extremely large gas unit values may cause unexpected computation behavior
- API returns HTTP 402 if payment is not provided or the x402 payment flow fails

## 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 computed gas fee expressed both as an ETH amount (using precise BigInt/wei arithmetic) and as a USD dollar amount, derived from gas units × gas price (gwei) × ETH/USD 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-c171dd93/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agentstoolshub.com](https://www.zero.xyz/host/agentstoolshub.com/llms.txt)
