Authenticating
To authenticate when using Sei RPCs, you need to include an authorization header with your API key as the bearer token.
As an example:
curl "https://<endpoint>" -H 'Authorization: Bearer <your API key>'
SEI Supported RPC Method Endpoints
You can use the different Sei RPC methods through different paths on your endpoint. You can view your specific endpoint on the dashboard .
| RPC Methods | HTTP Endpoint | WebSocket Endpoint |
|---|---|---|
| Sei | https://<endpoint>/sei | wss://<endpoint>/sei/websocket |
| Ethereum | https://<endpoint>/eth | wss://<endpoint>/eth/websocket |
| Tendermint | https://<endpoint>/tendermint | wss://<endpoint>/tendermint/websocket |
| Cosmos | https://<endpoint>/cosmos | N/A |
| CosmWasm | https://<endpoint>/cosmwasm | N/A |
Please refer to the full Sei documentation for the latest methods available through these method sets.
WebSocket Connections
WebSocket connections are available for Ethereum RPC methods, enabling real-time event subscriptions and streaming data.
Endpoints:
wss://<endpoint>/eth/websocketwss://<endpoint>/sei/websocket(alias to eth/websocket)
Authentication: Include your API key in the connection headers:
const WebSocket = require('ws');
const ws = new WebSocket('wss://<endpoint>/websocket', {
headers: {
'Authorization': 'Bearer <your API key>'
}
});
ws.on('open', () => {
// Send JSON-RPC requests
ws.send(JSON.stringify({
jsonrpc: '2.0',
method: 'eth_blockNumber',
params: [],
id: 1
}));
});
ws.on('message', (data) => {
const response = JSON.parse(data);
console.log('Response:', response.result);
});Supported Methods:
All standard Ethereum JSON-RPC methods are supported over WebSocket, including subscriptions via eth_subscribe.
Archival Data
You can access archival data by prepending archive. to your endpoint. Such as https://archive.<endpoint> .
