---
title: "Base RPC Endpoint Documentation"
description: "Use ERPC as your Base RPC endpoint for HTTP JSON-RPC requests and WebSocket subscriptions, with the tokens each method uses and worked examples."
canonical: "https://erpc.global/en/doc/base-rpc/general/"
locale: "en"
---

# Base RPC Endpoint Documentation

## Base RPC Endpoint Documentation

Use ERPC as your Base RPC endpoint for HTTP JSON-RPC requests and WebSocket subscriptions. Base RPC is part of ERPC's RPC APIs within our Global Edge Blockchain Infrastructure, and the API key can be managed from the ERPC Web Dashboard.

You can use the same RPC key as Solana, Ethereum, and Avalanche.

Please add your API key to the `api-key` parameter.

### Endpoints

Send JSON-RPC 2.0 requests as HTTP POST to:

```text
https://edge.erpc.global/base?api-key=<YOUR_API_KEY>
```

For subscriptions, connect over WebSocket to:

```text
wss://edge.erpc.global/base?api-key=<YOUR_API_KEY>
```

The shared host `edge.erpc.global` accepts Base RPC requests at `/base` and `/base/`. The existing host `base.erpc.global` remains available at `/`, and you can connect to both hosts with the same RPC key.

### Examples

Here is an HTTP request example.

```bash
curl 'https://edge.erpc.global/base?api-key=<YOUR_API_KEY>' --header 'Content-Type: application/json' --data '{
  "jsonrpc":"2.0","id":1,
  "method":"eth_blockNumber"
}'
```

