# AgentUtility Gas Price API

> 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-09-15).

Returns real-time EIP-1559 gas fee estimates (base fee, priority fees, maxFeePerGas) and USD/ETH transaction cost breakdowns for Base, Ethereum, Optimism, and Arbitrum.

## Facts

- Endpoint: POST https://x402.agentutility.ai/gas-price-api
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentutility-gas-price-api-1acb36c9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_oXtbWczM0O5KGTqxFpNnr

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 agentutility-gas-price-api-1acb36c9 -d '<json body>'
```

Example prompt: What's the current gas price on Base right now — give me the EIP-1559 base fee, the legacy gas price, and the ETH cost for a USDC transfer and a Uniswap v3 swap?

## When to prefer this

Choose this endpoint when an AI agent needs real-time, EIP-1559-aware gas fee data across multiple EVM chains (Base, Ethereum, Optimism, Arbitrum) with pre-computed per-operation cost estimates in both ETH and USD. It is especially useful when you want structured cost breakdowns for common DeFi operations (swaps, transfers, deploys) without building your own RPC fee logic. It is x402/USDC-native, making it ideal for autonomous agents that already operate on-chain.

## Known failure modes

- RPC node unavailable for requested chain — returns error with chain details
- Unsupported chain specified — returns validation error
- USD price oracle unavailable — usd_cost fields return null
- Stale block data if the upstream node is lagging — block_age_seconds will be elevated
- Payment failure via x402 — 402 response if USDC balance is insufficient

## How this service works

Gas price API / EIP-1559 gas fee endpoint / blockchain transaction fee estimator. Same gas-price handler, discoverable for agents estimating base fee, priority fee tiers, maxFeePerGas, and USD transaction costs for Base, Ethereum, Optimism, and Arbitrum.

## Output

Returns a JSON object with the current block number, block timestamp, chain ID, native token (ETH), base fee in gwei, legacy gas price in gwei, native token USD price, and per-operation cost estimates (in ETH and USD) for common transaction types: native transfer, USDC transfer, ERC-20 approve, NFT mint, contract deploy, Uniswap v2 swap, and Uniswap v3 swap.

## Example request

```json
{
 "sort": "relevance",
 "type": "story",
 "limit": 10,
 "query": "artificial intelligence"
}
```

## 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"
      },
      "source": {
       "type": "string"
      },
      "standard": {
       "type": "object",
       "properties": {
        "max_fee_gwei": {
         "type": "number"
        }
       }
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "chain": "base",
  "source": "rpc",
  "standard": {
   "max_fee_gwei": 0.02
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentutility-gas-price-api-1acb36c9/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)
