# Ethereum & Solana Gas Price API

> Ethereum & Solana Gas Price API is a paid API for AI agents from api.agent-data.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-14).

Returns current Ethereum gas price (base fee, priority fee, gas price in gwei) and Solana priority fees and transfer costs, to inform on-chain transaction cost estimates.

## Facts

- Endpoint: GET https://api.agent-data.workers.dev/api/v1/gas?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/ethereum-solana-gas-price-api-021d66c0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_sUWsg0oiiqcdsUEtzr1hd

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 ethereum-solana-gas-price-api-021d66c0
```

Example prompt: Before I submit this Ethereum transaction, can you check the current gas price and tell me what the base fee, priority fee, and estimated transfer cost are right now? Also grab the current Solana priority fee and transfer cost while you're at it.

## When to prefer this

Use this endpoint when an AI agent needs real-time gas cost data for Ethereum or Solana immediately before submitting an on-chain transaction, or when comparing cross-chain transaction costs. Prefer this over manual RPC calls when you need a simple, pre-processed JSON response covering both chains in a single call with no input parameters required.

## Known failure modes

- Upstream RPC node unavailability may return stale or error responses
- Network congestion spikes may cause brief data lag
- Rate limiting or payment failure (402) if USDC micropayment is not provided
- Returned values may be slightly stale during high network volatility

## How this service works

Current Ethereum gas price, base and priority fee, plus Solana priority fees and the cost of a simple transfer. Use before sending an on-chain transaction.

## Output

A JSON object with a Unix timestamp and two sub-objects: 'ethereum' containing base_fee_gwei, gas_price_gwei, priority_fee_gwei, and transfer_cost_eth; and 'solana' containing base_fee_lamports, median_priority_fee_micro_lamports, and transfer_cost_sol.

## 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",
     "properties": {}
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ts": 1767225600,
  "solana": {
   "base_fee_lamports": 5000,
   "transfer_cost_sol": 0.0000052,
   "median_priority_fee_micro_lamports": 1000
  },
  "ethereum": {
   "base_fee_gwei": 0.4,
   "gas_price_gwei": 0.42,
   "priority_fee_gwei": 0.02,
   "transfer_cost_eth": 0.0000088
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/ethereum-solana-gas-price-api-021d66c0/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.agent-data.workers.dev](https://www.zero.xyz/host/api.agent-data.workers.dev/llms.txt)
