GoldRush JSON-RPC Quickstart
Header-based authentication
API keys are sent as anAuthorization: Bearer <key> header, never in the URL. The same GoldRush API key works across all GoldRush products.
Per-library setup
See the rendered reference for copy-paste examples. The pattern in each library:- ethers v6:
new ethers.FetchRequest(url)+.setHeader("Authorization", ...), pass tonew ethers.JsonRpcProvider(req) - viem:
http(url, { fetchOptions: { headers: { Authorization: ... } } }) - web3.js:
new Web3.providers.HttpProvider(url, { headers: [{ name, value }] }) - web3.py:
Web3.HTTPProvider(url, request_kwargs={"headers": {...}}) - curl:
-H "Authorization: Bearer $GOLDRUSH_API_KEY"
Endpoint shape
{chain} with one of: eth-mainnet, matic-mainnet, bsc-mainnet, arbitrum-mainnet, base-mainnet, hyperevm-mainnet, megaeth-mainnet, monad-mainnet, tempo-mainnet, solana-mainnet.
Prerequisites
Using any of the GoldRush developer tools requires an API key. If you already have a GoldRush key for any other GoldRush product (Foundational, Streaming, Pipeline, Hyperliquid, x402), you can use it as-is - JSON-RPC uses the same key.Vibe Coders
$10/mo - Built for solo builders and AI-native workflows.Teams
$250/mo - Production-grade with 50 RPS and priority support.1. Export your API key
Warning: Never commit your API key to source control. Use environment variables or a secrets manager.
2. Pick a chain
The endpoint shape is:{chain} with one of the supported chain slugs. For Ethereum mainnet, that’s eth-mainnet; for Solana, that’s solana-mainnet.
3. Make a request
The examples below target an EVM chain. For Solana, jump to step 3 (Solana).curl
ethers v6
viem
web3.js
web3.py
3. Make a request (Solana)
On Solana, the same endpoint shape and header auth apply; only the methods change. Here’s agetSlot call (the Solana equivalent of eth_blockNumber):
curl
@solana/kit
@solana/web3.js
python
4. Where to next
Authentication details
Header reference, error codes, key rotation tips.Method reference
Every method with parameters, returns, and code examples per chain. See the Solana method reference for Solana.Endpoint details
Archive,debug_*, trace_*, SLA.
Migration guides
Coming from Infura, Alchemy, or Ankr.GoldRush JSON-RPC authenticates every request by an
Authorization: Bearer HTTP header. Your API key never appears in the URL, keeping it out of server logs, browser history, screenshots, and error reports. This matches the pattern used across the rest of the GoldRush product family.
The same GoldRush API key works across every GoldRush product: Foundational, Streaming, Pipeline, Hyperliquid, x402, and JSON-RPC. One key, every product.
The header
Content-Type: application/json is required: JSON-RPC payloads are always JSON.
Per-library setup
viem, ethers, web3.js, and web3.py all support custom request headers, but the boilerplate differs slightly between them. Copy whichever one applies.
ethers v6
viem
web3.js
web3.py
curl
Error responses
Authentication and credit failures return the standard JSON-RPC error envelope with an HTTP status code matching the failure mode.| HTTP | JSON-RPC code | Meaning | Resolution |
|---|---|---|---|
401 Unauthorized | -32001 | Missing or malformed Authorization header | Add the Authorization: Bearer header |
403 Forbidden | -32002 | Key is valid but lacks JSON-RPC entitlement | Contact support to enable JSON-RPC |
402 Payment Required | -32003 | Insufficient credits | Top up your credit balance |
429 Too Many Requests | -32005 | Rate limit exceeded | Back off and retry after Retry-After |
Rotating keys
Generate a new key in the GoldRush dashboard, update your environment variable, and revoke the old one. There is no per-product key rotation: rotating once cycles the key for every GoldRush product.Tip: For zero-downtime rotation, set both the old and new key as accepted in your config, deploy with the new key, then revoke the old key once traffic has cut over.