fern/01-guide/03-development/environment-variables.mdx
Sometimes you'll see environment variables used in BAML, like in clients:
client<llm> GPT4o {
provider baml-openai-chat
options {
model gpt-5-mini
api_key env.OPENAI_API_KEY
}
}
When you use BAML in your application, logs and traces are automatically sent to Boundary Studio for monitoring and debugging. To enable this integration, you need to set the BOUNDARY_API_KEY environment variable with an API key from your Boundary Studio dashboard.
The API key is used to:
You can set the API key for an LLM dynamically by passing in the key as a header or as a parameter (depending on the provider), using the ClientRegistry.