Logo
New RPC users get 35% off their first monthView the offer
RPC Assistant

What is the Base public RPC URL and which dev tools should you use with it?

Summary

The Base public RPC URL is a shared, no-key HTTP endpoint that lets you read chain data and send transactions to Base mainnet. OnFinality publishes a public endpoint at https://base.api.onfinality.io/public, and the Base Sepolia testnet equivalent is https://base-sepolia.api.onfinality.io/public. Public endpoints are ideal for prototyping, scripts, and low-volume reads, but they are shared infrastructure, so heavy or latency-sensitive workloads should move to a dedicated or managed RPC plan.

This page explains the chain settings you need (chain ID 8453 for mainnet, 84532 for Sepolia), how to wire the endpoint into common dev tools such as viem, ethers, Foundry, Hardhat, and wallet network configs, and how to decide when a public URL is enough versus when you need dedicated nodes. It also covers the failure modes you will hit first — rate limits, missing archive or trace methods, and WebSocket gaps — and how to debug them.

Chain settings at a glance

Before you paste an endpoint into any tool, confirm the four values that Base tooling checks first: the RPC URL, the chain ID, the native currency, and the block explorer. Getting the chain ID wrong is the most common reason a wallet or framework silently connects to the wrong network.

SettingBase mainnetBase Sepolia testnet
RPC URL (public)https://base.api.onfinality.io/publichttps://base-sepolia.api.onfinality.io/public
Chain ID845384532
Chain nameBaseBase Sepolia Testnet
Native currencyETH (18 decimals)ETH (18 decimals)
Block explorerhttps://basescan.orghttps://sepolia.basescan.org
TransportHTTPHTTP

Base is an OP Stack L2, so it behaves like an EVM chain: the same JSON-RPC methods, the same address format, and the same tooling. The only meaningful differences from Ethereum mainnet are the chain ID, the sequencer-driven block times, and the fact that some data (like L1 gas accounting) is exposed through L2-specific methods.

When a public RPC URL is the right fit

A public endpoint is the fastest way to get unblocked. It needs no API key, no signup, and no billing relationship, which makes it a good default for the first hour of a project. But it is shared infrastructure, so it comes with tradeoffs you should understand before you ship.

Use a public Base RPC URL when:

  • You are prototyping, writing a tutorial, or running a one-off script.
  • You need to read balances, call view functions, or estimate gas at low volume.
  • You are testing wallet network configuration or a faucet flow on Base Sepolia.
  • You want a fallback endpoint behind a primary provider.

Move to a managed or dedicated RPC plan when:

  • Your app sends a high volume of requests or bursts during peak hours.
  • You depend on eth_getLogs over wide block ranges, archive state, or trace methods.
  • You need WebSocket subscriptions for real-time events.
  • You need predictable throughput and a support path for production incidents.

OnFinality offers both shared RPC API access and dedicated nodes for Base, so you can start on the public endpoint and upgrade without changing your application code — only the URL changes. See RPC pricing for plan shapes and supported RPC networks for the full list.

Wiring the endpoint into common dev tools

The Base public RPC URL is a standard HTTP JSON-RPC endpoint, so it works anywhere an EVM RPC URL is accepted. Below are the patterns developers reach for most often.

curl and raw JSON-RPC

A quick sanity check that the endpoint is reachable and returning the expected chain ID:

curl -s https://base.api.onfinality.io/public \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'

You should get back "0x2105", which is 8453 in hex. If you get a different value, you are pointed at the wrong network.

viem

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

const client = createPublicClient({
  chain: base,
  transport: http('https://base.api.onfinality.io/public'),
})

const block = await client.getBlockNumber()
console.log(block)

ethers v6

import { JsonRpcProvider } from 'ethers'

const provider = new JsonRpcProvider(
  'https://base.api.onfinality.io/public',
  { chainId: 8453, name: 'base' }
)

const fee = await provider.getFeeData()
console.log(fee)

Foundry

forge create src/MyContract.sol:MyContract \
  --rpc-url https://base.api.onfinality.io/public \
  --private-key $PRIVATE_KEY

Or set it once in foundry.toml:

[rpc_endpoints]
base = "https://base.api.onfinality.io/public"

Hardhat

// hardhat.config.js
module.exports = {
  networks: {
    base: {
      url: 'https://base.api.onfinality.io/public',
      chainId: 8453,
    },
    baseSepolia: {
      url: 'https://base-sepolia.api.onfinality.io/public',
      chainId: 84532,
    },
  },
}

Wallet network configuration

Most wallets accept a custom network object. The fields map directly to the table at the top of this page:

{
  "chainId": "0x2105",
  "chainName": "Base",
  "nativeCurrency": { "name": "Ether", "symbol": "ETH", "decimals": 18 },
  "rpcUrls": ["https://base.api.onfinality.io/public"],
  "blockExplorerUrls": ["https://basescan.org"]
}

If you are testing, swap in the Sepolia values and chain ID 0x14a34 (84532).

Base Sepolia: faucet, testnet settings, and debugging

Base Sepolia is the testnet most teams use before mainnet deploys. It mirrors mainnet settings except for the chain ID and explorer. You will need test ETH from a Base Sepolia faucet before you can deploy or send transactions.

