Skip to main content
VoiceGateway reads environment variables for configuration overrides, secret material, and daemon binding. Variables can also be referenced in voicegw.yaml using ${VAR_NAME} syntax.

VoiceGateway variables

Cloud ingest variables

These variables configure the agent-side remote sink that pushes telemetry to VoiceGateway Cloud (or a self-hosted collector): Set all three in the agent’s environment. attach() reads them automatically. The project= argument in your attach(target, project="...") call always takes precedence over VOICEGW_PROJECT. See Hosted quickstart for the full setup flow.

Provider API keys

Each cloud provider reads its API key from a standard environment variable. Reference these in voicegw.yaml via ${VAR_NAME} substitution.

How substitution works

Any string value in voicegw.yaml can reference an environment variable with ${VAR_NAME}:
VoiceGateway substitutes these at config load time from os.environ. Substitution works recursively through all dicts and lists. If a variable is not set, it resolves to an empty string.

Setting environment variables

Shell export

.env file

VoiceGateway does not load .env files automatically. Use direnv or a similar tool if you prefer file-based management:

Docker

Or in docker-compose.yml:

Config discovery order

When VOICEGW_CONFIG is not set, VoiceGateway searches for config in this order:
  1. ./voicegw.yaml
  2. ~/.config/voicegateway/voicegw.yaml
  3. /etc/voicegateway/voicegw.yaml
voicegw init writes to the second path by default.
See voicegw.yaml reference for all config keys. See Providers for per-provider credential blocks.