Get API key

Acquire an API Key

Request and manage API keys for Pyth Pro

This guide explains how to acquire an API key for Pyth Pro, which is required to authenticate websocket connections and authenticated HTTP endpoints (the REST API and the signed price endpoints) and subscribe to price updates.

Request API Key

Sign up for a free Pyth Terminal account.

Once you have logged in, click on the 🔑 View your API key button to obtain your API key.

API keys are required for Pyth Pro websocket connections and for authenticated HTTP endpoints. Make sure to keep your key secure and do not share it publicly.

Using the API Key

Once you receive your API key, use it to authenticate the websocket connection by passing it as an Authorization header with the value Bearer {key}.

Example Usage

import { PythLazerClient } from "@pythnetwork/pyth-lazer-sdk";

const client = await PythLazerClient.create({
  token: "YOUR_API_KEY",
  webSocketPoolConfig: {
    urls: [
      "wss://pyth-lazer-0.dourolabs.app/v1/stream",
      "wss://pyth-lazer-1.dourolabs.app/v1/stream",
      "wss://pyth-lazer-2.dourolabs.app/v1/stream",
    ],
  },
});

The same Authorization: Bearer <PRO_API_KEY> header authenticates the REST API and the signed price endpoints. For example, against the REST API:

curl -H "Authorization: Bearer $PRO_API_KEY" \
  "https://pyth.dourolabs.app/v1/fixed_rate@200ms/price?ids=1&timestamp=1704067200000000"

Browser and frontend apps must not embed the key — route requests through your own backend, which injects the header before forwarding, or use the short-lived JWT flow described in Frontend Authentication. See the Authentication sections of the REST API and Fetch Signed Price Updates for full details.

Next Steps