Home

/

Introduction

Authentication & API Keys

Secure your endpoints with API key authentication.

By default, your endpoints are open (no authentication required). You can enable API key authentication to restrict access and track usage per key.

Enabling Authentication

Navigate to your endpoint's Security tab and toggle authentication on. Once enabled, all requests without a valid API key will be rejected with a 401 Unauthorized error.

Creating API Keys

From the Security tab, click "Create API Key" to generate a new key. Each key can be given a label for easy identification. The number of keys you can create depends on your plan.

Using API Keys

Pass your API key as a query parameter:

RPC with API Key

curl -X POST "<URL> \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
curl -X POST "<URL> \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
curl -X POST "<URL> \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

For WebSocket connections (Data Streams), pass the key the same way:

WebSocket with API Key

const ws = new WebSocket("wss://your-stream.hyperpc.app?apikey=YOUR_API_KEY");
const ws = new WebSocket("wss://your-stream.hyperpc.app?apikey=YOUR_API_KEY");
const ws = new WebSocket("wss://your-stream.hyperpc.app?apikey=YOUR_API_KEY");

Warning

Keep your API keys secret. Never expose them in client-side code or public repositories. If a key is compromised, revoke it immediately from the Security tab and create a new one.

On this page

Getting Started

/

Authentication & API Keys

Getting Started

/

Authentication & API Keys