Optimism
Bereit, das in der Produktion aufzurufen?
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
Optimism
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
TheRPC is a managed JSON-RPC provider that gives you fast, authenticated access to OP Mainnet without running your own OP Stack node. Developers building on the Superchain — from Velodrome and Synthetix integrations to indexers and wallets — use it for reliable reads and transaction broadcasting against chain ID 10. This guide takes you from zero to a working call in a few minutes: grab an API key, point your client at the OP Mainnet endpoint, and run your first request in curl, JavaScript, or Python.
Sign up for a free account at TheRPC.io, then open the Dashboard and go to the API Keys section to create a new key or retrieve an existing one. The key is a single secret string; you'll place it in the OP Mainnet endpoint URL (https://optimism.therpc.io/YOUR_API_KEY) and in the Authorization: Bearer header on every request.
TheRPC serves many networks from a single account, each at its own endpoint host. To target OP Mainnet, set your environment to the OP Mainnet endpoint URL with your API key, as shown below. The same key works across every network you have access to — only the host changes.
Now make your first OP Mainnet call. The examples below show the same eth_blockNumber request three ways — curl, JavaScript, and Python — so you can pick whichever fits your stack. For more languages and full client setup, see the Tools & SDKs reference.
For anything beyond a single read, Web3 libraries are easier than hand-built HTTP calls: they handle ABI encoding, unit conversion, transaction signing, and retries for you, so reading a Velodrome pool or sending an ETH transfer on OP Mainnet becomes a few lines. The examples below wire web3.js and web3.py to the OP Mainnet endpoint; see the Tools & SDKs documentation for full, language-specific coverage.
The full list of methods TheRPC supports on OP Mainnet lives on the All Methods page, organized by namespace. Each method's reference includes a plain-English description, request and response formats, copy-paste code examples, and typical use cases — so you can move from this quick start to building real features quickly.
Each network TheRPC serves has its own endpoint host, so you select a chain simply by choosing its URL. For OP Mainnet the endpoint is https://optimism.therpc.io/YOUR_API_KEY over HTTP, with wss://optimism.therpc.io/YOUR_API_KEY for WebSocket subscriptions.