Prices
Get a single price
USD quotes for native or token assets on supported mainnets.
Endpoint
GET/v1/prices
Query
chainId required; address optional (native if omitted). Mainnet only.
Request
curl -sS "https://blockchain.gray3.io/v1/prices?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": {
"quotes": [
{
"chainId": "ethereum",
"priceUsd": "3200.12",
"pricedAt": "2026-10-15T08:00:00.000Z"
}
],
"failures": [],
"asOf": "2026-10-15T08:00:00.000Z",
"source": "aggregator"
}
}Single-token GET still returns TokenPricesResult with quotes[] and failures[] (often one quote or one failure row).
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 |
|---|---|---|
| unsupported_capability | 400 | Testnet chain id or feature disabled on testnets (prices, NFTs, DeFi, swap) |
| 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) |
| prices_batch_limit | 400 | More than 50 tokens in POST /v1/prices/multi |
| prices_unavailable | 503 | The price service is temporarily unavailable (retryable) |
json
{
"error": {
"code": "unsupported_capability",
"message": "Human-readable detail (may be sanitized).",
"retryable": false
}
}