Skip to main content
Environment variables allow you to securely store API keys and other sensitive configuration values. These variables are used in development mode, when running your scripts, and for LLM-based tests, such as LLM-as-a-judge evaluations.

Workspace-level environment variables

Workspace-level environment variables are shared across all projects in your workspace. To set them, navigate to Workspace settingsEnvironment variables.

Pre-defined variables

Openlayer provides pre-defined fields for commonly used API keys:
  • OPENAI_API_KEY
  • ANTHROPIC_API_KEY
  • AZURE_OPENAI_API_KEY
  • AZURE_OPENAI_ENDPOINT
  • GOOGLE_API_KEY
and others, which are used by popular LLM providers.

Custom variables

You can also add arbitrary key-value pairs for any other environment variables your system requires.

Custom CA certificates

If your organization uses custom Certificate Authority (CA) certificates for secure connections, you can add them as environment variables using the CUSTOM_CA_CERT_* pattern. To add a custom CA certificate:
  1. Navigate to Workspace settingsEnvironment variables (or Project settingsEnvironment variables for project-specific certificates)
  2. Add a new custom variable with a key starting with CUSTOM_CA_CERT_, followed by a descriptive suffix (e.g., CUSTOM_CA_CERT_INTERNAL or CUSTOM_CA_CERT_CORPORATE)
  3. Paste your CA certificate content as the value (in PEM format)
These custom CA certificates will be automatically applied to:
  • Development mode: Your custom certificates will be used when running scripts and code in the development mode commit environment
  • LLM evaluators: The certificates will be trusted when running LLM-based tests and evaluations, ensuring secure connections to your LLM providers
You can add multiple custom CA certificates by creating multiple environment variables with different suffixes (e.g., CUSTOM_CA_CERT_1, CUSTOM_CA_CERT_2, etc.). All certificates matching the CUSTOM_CA_CERT_* pattern will be trusted.

Project-level environment variables

Project-level environment variables work the same way as workspace-level ones, but are specific to a single project. They are only used during development mode runs and LLM-based tests within that project. To set them, navigate to Project settings → Select your project → Environment variables.
If an environment variable is already set at the workspace level, you will see a tag indicating that it is inherited on the project-level page. You can override inherited variables by setting a new value at the project level.