Optimism
Pronto para usar isso em produção?
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
Optimism
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
Rate limiting caps how many requests your API key can send to OP Mainnet in a given window. TheRPC applies it to keep the service fast and fair for everyone and to protect the shared OP Stack infrastructure from spikes. Limits are enforced at several levels — per-second, per-minute, and per-day request counts, plus a ceiling on concurrent connections. The exact numbers depend on your subscription plan and are always visible in the dashboard, so you can see where you stand before you hit a wall.
When you exceed a limit on OP Mainnet, TheRPC returns a JSON-RPC error with code -32029 and the message "Rate limit exceeded" instead of a result. Alongside it, the HTTP response carries rate-limit metadata in its headers — X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset — so your client can see how much budget is left and when the window resets without guessing.
Three strategies keep your OP Mainnet workload comfortably under the limits. First, retry rate-limited requests with exponential backoff so transient -32029 errors recover on their own. Second, batch independent reads into a single JSON-RPC request to cut round trips. Third, replace polling with WebSocket subscriptions via eth_subscribe so you receive new ~2-second blocks and logs as pushes instead of repeatedly asking. The sections below show each in practice.
For real-time data on OP Mainnet, eth_subscribe over WebSocket eliminates polling overhead entirely: instead of hammering the endpoint for the latest block every couple of seconds, you open one persistent connection and the server pushes newHeads and matching logs to you as they happen. That dramatically lowers your request count and keeps you well under your rate limit. See the eth_subscribe reference for subscription types and examples.
X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset on each response to throttle in real time.Manage your OP Mainnet quota programmatically by reading the rate-limit headers off each response — X-RateLimit-Remaining tells you how many calls are left and X-RateLimit-Reset when the window rolls over, so your client can pace itself instead of blindly retrying. Pair that with response caching: values that change slowly, like contract bytecode from eth_getCode or a confirmed receipt, can be cached locally so you don't re-fetch them, cutting your request volume and stretching your quota further.
Plans differ across several dimensions for OP Mainnet: the request rate per second, the daily request quota, the number of concurrent WebSocket connections, and how many active subscriptions you can hold. Higher tiers also unlock heavier capabilities — archive data for historical state queries, the debug_ methods, and the trace_ API — which are essential for indexers and analytics on the Superchain. Compare the tiers side by side on the pricing page to find the right fit.
eth_subscribe to slash request counts for real-time data.