30trust / 100
Crypto Gas Fee Calculator
by AgentTools in Onchain & crypto
x402 APIFailing, checked 1 h ago
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.
GET https://agenttools-hub.vercel.app/api/v1/crypto/gas-fee-calculator
Last 30 days
All checks passedSome failedAll failedNot checked
- Uptime
- 13.3%
- Response time
- 166 ms typical, 166 ms slowest 5%
- Last check
- 1 h ago: Expected HTTP 402, got 308
- Next check
- any minute now
How to call it
# See the payment challenge (nothing is charged)
curl -i -X GET "https://agenttools-hub.vercel.app/api/v1/crypto/gas-fee-calculator?ethPriceUsd=3000&gasUnits=21000&gweiPrice=10"import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client().register(
"eip155:8453",
new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);
// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fagenttools-hub.vercel.app%2Fapi%2Fv1%2Fcrypto%2Fgas-fee-calculator
const res = await pay("https://agenttools-hub.vercel.app/api/v1/crypto/gas-fee-calculator?ethPriceUsd=3000&gasUnits=21000&gweiPrice=10");
console.log(await res.json());Example input
{
"ethPriceUsd": 3000,
"gasUnits": 21000,
"gweiPrice": 10
}Example output
{
"result": {
"answer": "$0.63",
"answerLabel": "Transaction fee (USD)",
"details": [
{
"label": "Fee in ETH",
"value": "0.000210000000000000"
},
{
"label": "Fee in wei (exact)",
"value": "210000000000000"
},
{
"label": "Fee in gwei",
"value": "210000"
},
{
"label": "ETH price used",
"value": "$3,000"
}
],
"steps": [
"wei = 21000 gas × 10 gwei × 10⁹ = 210000000000000",
"ETH = 0.000210000000000000 · USD = 0.000210000000000000 × $3,000 = $0.63"
],
"value": 0.63
},
"tool": "gas-fee-calculator"
}Security scan
- No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.
Recent checks
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 1 h ago | Expected HTTP 402, got 308 | 308 | 140 ms | - |
| 5 h ago | Expected HTTP 402, got 308 | 308 | 73 ms | - |
| 10 h ago | Expected HTTP 402, got 308 | 308 | 20 ms | - |
| 14 h ago | Expected HTTP 402, got 308 | 308 | 14 ms | - |
| 18 h ago | Expected HTTP 402, got 308 | 308 | 16 ms | - |
| 22 h ago | Expected HTTP 402, got 308 | 308 | 191 ms | - |
| 27 h ago | Expected HTTP 402, got 308 | 308 | 45 ms | - |
| 31 h ago | Expected HTTP 402, got 308 | 308 | 48 ms | - |
| 35 h ago | Expected HTTP 402, got 308 | 308 | 73 ms | - |
| 39 h ago | Expected HTTP 402, got 308 | 308 | 25 ms | - |
| 43 h ago | Expected HTTP 402, got 308 | 308 | 14 ms | - |
| 47 h ago | Expected HTTP 402, got 308 | 308 | 16 ms | - |
| 2 days ago | Expected HTTP 402, got 308 | 308 | 19 ms | - |
| 2 days ago | Passed | 402 | 166 ms | $0.003 |
| 2 days ago | Passed | 402 | 305 ms | $0.003 |