Logo
New RPC users get 35% off their first monthView the offer
Helius
Helius5 min read

Helius RPC API Key: How to Get, Use, and Secure It

A practical guide to the Helius RPC API key: where to find it, how to use it in endpoints, and how to keep it secure.

TL;DR

Your Helius RPC API key authenticates requests to Helius's Solana RPC endpoints. This guide explains how to obtain the key from the Helius dashboard, construct the correct RPC URL, use the key in code and tools, and apply security practices to protect it.

What Is a Helius RPC API Key?

A Helius RPC API key is a unique identifier that authenticates your requests to Helius's RPC infrastructure for the Solana blockchain. It associates usage with your account and enables access to Helius's services.

The key is typically a string of characters that you include in the endpoint URL or in request headers, depending on the service. It is distinct from other credentials you might use for Helius's enhanced APIs or gRPC services.

  • Authenticates requests to Helius RPC endpoints.
  • Links usage to your Helius account for monitoring and billing.
  • Required for most Helius RPC and API services.

How to Obtain Your Helius RPC API Key

To get your Helius RPC API key, you need a Helius account. Sign up or log in at the Helius dashboard (often referred to as helius.xyz or the Helius dev portal). Once inside, navigate to the API key management section.

If you are on a plan that includes multiple projects or keys, you may need to select or create a project first. The dashboard will display your API key, which you can copy for use in your applications.

  • Create or sign in to your Helius account.
  • Go to the dashboard and locate the API key section.
  • Copy your key and store it securely.

Constructing the Helius RPC URL with Your API Key

Helius provides RPC endpoints for Solana mainnet and devnet. The standard format for the RPC URL includes your API key as a path parameter or query parameter. Always refer to the Helius documentation for the most current URL structure.

A common pattern for the mainnet RPC endpoint is:

https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY

Using the API Key in Code and Tools

Once you have your Helius RPC URL with the API key, you can use it with Solana SDKs, wallets, and other tools that accept a custom RPC endpoint. For example, in JavaScript with @solana/web3.js, you might set the connection endpoint to your Helius URL.

When using command-line tools like solana-cli, you can set the RPC URL with the key as the default endpoint. Always avoid hardcoding the key in public repositories.

  • Use environment variables to store the API key.
  • Configure your Solana SDK or wallet with the full RPC URL.
  • Test the connection with a simple request like getHealth.
const { Connection } = require('@solana/web3.js');
const connection = new Connection('https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY');

Security Best Practices for Your Helius API Key

Your Helius RPC API key grants access to your account's resources, so treat it like a password. Avoid exposing it in client-side code, public repositories, or logs. Use server-side proxies or environment variables to keep it confidential.

If you suspect your key has been compromised, rotate it immediately in the Helius dashboard. Many providers allow you to generate new keys and revoke old ones.

  • Never commit keys to version control.
  • Use environment variables or secret managers.
  • Restrict key usage by domain or IP if supported.
  • Rotate keys periodically and after any exposure.

Troubleshooting Common API Key Issues

If your requests fail with authentication errors, double-check that you are using the correct key and that it is active in the Helius dashboard. Ensure the RPC URL is formatted correctly and includes the key as required.

Rate limiting or quota errors may occur if you exceed your plan's limits. Check your usage in the dashboard and consider upgrading if needed. For persistent issues, consult Helius support or documentation.

  • Verify the key is copied exactly without extra spaces.
  • Confirm the endpoint URL matches the network (mainnet vs devnet).
  • Check dashboard for key status and usage limits.

Never Worry about Infrastructure Again

OnFinality takes away the heavy lifting of DevOps so you can build smarter and faster.

Get Started