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

Optimism RPC Endpoints for OP Mainnet

Optimism is a low-cost and lightning-fast Ethereum L2 blockchain

Connect to OP Mainnet through reliable Optimism RPC endpoints from OnFinality. Use HTTPS or WebSocket to query blocks, balances, transactions and smart contracts, submit transactions, subscribe to live blockchain events, and access historical state through Archive-enabled infrastructure.

For advanced Optimism workloads, OnFinality also provides Trace and Debug APIs, RPC analytics, scalable rate limits, and dedicated node infrastructure for production applications.

Chain ID10
CurrencyETH
Create a free API key for 400,000 response units per day and up to 40 response units/second. Method weights apply.

Public endpoint rate limit: 5 req/sec

Connect to Optimism RPC
curl -H 'Content-Type: application/json' -d '{"id":1,"jsonrpc":"2.0","method":"eth_blockNumber"}' 'https://optimism.api.onfinality.io/public'
curl -H 'Content-Type: application/json' -d '{"id":1,"jsonrpc":"2.0","method":"eth_blockNumber"}' 'https://optimism.api.onfinality.io/public'
HTTPs
https://optimism.api.onfinality.io/public
https://optimism.api.onfinality.io/public
Websocket
wss://optimism.api.onfinality.io/public-ws
wss://optimism.api.onfinality.io/public-ws
GET CONNECTED

Connect to Optimism

Trace OP Mainnet contract activity with OnFinality Optimism RPC. Combine archive reads, event logs and WebSocket subscriptions for Ethereum L2 app backends.

Try the public interface

First request
curl 'https://optimism.api.onfinality.io/public' \
  -H 'Content-Type: application/json' \
  --data '{"id":1,"jsonrpc":"2.0","method":"eth_blockNumber"}'

Use the interface and request shown above for an initial check, then test the methods and traffic pattern your application actually needs.

02

Create your own access

  1. Open the dashboard and select this network.
  2. Create an endpoint and copy the access details supplied by the dashboard.
  3. Validate your application's methods, peak traffic and error handling before production.
Create an RPC endpoint for Optimism
RPC API

RPC API plans & response units

Choose a shared RPC plan by response-unit allowance and peak throughput. Method weights and network-specific availability still apply.

Developer

Free
Included response units
400,000/day
Rate limit
Up to 40 RU/s
Extra RU
Not available

Accelerate

$249/month
Included response units
100 million/month
Rate limit
500 RU/s
Extra RU
$3.75/million
Compare RPC plans

Plan figures checked 8 November 2026. RU are not always raw requests; WebSocket responses also count toward limits. Check the current pricing and this network's method documentation. Node charges and applicable taxes are additional.

NETWORK REFERENCE

OP Mainnet RPC details

Network
OP Mainnet
Also Known As
Optimism
Chain ID
10
Currency
ETH
Protocol
EVM JSON-RPC
HTTPS
Supported
WebSocket
Supported
Archive Access
Supported
Trace / Debug
Supported on Paid Plans
Free Plan
Up to 40 RU/s
Regions
Hong Kong / France / N. Virginia
NETWORK REFERENCE

Optimism HTTPS RPC

Connect to OP Mainnet over HTTPS for standard EVM JSON-RPC reads, transaction submission, contract calls, and historical data queries.

API
https://optimism.api.onfinality.io/public

Optimism WebSocket RPC

Use the persistent WebSocket endpoint for subscriptions and event-driven applications that need live blockchain activity.

API
wss://optimism.api.onfinality.io/public-ws
NETWORK REFERENCE

Real-Time Optimism WebSocket RPC

Connect to OP Mainnet through persistent WebSocket RPC for real-time blockchain applications. Subscribe to new blocks, logs, and onchain events without continuously polling an HTTP endpoint.

eth_subscribeeth_unsubscribeeth_newFiltereth_newBlockFiltereth_newPendingTransactionFiltereth_getFilterChanges

The Optimism Foundation public RPC does not support standard WebSocket connections. OnFinality provides both HTTPS and WebSocket access for applications that need real-time OP Mainnet data.

