Skip to content
Docs

Gas

Read fee rates

Current slow, average, and fast fee tiers, with the unit the values are expressed in.

Endpoint

GET/v1/gas/fees
Request
curl -sS "https://blockchain.gray3.io/v1/gas/fees?chainId=ethereum" \
  -H "X-Gray-Project-Id: proj_your_project_id" \
  -H "Authorization: Bearer gray_sk_your_secret"

Response

HTTP 200 — success envelope wraps the payload in data.

json
{
  "data": {
    "chainId": "ethereum",
    "slow": { "maxFeePerGas": "25000000000", "maxPriorityFeePerGas": "1000000000" },
    "average": { "maxFeePerGas": "30000000000", "maxPriorityFeePerGas": "1500000000" },
    "fast": { "maxFeePerGas": "35000000000", "maxPriorityFeePerGas": "2000000000" },
    "unit": "wei",
    "source": "indexer"
  }
}

The unit field names the unit of every fee value in the response: wei on EVM chains, sat/vB on UTXO chains (koinu/vB on Dogecoin), piconero/byte on Monero, and the chain's native fee unit on other chains. Read unit before converting fees for display rather than assuming wei.

Works on testnet chain IDs where fee data is supported.

Errors

Errors use HTTP { "error": { "code", "message", "retryable" } }. Branch on code, not the message text.

Every authenticated route may also return unauthorized (401), revoked_secret (401), forbidden (403), credits_exhausted (402), plan_feature_denied (403), rate_limit_exceeded (429, retryable), and invalid_argument (413) for request bodies over 256 KiB.

CodeHTTPWhen
invalid_argument400Missing or malformed chainId, address, or body fields
plan_chain_denied403chainId is not on the project plan
chain_disabled403Chain turned off in Console › Networks
unsupported_capability400Capability not offered for this chain (e.g. testnet prices)
invalid_argument400Missing chainId or from address on estimate
gas_unavailable503Gas provider failed (retryable)
simulation_failed400Estimate could not simulate the call (use /transactions/simulate for full dry-run)
json
{
  "error": {
    "code": "invalid_argument",
    "message": "Human-readable detail (may be sanitized).",
    "retryable": false
  }
}