Documentation

Quick start

ChainRPC is a standard JSON-RPC endpoint. Use it with any client — ethers.js, viem, web3.js, MetaMask, Hardhat, Foundry.

Endpoint format

https://{chain}.chainrpc.net/{your_api_key}

Replace {chain} with any supported chain subdomain and {your_api_key} with your key.

Example: ethers.js

import { JsonRpcProvider } from 'ethers';

const provider = new JsonRpcProvider(
  'https://base.chainrpc.net/rpk_YOUR_KEY'
);
const block = await provider.getBlockNumber();
console.log(block);

Example: viem

import { createPublicClient, http } from 'viem';
import { base } from 'viem/chains';

const client = createPublicClient({
  chain: base,
  transport: http('https://base.chainrpc.net/rpk_YOUR_KEY'),
});

Example: curl

curl -X POST https://base.chainrpc.net/rpk_YOUR_KEY \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

Example: MetaMask

Settings → Networks → Add Network → paste:

https://base.chainrpc.net/rpk_YOUR_KEY

Supported chains

ChainSubdomainChain ID
Ethereumethereum.chainrpc.net1
Basebase.chainrpc.net8453
Arbitrum Onearbitrum.chainrpc.net42161
Optimismoptimism.chainrpc.net10
Polygon PoSpolygon.chainrpc.net137
BNB Chainbsc.chainrpc.net56
Avalanche C-Chainavalanche.chainrpc.net43114
Gnosisgnosis.chainrpc.net100
Ethereum Sepoliasepolia.chainrpc.net11155111
zkSync Erazksync.chainrpc.net324
Linealinea.chainrpc.net59144
Scrollscroll.chainrpc.net534352
Blastblast.chainrpc.net81457
Mantlemantle.chainrpc.net5000
Polygon zkEVMpolygon-zkevm.chainrpc.net1101
Modemode.chainrpc.net34443
Zorazora.chainrpc.net7777777
Celocelo.chainrpc.net42220
Ethereum Sepoliasepolia.chainrpc.net11155111
Base Sepoliabase-sepolia.chainrpc.net84532

Authentication

Your API key goes in the URL path. No headers needed.

POST https://base.chainrpc.net/rpk_abc123def456...

All standard JSON-RPC methods are supported: eth_blockNumber, eth_call, eth_sendRawTransaction, eth_getLogs, etc.

Rate limits

TierRequests/dayRequests/secOverflowPrice
Free25,0003Blocked (429)$0
Growth500,00030$10 / million$29/mo
Pro5,000,000100$5 / million$99/mo

Paid tiers are never blocked. When you exceed your included requests, overflow is charged from your approved USDC/USDT balance.

Response headers

X-RateLimit-Limit: 25000
X-RateLimit-Remaining: 18402
X-RateLimit-Reset: 1713052800
X-Chain: base
X-Cache: HIT
X-Overflow: true  ← only present when over included limit

Billing

Paid subscriptions use USDC or USDT on Base (chain ID 8453).

  1. Link your wallet address to your key
  2. Approve our billing contract for the desired amount
  3. We pull your subscription monthly + overflow charges
  4. Revoke approval anytime to cancel — no forms, no emails

Your USDC/USDT stays in your wallet until we pull it. You remain in full control.

Cancel

Three ways to stop paying:

If a pull fails, your key reverts to free tier. No penalty, no debt.

Caching

ChainRPC caches responses for common methods. Cache hits return in <2ms.

MethodTTL
eth_chainId24 hours
net_version24 hours
eth_getCode24 hours
eth_getTransactionReceipt24 hours
eth_blockNumber2 seconds
eth_gasPrice5 seconds
eth_call5 seconds
eth_getBalance10 seconds
eth_getLogs30 seconds
eth_sendRawTransactionNever cached

The X-Cache: HIT or X-Cache: MISS header indicates whether the response came from cache.

Errors

HTTPMeaning
200Success (check JSON-RPC error field for RPC-level errors)
400Unknown chain (check subdomain)
401Invalid API key
429Rate limited (free tier) or burst limit exceeded
503Upstream chain node unavailable
504Upstream timeout (30s)