# x402 AgentUtility Gas Price API

> x402 AgentUtility Gas Price API is a paid API for AI agents from x402.agentutility.ai, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-19).

Estimates EIP-1559 gas fees for Base, Ethereum, Optimism, and Arbitrum chains, returning tiered priority fees, maxFeePerGas, and USD cost estimates for common transaction types.

## Facts

- Endpoint: POST https://x402.agentutility.ai/gas-price?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-agentutility-gas-price-api-909e1619
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_SPchC3igljpO8B-y4p2Fp

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 x402-agentutility-gas-price-api-909e1619 -d '<json body>'
```

Example prompt: What will a standard ERC-20 token transfer cost in gas fees right now on Ethereum — give me the base fee, suggested priority fee, and total USD cost for safe-low, standard, and fast confirmation tiers.

## When to prefer this

Choose this endpoint when an agent needs real-time, tiered EIP-1559 gas estimates with USD conversion across multiple EVM chains (Base, Ethereum, Optimism, Arbitrum) in a single call, especially when cost-in-dollars is required for user-facing display or pre-transaction decision-making. Prefer this over on-chain RPC calls when the agent lacks direct blockchain access or needs normalized, human-readable fee tiers without parsing raw block data.

## Known failure modes

- Unsupported chain identifier returns an error or empty response
- RPC node unavailability causes stale or missing block data
- Extreme gas price volatility may make estimates outdated within seconds
- Missing or malformed request body returns a 400 error
- Payment failure via x402 protocol results in 402 response and no data returned

## How this service works

Gas price API / EIP-1559 fee estimator / Base + Ethereum + Optimism + Arbitrum gas tracker / pre-tx cost estimator. Reads the chain's latest block, derives base fee, suggests priority fees for safe-low/standard/fast tiers, computes total maxFeePerGas, and converts cost to USD for common tx types.

## Output

Returns the latest block's base fee, suggested priority fees for safe-low, standard, and fast confirmation tiers, the computed maxFeePerGas for each tier, and USD cost estimates for common transaction types (e.g. ETH transfer, ERC-20 transfer, contract call) on the requested EVM-compatible chain.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "properties": {
      "chain": {
       "enum": [
        "base",
        "ethereum",
        "optimism",
        "arbitrum",
        "polygon"
       ],
       "type": "string",
       "description": "EVM L1/L2 to read gas from. Default 'base'."
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "chain": {
       "type": "string"
      },
      "cost_usd": {
       "type": "object",
       "properties": {
        "nft_mint": {
         "type": "number"
        },
        "transfer": {
         "type": "number"
        },
        "uniswap_swap": {
         "type": "number"
        },
        "erc20_transfer": {
         "type": "number"
        }
       }
      },
      "timestamp": {
       "type": "string"
      },
      "block_number": {
       "type": "integer"
      },
      "base_fee_gwei": {
       "type": "number"
      },
      "eth_price_usd": {
       "type": "integer"
      },
      "priority_fee_gwei": {
       "type": "object",
       "properties": {
        "fast": {
         "type": "number"
        },
        "safe_low": {
         "type": "number"
        },
        "standard": {
         "type": "number"
        }
       }
      },
      "total_recommended_gwei": {
       "type": "number"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "chain": "base",
  "cost_usd": {
   "nft_mint": 0.006,
   "transfer": 0.0008,
   "uniswap_swap": 0.004,
   "erc20_transfer": 0.0012
  },
  "timestamp": "2026-05-06T22:00:00Z",
  "block_number": 27500000,
  "base_fee_gwei": 0.005,
  "eth_price_usd": 3500,
  "priority_fee_gwei": {
   "fast": 0.002,
   "safe_low": 0.001,
   "standard": 0.001
  },
  "total_recommended_gwei": 0.006
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-agentutility-gas-price-api-909e1619/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.agentutility.ai](https://www.zero.xyz/host/x402.agentutility.ai/llms.txt)
