> This is a page from the ElevenLabs documentation. For a complete page index, fetch https://elevenlabs.io/docs/llms.txt. For the full documentation in a single file, fetch https://elevenlabs.io/docs/llms-full.txt. # Environment variables Environment variables let you define per-environment values for tool URLs, secrets, headers, and auth connections. A single agent and tool configuration works across all your environments — URLs, API keys, and authentication resolve dynamically based on the environment specified at conversation time. ## Overview Without environment variables, deploying an agent across multiple environments (development, staging, production) requires duplicating agents and tools for each environment, then manually keeping their configurations in sync. This leads to: * **Configuration drift** between environments * **Fragmented analytics** across duplicated agent IDs * **Promotion friction** when moving from staging to production Environment variables solve this by introducing a reusable, workspace-scoped resource that stores different values per environment. Tools and MCP servers reference these variables using template syntax, and the correct value is resolved at runtime based on the conversation's environment. ![Environment variables overview](/docs/_fern-img/75bbfad6349ff43d078f62e75f7d3549858897158e55ada3dcdbf261a963b055.webp) ## Core concepts ### Environment variables An environment variable is a workspace-scoped resource with a label and a set of per-environment values. There are three types: | Type | Description | Example use case | | ------------------- | --------------------------------------------------------- | ------------------------------------------------ | | **String** | Plain text values that vary per environment | Base URLs, hostnames, configuration values | | **Secret** | References to workspace secrets, resolved per environment | API keys, bearer tokens, webhook signing secrets | | **Auth connection** | References to auth connections, resolved per environment | OAuth2 credentials, JWT configurations | Each environment variable must have a value for the default `production` environment. Additional environments (e.g., `staging`, `development`) are optional. ### Template syntax Reference environment variables in URL fields using the `{{system__env_