Common testnet gotchas:

  • Wrong chain ID. If your tool reports a chain ID mismatch, check whether you are using 8453 (mainnet) where you meant 84532 (Sepolia).
  • No test ETH. Transactions fail with insufficient funds even though the endpoint is healthy. Grab test ETH from a faucet first.
  • Stale nonce. If you sent a transaction that never confirmed, the next one may fail with a nonce error. Reset the account nonce in your wallet or use a fresh key.
  • Explorer mismatch. Sepolia transactions appear on sepolia.basescan.org, not basescan.org. If you cannot find a transaction, you are probably on the wrong explorer.

For a dedicated testnet endpoint, see the Base Sepolia network page.

Public vs managed vs dedicated: what changes

Public endpoints and paid plans speak the same JSON-RPC protocol, so migration is usually a URL swap. What changes is the operational envelope around that URL.

DimensionPublic endpointManaged RPC APIDedicated node
API key requiredNoYesYes
ThroughputShared, best-effortPlan-basedReserved for you
Archive / trace methodsLimitedPlan-dependentConfigurable
WebSocket supportNot guaranteedOften availableConfigurable
Support pathCommunityProvider supportProvider support
Best forPrototypes, scriptsProduction appsHigh-volume or custom workloads

OnFinality provides managed RPC API access and dedicated nodes for Base and many other networks. If you are evaluating providers more broadly, the RPC provider selection guide walks through the criteria that matter for production.

Failure modes and how to debug them

When a Base RPC call fails, the error usually points to one of a handful of causes. The table below maps symptoms to likely fixes.

SymptomLikely causeFix
429 Too Many RequestsShared endpoint rate limitBack off, batch calls, or move to a managed plan
method not foundMethod not enabled on public endpointUse a provider that supports archive/trace methods
Timeout on eth_getLogsRange too wide for shared infraNarrow the block range or use a dedicated node
nonce too lowStuck or duplicated transactionReset nonce or use a fresh account
WebSocket disconnectPublic endpoints may not guarantee WSUse a provider with WebSocket support
Chain ID mismatchWrong endpoint for the networkConfirm 8453 vs 84532

A simple monitoring probe can tell you whether the endpoint is healthy before you blame your code:

curl -s -o /dev/null -w "%{http_code} %{time_total}s\n" \
  -X POST https://base.api.onfinality.io/public \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'

Run this on a schedule and alert on non-200 responses or rising latency. It is a cheap way to catch endpoint problems before your users do.

Choosing between Base mainnet and Sepolia

Use mainnet when you are interacting with real value, real users, or production contracts. Use Sepolia when you are developing, testing upgrades, or running CI. Keep the two configurations separate in your codebase — for example, an environment variable that switches the RPC URL and chain ID together — so you never accidentally point a test script at mainnet.

A practical pattern is to define both networks in your config and select by environment:

const NETWORKS = {
  mainnet: { url: 'https://base.api.onfinality.io/public', chainId: 8453 },
  sepolia: { url: 'https://base-sepolia.api.onfinality.io/public', chainId: 84532 },
}

const net = NETWORKS[process.env.BASE_NETWORK || 'sepolia']

This keeps the endpoint, chain ID, and explorer aligned and makes the mainnet/testnet boundary explicit.

Key Takeaways

  • The Base public RPC URL is https://base.api.onfinality.io/public for mainnet (chain ID 8453) and https://base-sepolia.api.onfinality.io/public for Sepolia (chain ID 84532).
  • Public endpoints are ideal for prototyping, scripts, and low-volume reads, but they are shared and best-effort.
  • Base uses standard EVM JSON-RPC, so the same endpoint works in viem, ethers, Foundry, Hardhat, and wallet configs.
  • The most common failures are rate limits, missing archive/trace methods, WebSocket gaps, and chain ID mismatches.
  • When you outgrow the public endpoint, you can move to managed RPC or dedicated nodes without changing application code.
  • Check RPC pricing and supported networks before you commit to a plan.

Frequently Asked Questions

What is the Base public RPC URL?

OnFinality publishes a public Base mainnet endpoint at https://base.api.onfinality.io/public. It is a shared HTTP JSON-RPC endpoint that requires no API key.

What is the Base chain ID?

Base mainnet uses chain ID 8453. Base Sepolia uses chain ID 84532.

Is the Base public RPC URL good for production?

It can work for low-volume production traffic, but shared endpoints are best-effort. For predictable throughput, archive or trace methods, or WebSocket subscriptions, use a managed or dedicated plan.

Does the Base public RPC support WebSocket?

Public endpoints typically expose HTTP only. If your app relies on WebSocket subscriptions, choose a provider that offers WebSocket transport.

How do I switch from a public endpoint to a dedicated node?

In most cases you change the RPC URL in your config or environment variable. The JSON-RPC interface stays the same, so application code does not need to change.

Where can I find Base Sepolia testnet settings?

See the Base Sepolia network page for the testnet RPC URL, chain ID, and explorer.

Next steps

Start with the public endpoint to unblock development, then plan your production path. If you expect sustained traffic, wide log queries, or real-time subscriptions, compare RPC pricing and review supported RPC networks to see where OnFinality can host your Base workload. For a broader evaluation framework, read the RPC provider selection guide.

RPC Knowledge Base

Related RPC details

Never Worry about Infrastructure Again

OnFinality takes away the heavy lifting of DevOps so you can build smarter and faster.

Get Started