Authentication
Your API key belongs to a cubestech project node.
Get a key
- Open the dashboard
Sign in to your dashboard.
- Create or open a project
Add a Solana node if the project has no node.
- Copy the node key
Open the node page and copy its API key.
- Store the key
Place the value in a secret manager or environment variable.
Authentication by product
| Product | Endpoint | Credential |
|---|---|---|
| JSON-RPC | https://api.mainnet-beta.solana.com | HTTP x-api-key |
| WebSocket | wss://ws.sol.cubestech.online | Upgrade header x-api-key |
| Yellowstone SDK | geyser.sol.cubestech.online:443:443 | SDK token argument, sent as x-token |
| Yellowstone raw client | geyser.sol.cubestech.online:443:443 | gRPC metadata x-api-key |
| Enhanced Streams | streams.sol.cubestech.online:443:443 | gRPC metadata x-api-key |
| Program Streams | events.sol.cubestech.online:443:443 | gRPC metadata x-api-key |
HTTP example
bash
curl https://api.mainnet-beta.solana.com \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{"jsonrpc":"2.0","id":1,"method":"getSlot"}'gRPC example
bash
grpcurl \
-H "x-api-key: YOUR_API_KEY" \
-import-path . \
-proto enhanced-streams.proto \
-d '{}' \
streams.sol.cubestech.online:443:443 \
nln.stream.v1.StreamService/ListTopicsKey rules
- Never put a key in a URL.
- Never ship a key in browser JavaScript.
- Never commit a key.
- Use one key per environment.
- Rotate exposed keys.
- Remove old keys after consumers move.
- Do not log request metadata.
A browser WebSocket has no custom header option. Open the cubestech WebSocket from your backend and relay selected events to the browser.