Connecting to Solana RPC
Connect to RPC Fast Solana RPC over HTTPS and WebSocket, authenticate with your API key, and send your first requests from Rust, Python, or TypeScript.
Your account in the Solana dashboard can have multiple projects, for example one per application or environment. Each project has its own API key, ready-to-use HTTPS and WebSocket endpoints, and access settings, all shown on the project page. The maximum number of projects depends on your plan; see Pricing and Plans. See Getting Started if you don't have a project yet.
Endpoints
Mainnet
Frankfurt, Germany
https://solana-rpc.rpcfast.com/?api_key=<API_KEY>
wss://solana-rpc.rpcfast.com/?api_key=<API_KEY>
RPC nodes are hosted in Frankfurt, in the Equinix FR13 data center. For the lowest latency, deploy your application in the same data center or nearby.
HTTP requests are standard Solana JSON-RPC 2.0 POST requests, and WebSocket connections speak standard Solana PubSub, so any Solana SDK works without changes. See Solana RPC for the supported methods.
Authentication
RPC Fast authenticates every HTTP request and every WebSocket connection with your API key. There are two ways to pass it.
api_key query parameter (primary)
Append the key to the endpoint URL. This is the primary method: it is the format shown in the dashboard, and it works with every client, including WebSocket connections opened from a browser.
curl https://solana-rpc.rpcfast.com/?api_key=<API_KEY> \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"getSlot","params":[{"commitment":"confirmed"}]}'X-Token header (alternative)
Send the key in the X-Token HTTP header and use the endpoint URL without the query parameter. This keeps the key out of URLs, for example in logs of proxies you operate. It works with any client that can set custom headers, including WebSocket clients outside the browser (browser WebSocket APIs cannot set custom headers).
Authentication errors
401
-32000 API key is required
Neither the api_key query parameter nor the X-Token header was sent.
401
-32000 Provided API key is invalid
The key is unknown, revoked, or not enabled for this product.
403
-32007 IP address not allowed
The project has a Network access allowlist and the client IP is not on it.
403
-32600 Origin not allowed
The project has a Browser access allowlist and the browser Origin is not on it.
WebSocket connections are authenticated during the handshake; a rejected connection fails with the same HTTP status before any subscription is created.
You can restrict where your key may be used in the project Settings in the dashboard: Network access limits requests to listed IP addresses or CIDR ranges, and Browser access limits browser requests to listed origins.
Examples
The examples below read the key from the RPCFAST_API_KEY environment variable and fetch the current slot.
HTTP requests
Cargo.toml:
To authenticate with the X-Token header instead, build the client from a reqwest client with a default header (add solana-rpc-client = "3.1" and reqwest = "0.12"):
Without an SDK, send a plain JSON-RPC request:
With the Connection class from @solana/web3.js:
WebSocket subscriptions
Each example subscribes to slot updates, prints five slots, and exits.
Cargo.toml:
To use the X-Token header, pass additional_headers={"X-Token": API_KEY} to websockets.connect and drop the query parameter.