Gas
Read fee rates
Current slow, average, and fast fee tiers, with the unit the values are expressed in.
Endpoint
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.
{
"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.
| Code | HTTP | When |
|---|---|---|
| invalid_argument | 400 | Missing or malformed chainId, address, or body fields |
| plan_chain_denied | 403 | chainId is not on the project plan |
| chain_disabled | 403 | Chain turned off in Console › Networks |
| unsupported_capability | 400 | Capability not offered for this chain (e.g. testnet prices) |
| invalid_argument | 400 | Missing chainId or from address on estimate |
| gas_unavailable | 503 | Gas provider failed (retryable) |
| simulation_failed | 400 | Estimate could not simulate the call (use /transactions/simulate for full dry-run) |
{
"error": {
"code": "invalid_argument",
"message": "Human-readable detail (may be sanitized).",
"retryable": false
}
}