NETWORK REFERENCE

Optimism Archive RPC

Query historical OP Mainnet state through OnFinality's Archive-enabled Optimism RPC infrastructure. Access historical blocks, balances, smart contract state, transactions, receipts, and event logs without operating your own archive node.

Historical Logs

Use eth_getLogs to retrieve historical contract events for DeFi analytics, accounting, transaction analysis, indexers, explorers, and audit tools.

API
eth_getLogs
NETWORK REFERENCE

Optimism Trace and Debug APIs

Inspect OP Mainnet transaction execution, debug failed contract calls, analyse internal transactions, and build advanced analytics using supported Trace and Debug APIs.

Trace APIs

trace_blocktrace_calltrace_callManytrace_filtertrace_replayTransactiontrace_replayBlockTransactions

Debug APIs

debug_traceTransactiondebug_traceCalldebug_traceBlockByHashdebug_traceBlockByNumber

Trace and Debug APIs are available on supported paid plans.

NETWORK REFERENCE

Supported Optimism RPC Methods

Use EVM-compatible JSON-RPC methods to read OP Mainnet state, query smart contracts, submit transactions, retrieve logs, subscribe to events, and inspect execution.

Blocks and Chain State

eth_blockNumbereth_chainIdeth_getBlockByHasheth_getBlockByNumbereth_getBlockReceipts

Accounts and Smart Contracts

eth_getBalanceeth_calleth_estimateGaseth_getCodeeth_getStorageAt

Transactions

eth_sendRawTransactioneth_getTransactionByHasheth_getTransactionReceipteth_getTransactionCount

Logs and Real-Time Events

eth_getLogseth_subscribeeth_getFilterChanges

Trace and Debug

trace_blocktrace_calltrace_filterdebug_traceTransactiondebug_traceCall
NETWORK REFERENCE

Query OP Mainnet Gas and Transaction Costs

Use standard EVM RPC methods such as eth_estimateGas, eth_gasPrice, and eth_feeHistory for OP Mainnet transaction workflows. Applications that need total transaction cost estimates should also account for the OP Stack L1 data fee.

eth_estimateGaseth_gasPriceeth_feeHistory
NETWORK REFERENCE

Build on OP Mainnet with OnFinality

DeFi Applications

Query contract state, pools, balances, transactions and events while submitting transactions through EVM-compatible OP Mainnet RPC.

Wallets and Exchanges

Query ETH and token balances, estimate transaction costs, submit signed transactions, retrieve receipts, and monitor deposits and withdrawals.

Real-Time Applications

Use WebSocket subscriptions to monitor new blocks, contract logs and live OP Mainnet activity without continuous HTTP polling.

Indexers and Analytics

Combine Archive access, eth_getLogs, transactions and receipts to build historical datasets, dashboards and blockchain analytics.

Smart Contract Debugging

Inspect transaction execution using Trace and Debug APIs for contract development, incident investigation and advanced analytics.

NETWORK REFERENCE

OP Mainnet and OP Sepolia RPC

OP MainnetOP Sepolia
Chain ID1011155420
CurrencyETHETH
HTTPSSupportedSupported
WebSocketSupportedSupported
EnvironmentProductionDevelopment / QA
NETWORK REFERENCE

Dedicated Optimism Nodes

Move from shared Optimism RPC access to dedicated OP Mainnet nodes when your workload needs isolated resources, sustained throughput, intensive Archive or Trace queries, or greater operational control.

Suitable for

  • High-volume RPC
  • Exchanges
  • Indexers
  • Archive-heavy analytics
  • Trace workloads
  • Latency-sensitive backends
  • Infrastructure isolation
BUILT FOR YOUR WORKLOAD

Build with Optimism

Plan access around the requests, operational requirements and release workflow your application needs.

Integration

Start with a connection check, then validate the reads, transactions or data workflows required by your application.

Usage planning

Review method-specific limits, plan allowances and usage before increasing traffic. Different methods can consume different response units.

Operations

Use your real client region and request pattern when evaluating latency, retries and service availability.

Never Worry about Infrastructure Again

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

Get Started