You can obtain and check your API key on the ERPC Web Dashboard: [ERPC Web Dashboard](https://dashboard.erpc.global/en)

### Batch Requests

JSON-RPC batches of up to 256 calls per HTTP request are supported. Each call in a batch is metered as its own call.

### Usage Metering

Each call uses a fixed number of tokens set by its method. A call inside an HTTP batch and a call sent over a WebSocket connection each count once. On WebSocket, each connection and each subscription notification you receive also use tokens. The [API Usage](https://dashboard.erpc.global/en/user/api-usage) page of the dashboard shows each token as one credit.

Calls over HTTP and WebSocket use these tokens per call:

| Method | Tokens per call |
| --- | --- |
| The 49 methods listed below | 81 |
| `eth_getLogs`, `eth_getFilterLogs`, `eth_callMany`, `eth_simulateV1`, `eth_sendRawTransactionSync`, `debug_getRawHeader`, `debug_getRawReceipts`, `debug_traceCall`, `trace_block`, `trace_call`, `trace_filter`, `trace_rawTransaction`, `trace_transaction` | 84 |
| `eth_sendRawTransaction`, `debug_getBadBlocks`, `debug_storageRangeAt`, `debug_traceBlock`, `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction` | 162 |
| `trace_callMany`, `trace_replayBlockTransactions`, `trace_replayTransaction` | 168 |
| Any method not in the rows above | 81 or 324 |

When you estimate, count a method in the "81 or 324" row as 324, the higher of the two values.

These methods use 81 tokens per call:

- `eth_*` (38): `eth_accounts`, `eth_blockNumber`, `eth_call`, `eth_chainId`, `eth_createAccessList`, `eth_estimateGas`, `eth_feeHistory`, `eth_gasPrice`, `eth_getBalance`, `eth_getBlockByHash`, `eth_getBlockByNumber`, `eth_getBlockReceipts`, `eth_getBlockTransactionCountByHash`, `eth_getBlockTransactionCountByNumber`, `eth_getCode`, `eth_getFilterChanges`, `eth_getProof`, `eth_getRawTransactionByHash`, `eth_getStorageAt`, `eth_getTransactionByBlockHashAndIndex`, `eth_getTransactionByBlockNumberAndIndex`, `eth_getTransactionByHash`, `eth_getTransactionCount`, `eth_getTransactionReceipt`, `eth_getUncleCountByBlockHash`, `eth_getUncleCountByBlockNumber`, `eth_hashrate`, `eth_maxPriorityFeePerGas`, `eth_mining`, `eth_newBlockFilter`, `eth_newFilter`, `eth_newPendingTransactionFilter`, `eth_signTransaction`, `eth_submitWork`, `eth_subscribe`, `eth_syncing`, `eth_uninstallFilter`, `eth_unsubscribe`
- `net_*` (3): `net_listening`, `net_peerCount`, `net_version`
- `web3_*` (2): `web3_clientVersion`, `web3_sha3`
- `optimism_*` (4): `optimism_outputAtBlock`, `optimism_rollupConfig`, `optimism_syncStatus`, `optimism_version`
- `base_*` (2): `base_sendRawTransactionValidity`, `base_transactionStatus`

The Base endpoint does not limit which methods you can send, so you can also call methods that are not listed. Whether such a method uses 81 or 324 tokens per call depends on the method. For the methods you called this calendar month (UTC), the Current rate column on the API Usage page shows the actual rate per call.

Every call that ERPC accepts is counted, even if its response is an error, including one with HTTP status `400` or `429`, or if the request ends with HTTP `502`. A request that ERPC refuses before accepting it is not counted, for example HTTP `400` (a missing API key, an invalid JSON-RPC request, or a batch of more than 256 calls), `401`, and `429` returned by ERPC when a request goes over your plan's limits.

On WebSocket (`wss://edge.erpc.global/base`), tokens are counted as follows:

| What is counted | Tokens |
| --- | --- |
| Each connection, once it opens | 10 |
| Each call you send over the connection, including `eth_subscribe` and `eth_unsubscribe` | Same as the table above (`eth_subscribe` is 81) |
| Each subscription notification you receive | 81 |
| Each message you send over the connection that cannot be read as a JSON-RPC call | 81 |
| Replies to your calls, including the subscription ID returned by `eth_subscribe` | 0 |

A subscription notification is an `eth_subscription` message the server sends after you subscribe with `eth_subscribe`. If one message carries several notifications, each one counts. The API Usage page shows the number of notifications in the `eth_subscription` row. Notifications are counted as they arrive, so one the server sent before it handled your `eth_unsubscribe` still counts if it arrives after the call. Once the connection is closed, no further notifications are counted.

A WebSocket message is also counted when ERPC accepts it, so it counts even if no response comes back. A connection that does not open (HTTP `403` on the Free plan, or `502` when the connection cannot be completed) and a message refused by the per-minute limit are not counted.

Ping and pong control frames are not counted. A ping your app sends as a text message is counted: as a message that cannot be read as a JSON-RPC call (81), or, if it is a JSON-RPC call such as `{"jsonrpc":"2.0","method":"ping"}`, by its method name; `ping` is not in the list and uses 324.

How many notifications arrive depends on the subscription. Base produces a block every 0.2 seconds ([Base documentation](https://docs.base.org/base-chain/network-information/block-building)), so a `newHeads` subscription receives 5 notifications per second, or 432,000 per day. A `logs` subscription receives one notification for each log that matches its `address` and `topics` filter.

WebSocket is not available on the Free plan (see Free Plan Limits below).

To estimate the tokens you use in a day or a month, add up these four:

- Calls × the tokens of each method, over HTTP and WebSocket
- WebSocket connections × 10
- Notifications received × 81
- Messages you send over WebSocket that cannot be read as a JSON-RPC call × 81

Here are examples for one day.

| One day of usage | Tokens | Calculation |
| --- | ---: | --- |
| 1,000,000 `eth_call` calls over HTTP | 81,000,000 | 1,000,000 × 81 |
| 10,000 `eth_sendRawTransaction` calls over HTTP | 1,620,000 | 10,000 × 162 |
| One `newHeads` subscription for a day (1 connection, 1 `eth_subscribe`, 432,000 notifications) | 34,992,091 | 10 + 81 + 432,000 × 81 |
| One `logs` subscription for a day (1 connection, 1 `eth_subscribe`, 10,000 matching logs) | 810,091 | 10 + 81 + 10,000 × 81 |
| `eth_blockNumber` over HTTP every 10 seconds (8,640 calls) | 699,840 | 8,640 × 81 |

Kept open for 30 days, a `newHeads` subscription receives 12,960,000 notifications, which use 1,049,760,000 tokens on their own. Each reconnect adds 10 for the connection and 81 for `eth_subscribe`.

If you do not need every block, reading the value over HTTP only when you need it uses fewer tokens. Polling `eth_blockNumber` every 10 seconds uses 699,840 tokens a day, about 1/50 of the 34,992,091 that a `newHeads` subscription uses.

You can find the tokens included in each plan on the [Pricing](https://erpc.global/en/price/) page.

### Free Plan Limits

On the Free plan, your account can send one request per 10 seconds. The limit is counted per account, not per endpoint, so a request to another chain can also count toward it. A request sent sooner is answered with HTTP `429`, and the `retry-after` header gives the wait in seconds.

On the Free plan, a request that carries two or more JSON-RPC calls is answered with HTTP `429`, and none of its calls is sent: each call gets a JSON-RPC error with code `-32041`. Send these calls one at a time instead.

On the Free plan, WebSocket connections are not available and are answered with HTTP `403`.

### Supported Methods

Base is EVM-compatible and uses the same JSON-RPC methods as Ethereum. ERPC does not apply a fixed method allowlist to the Base endpoint. For the Ethereum method families, see the [Ethereum RPC Endpoint Documentation](https://erpc.global/en/doc/ethereum-rpc/general/).

### Response Status Codes

| HTTP status | Meaning |
| --- | --- |
| 200 | Upstream JSON-RPC response. |
| 400 | `Missing API key`, `Invalid JSON-RPC request`, or `JSON-RPC batch exceeds 256 calls`. |
| 401 | `Unauthorized API KEY`. |
| 403 | A WebSocket connection on the Free plan. |
| 404 | Requests to paths not supported for Base RPC. |
| 429 | Rate limited, including the Free plan limits above: more than one request per 10 seconds, or two or more calls in one request. The `retry-after` header gives the wait in seconds. |
| 502 | The upstream RPC request could not be completed. |
| 503 | The service is temporarily unavailable. |

WebSocket connections use `101` (protocol upgrade accepted) in addition to the codes above.

### Base RPC Methods and Documentation

For the full list of standard methods, parameters, and specifications, please refer to the official documentation.

[https://docs.base.org/get-started/connect-to-base](https://docs.base.org/get-started/connect-to-base)
