Summary
A public Base RPC URL is a shared, no-signup HTTP endpoint that lets your app read Base chain data and broadcast transactions. It is the fastest way to connect a wallet, script, or prototype to Base, but it is shared infrastructure with no availability commitment, so it is best for development and light traffic rather than production workloads.
This article explains what the Base public endpoint actually is, how to add it to a wallet, how to call it with curl and viem, and when to move to managed or dedicated RPC infrastructure such as OnFinality for predictable production behavior.
A public Base RPC URL is a shared HTTP endpoint that lets any application read Base chain data and submit transactions without running a node. You paste it into a wallet, a script, or an SDK, and it answers JSON-RPC calls such as eth_blockNumber, eth_getBalance, and eth_sendRawTransaction. It is the fastest way to get connected to Base, and it is also the endpoint most teams outgrow first.
The important part is not the definition. It is knowing which jobs a public endpoint handles well, which jobs it does not, and what to switch to when your app stops being a prototype. This page answers that directly, then gives you the connection details, request examples, and a migration path.
Is a public Base RPC URL the right choice for your workload?
Use this quick triage before you wire anything into a codebase you intend to ship.
| Your situation | Public Base RPC URL | What to move to |
|---|---|---|
| Adding Base to a wallet to check a balance | Fine | Nothing |
| Local scripts, notebooks, one-off tests | Fine | Nothing |
| Hackathon demo or internal prototype | Usually fine | Managed RPC before any public launch |
| Testnet development on Base Sepolia | Fine for iteration | Managed testnet RPC for CI and staging |
| Production dApp with real users | Not recommended | Managed or dedicated RPC |
| Indexer, bot, or high-frequency polling | Not recommended | Dedicated node |
Archive queries or heavy eth_getLogs | Not recommended | Archive-capable RPC |
If you are in the top three rows, a public endpoint is genuinely the right tool and you can stop reading after the connection section. If you are in the bottom four, the rest of this article explains what changes and how to plan the move.
What "public" actually means for a Base endpoint
Public does not mean free of rules. It means the endpoint is operated for general use rather than provisioned for your account. Three properties follow from that, and they explain almost every problem developers hit with public endpoints.
It is shared. Your requests compete with everyone else's. Throughput and latency vary with total demand, not with your application's needs.
There is no availability commitment. A public endpoint is offered as-is. It may rate-limit, throttle bursts, or return errors under load. That is acceptable for a demo and risky for a checkout flow.
There is no support path. If a request fails at 2am, there is no ticket, no status page tied to your account, and no one to escalate to. You debug it yourself.
None of this makes public endpoints bad. It makes them a specific tool with a specific scope.
Base chain settings at a glance
These are the values you need to add Base or Base Sepolia to a wallet, SDK, or config file. Keep the chain ID and native currency consistent with the network you are targeting, because mixing mainnet and testnet settings is one of the most common setup mistakes.
| Setting | Base mainnet | Base Sepolia testnet |
|---|---|---|
| Chain ID | 8453 | 84532 |
| Chain name | Base | Base Sepolia Testnet |
| Native currency | ETH (18 decimals) | ETH (18 decimals) |
| Block explorer | https://basescan.org | https://sepolia.basescan.org |
| Public RPC URL | https://base.api.onfinality.io/public | https://base-sepolia.api.onfinality.io/public |
For network-specific details and transport support, see the Base RPC page and the Base Sepolia RPC page.
Adding Base to a wallet
Most wallets accept a custom network. The fields map directly to the table above:
Network name: Base
RPC URL: https://base.api.onfinality.io/public
Chain ID: 8453
Symbol: ETH
Explorer: https://basescan.org
For testnet work, switch to the Base Sepolia values and use the Sepolia explorer. If the wallet reports a chain ID mismatch, you have almost certainly pasted a testnet RPC URL with a mainnet chain ID, or the reverse.
Calling the endpoint with curl and viem
The simplest sanity check is a raw JSON-RPC call. This returns the current block height:
curl -s https://base.api.onfinality.io/public \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'
A successful response looks like {"jsonrpc":"2.0","id":1,"result":"0x..."}. If you get a JSON-RPC error object instead, read the error.code and error.message fields before assuming the endpoint is down.
In application code, the same endpoint plugs into any EVM client. With 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()
const balance = await client.getBalance({
address: '0x0000000000000000000000000000000000000000',
})
console.log({ block, balance })
Because the transport is a plain HTTP URL, you can swap it for a managed or dedicated endpoint later by changing one string. That is the main reason to keep the RPC URL in an environment variable from day one rather than hardcoding it across files.
Where public endpoints start to break down
Public Base RPC URLs fail in predictable ways. Recognizing the symptom tells you whether you have a code bug or an infrastructure limit.
| Symptom | Likely cause | First fix |
|---|---|---|
| Intermittent 429 responses | Shared rate limiting | Reduce polling, batch requests, or move to managed RPC |
| Requests time out during traffic spikes | Shared capacity | Add retries with backoff, then move off public |
eth_getLogs returns range errors | Log query limits | Narrow block ranges or use an archive-capable provider |
| Transactions stuck as pending | Congestion or nonce issues | Check nonce handling and gas settings |
| Works locally, fails in CI | No retry logic, no fallback | Add a second endpoint and retry policy |
If you see the first three rows, the endpoint is the constraint, not your code. That is the signal to plan a migration rather than tune your application further.
What changes when you move to managed or dedicated RPC
Managed RPC gives you an endpoint tied to your account, with a support path and capacity that is not shared with anonymous traffic. Dedicated node infrastructure goes further: you get a node provisioned for your workload, which matters for indexing, high-frequency polling, archive queries, and anything that needs consistent behavior under load.
OnFinality provides both RPC API access and dedicated node infrastructure across a range of networks, including Base. If you are evaluating options, the RPC pricing page shows how plans are structured, and the supported networks list shows what is available. For a structured evaluation method, see how to choose an RPC provider.
A practical migration checklist:
- Move the RPC URL into an environment variable if it is not already.
- Add a fallback endpoint and a retry policy with exponential backoff.
- Log request latency and error rates so you can compare before and after.
- Test archive and log queries against the new endpoint before cutting over.
- Run both endpoints in parallel briefly, then switch traffic.
Testnet work on Base Sepolia
Base Sepolia behaves like mainnet for tooling purposes, with a different chain ID and a faucet for gas. Use the testnet endpoint for CI, staging, and contract deployment rehearsals, and keep it separate from your mainnet configuration so a misconfigured environment variable cannot send test transactions to production.
A useful pattern is a single config object keyed by environment:
const RPC = {
mainnet: 'https://base.api.onfinality.io/public',
testnet: 'https://base-sepolia.api.onfinality.io/public',
}
const rpcUrl = RPC[process.env.CHAIN_ENV ?? 'testnet']
This keeps the public endpoint as a sensible default for local work while making the production endpoint an explicit choice.
Key Takeaways
- A public Base RPC URL is a shared HTTP endpoint for reading Base data and sending transactions, with no signup and no availability commitment.
- It is the right choice for wallets, scripts, prototypes, and testnet iteration.
- It is the wrong choice for production dApps, indexers, bots, and heavy log or archive queries.
- Base mainnet uses chain ID 8453; Base Sepolia uses 84532. Keep them in separate configs.
- Keep the RPC URL in an environment variable so migrating to managed or dedicated RPC is a one-line change.
- OnFinality offers RPC API access and dedicated node infrastructure for Base and other networks; see RPC pricing and supported networks.
Frequently Asked Questions
Is a public Base RPC URL free? It is offered for general use without an account, which is why it is convenient for development. It is shared infrastructure, so it is not intended for production traffic or workloads that need consistent capacity.
What is the Base chain ID? Base mainnet uses chain ID 8453. Base Sepolia testnet uses chain ID 84532. Using the wrong chain ID with a given RPC URL is a common cause of wallet connection errors.
Can I use a public Base RPC URL in production? You can, but you should not rely on it. Shared endpoints can rate-limit or throttle under load, and there is no support path if something fails. Production apps typically move to managed or dedicated RPC.
Why does eth_getLogs fail on a public endpoint?
Log queries are expensive. Public endpoints often restrict the block range you can query in a single call. Narrow your range or use a provider that supports archive and wide-range log queries.
How do I switch from a public endpoint to a managed one? Change the RPC URL in your configuration. If you kept it in an environment variable and added retry logic, the migration is a config change rather than a code change.
Does OnFinality support Base? Yes. OnFinality provides RPC API access and dedicated node infrastructure for Base and Base Sepolia, alongside many other networks. See the Base network page for details.