Skip to content
Docs

Quickstart

Create and store an API key

Generate a project secret key in Console and store it securely on your server.

Create a secret key

  1. Open your project in Console.
  2. Go to API keys and choose Create key.
  3. Copy the secret now — it is shown only once. Secret keys start with gray_sk_.

If you lose a secret, you cannot view it again. Create a new key and revoke the old one, as described in Rotate a key.

Store it on your server

Treat a secret key like a database password. Put it in an environment variable or a secrets manager that only your backend can read:

bash
# .env (never commit this file)
GRAY_PROJECT_ID=proj_your_project_id
GRAY_SECRET_KEY=gray_sk_your_secret
  • Never commit secrets to source control or paste them into tickets or chat.
  • Never ship a secret in a browser bundle or mobile app. Anyone can extract it from the app package.
  • Use different keys, and ideally different projects, for staging and production.
  • Rotate the key immediately if it is exposed. See Rotate after a leak.