Catalog/cryptocalc-gas-cost-usd

Calculators

EVM gas cost in USD calculator API

Compute the USD cost of an EVM transaction: costNative = gasUnits·(base+tip gwei)·1e-9, costUsd = costNative·nativeUsd, with an EIP-1559 priority tip and a per-component breakdown. Deterministic gas math. Answers 'how much does this tx cost in USD','gas fee at 25 gwei','cost of a 21000-gas transfer'.

Price$0.01per request
MethodPOST
Route/v1/calc/cryptocalc-gas-cost-usd
StatusLive
MIME typeapplication/json
Rate limit120/minute
CacheNo cache
calccryptogasevmethereumfeeseip1559gwei
API URLhttps://x402.hexl.dev/v1/calc/cryptocalc-gas-cost-usd
Integration docs
Example request
{
  "gasUnits": 21000,
  "gasPriceGwei": 25,
  "priorityFeeGwei": 2,
  "nativeUsd": 3000
}
Example response
{
  "formula": "costNative = gasUnits·(base+tip gwei)·1e-9; costUsd = costNative·nativeUsd",
  "gasUnits": 21000,
  "effectiveGasPriceGwei": 27,
  "costNative": 0.000567,
  "costUsd": 1.701,
  "breakdown": [
    {
      "factor": "base",
      "gwei": 25
    },
    {
      "factor": "priorityTip",
      "gwei": 2
    }
  ]
}
Input schema
{
  "type": "object",
  "required": [
    "gasUnits",
    "gasPriceGwei",
    "nativeUsd"
  ],
  "properties": {
    "gasUnits": {
      "type": "number",
      "description": "gas units consumed",
      "examples": [
        21000
      ]
    },
    "gasPriceGwei": {
      "type": "number",
      "description": "base fee in gwei",
      "examples": [
        25
      ]
    },
    "priorityFeeGwei": {
      "type": "number",
      "description": "priority tip in gwei",
      "examples": [
        2
      ]
    },
    "nativeUsd": {
      "type": "number",
      "description": "native token price in USD",
      "examples": [
        3000
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}