Skip to content

Environment Variables

Complete reference for every environment variable used across the Gatez platform. Variables are grouped by service. Defaults are sourced from docker-compose.yml, .env.example, and from_env() / std::env::var() patterns in service source code.

.env File Variables

These variables are defined in .env (copied from .env.example) and referenced by docker-compose.yml:

VariableDefaultRequiredDescription
GATEZ_ENVlocalNoEnvironment mode: local, staging, or production. Controls logging level, secret validation, and startup behavior. In production, services refuse to start with default passwords.
KEYCLOAK_ADMINadminNoKeycloak admin console username
KEYCLOAK_ADMIN_PASSWORDchangemeNoKeycloak admin console password
CLICKHOUSE_PASSWORDchangemeNoClickHouse default user password
GF_SECURITY_ADMIN_PASSWORDadminNoGrafana admin console password
LITELLM_MASTER_KEYsk-local-dev-keyYesMaster API key for AI Gateway authentication
OPENAI_API_KEY(empty)NoOpenAI API key; enables gpt-4o and gpt-4o-mini models
ANTHROPIC_API_KEY(empty)NoAnthropic API key; enables claude-sonnet model
GEMINI_API_KEY(empty)NoGoogle Gemini API key; enables gemini-flash model
GROQ_API_KEY(empty)NoGroq API key; enables Groq models
MISTRAL_API_KEY(empty)NoMistral API key; enables Mistral models
DEEPSEEK_API_KEY(empty)NoDeepSeek API key; enables DeepSeek models
TOGETHER_API_KEY(empty)NoTogether AI API key; enables Together models
COHERE_API_KEY(empty)NoCohere API key; enables Cohere models
FIREWORKS_API_KEY(empty)NoFireworks API key; enables Fireworks models
AZURE_OPENAI_API_KEY(empty)NoAzure OpenAI API key; enables Azure-hosted OpenAI models
AZURE_OPENAI_BASE_URL(empty)NoAzure OpenAI base URL; required when using Azure OpenAI
VLLM_BASE_URL(empty)NovLLM base URL; enables self-hosted vLLM models
MODEL_ALIASES(empty)NoModel alias configuration; maps custom names to provider models
REDIS_URLredis://redis:6379NoRedis connection URL (used as base reference)
REDIS_PASSWORDgatez-redis-devYesRedis authentication password; required for APISIX rate limiting plugins
APISIX_ADMIN_KEYedd1c9f034335f136f87ad84b625c8f1NoAPISIX Admin API authentication key
DOMAINgatez.devNoBase domain for production deployment. Used by Caddy for TLS certificates and by portal Dockerfiles for Keycloak/API URLs.

Portal Build Args (Docker only)

These are Docker build arguments passed during docker build for the operator and developer portals. They are baked into the JS bundle at build time and cannot be changed at runtime.

VariableDefaultDescription
VITE_KEYCLOAK_URL(empty)Keycloak base URL for SSO login. When empty, portals run in dev mock mode (no auth). Example: https://keycloak.gatez.dev
VITE_KEYCLOAK_REALMgatewayKeycloak realm name
VITE_API_URL(empty)Control Plane API base URL. All apiFetch() calls prepend this. Example: https://api.gatez.dev
CSP_KEYCLOAK_ORIGIN(empty)Content Security Policy origin for Keycloak. Set at runtime via Docker environment variable.

WARNING

Portal build args are set during docker build, not at container runtime. Changing VITE_KEYCLOAK_URL requires rebuilding the portal image. This is a Vite limitation — import.meta.env values are replaced at build time.

DANGER

Change KEYCLOAK_ADMIN_PASSWORD, GF_SECURITY_ADMIN_PASSWORD, REDIS_PASSWORD, LITELLM_MASTER_KEY, and APISIX_ADMIN_KEY from their defaults before any production deployment. Never commit .env to version control.


etcd

VariableDefaultRequiredDescription
(configured via CLI flags)----etcd is configured with command-line arguments in docker-compose.yml, not environment variables

Relevant CLI flags: --advertise-client-urls=http://etcd:2379, --listen-client-urls=http://0.0.0.0:2379, --data-dir=/etcd-data.


APISIX (L1 - API Gateway)

APISIX is configured via layers/api-gateway/config/apisix.yaml mounted into the container. It does not use environment variables directly. The APISIX Admin API key is set in the YAML config file.

ConfigurationValueLocation
Admin API keyedd1c9f034335f136f87ad84b625c8f1apisix.yaml and .env (APISIX_ADMIN_KEY)
etcd hosthttp://etcd:2379apisix.yaml
Proxy listen port9080apisix.yaml
Admin listen port9180apisix.yaml

Redis

VariableDefaultRequiredDescription
(configured via CLI flags)----Redis is configured with command-line arguments

Relevant CLI flags: --maxmemory 512mb, --maxmemory-policy allkeys-lru, --save "", --appendonly no.

External port: 6380 (mapped from internal 6379).


Keycloak

VariableDefaultRequiredDescription
KEYCLOAK_ADMINadminNoAdmin console username
KEYCLOAK_ADMIN_PASSWORDchangemeNoAdmin console password
KC_HTTP_ENABLEDtrueNoEnable HTTP (non-TLS) listener
KC_HOSTNAME_STRICTfalseNoDisable strict hostname checking (required for local dev)

Keycloak CLI flags: start-dev --health-enabled=true --metrics-enabled=true.

External port: 8081 (mapped from internal 8080). Health port: 9001 (mapped from internal 9000).


ClickHouse

VariableDefaultRequiredDescription
CLICKHOUSE_DBgatewayNoDefault database name, created on startup
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT1NoEnable SQL-driven access management

External ports: 8123 (HTTP), 9000 (native), 9363 (Prometheus metrics).


Qdrant

Qdrant uses default configuration. No environment variables are set in docker-compose.yml.

External ports: 6333 (HTTP/REST), 6334 (gRPC).


AI Gateway (L2)

Source: layers/ai-gateway/src/config.rs GatewayConfig::from_env().

VariableDefaultRequiredDescription
PORT4000NoHTTP listen port
REDIS_URLredis://redis:6379NoRedis connection URL for caching and rate limits
QDRANT_URLhttp://qdrant:6334NoQdrant vector DB URL for semantic cache
CLICKHOUSE_URLhttp://clickhouse:8123NoClickHouse HTTP URL for logging
OTEL_EXPORTER_OTLP_ENDPOINThttp://otel-collector:4317NoOpenTelemetry Collector gRPC endpoint
OTEL_SERVICE_NAMEai-gatewayNoService name for OTel traces and metrics
OTEL_RESOURCE_ATTRIBUTESservice.name=ai-gatewayNoOTel resource attributes
OPENAI_API_KEY(empty)NoOpenAI API key; enables gpt-4o, gpt-4o-mini
ANTHROPIC_API_KEY(empty)NoAnthropic API key; enables claude-sonnet
GEMINI_API_KEY(empty)NoGoogle Gemini API key; enables gemini-flash
GROQ_API_KEY(empty)NoGroq API key; enables Groq models
MISTRAL_API_KEY(empty)NoMistral API key; enables Mistral models
DEEPSEEK_API_KEY(empty)NoDeepSeek API key; enables DeepSeek models
TOGETHER_API_KEY(empty)NoTogether AI API key; enables Together models
COHERE_API_KEY(empty)NoCohere API key; enables Cohere models
FIREWORKS_API_KEY(empty)NoFireworks API key; enables Fireworks models
AZURE_OPENAI_API_KEY(empty)NoAzure OpenAI API key; enables Azure-hosted OpenAI models
AZURE_OPENAI_BASE_URL(empty)NoAzure OpenAI base URL; required when using Azure OpenAI
VLLM_BASE_URL(empty)NovLLM base URL; enables self-hosted vLLM models
MODEL_ALIASES(empty)NoModel alias configuration; maps custom names to provider models
OLLAMA_BASE_URLhttp://host.docker.internal:11434NoOllama base URL for local LLM (always enabled)
LITELLM_MASTER_KEY(none)YesMaster API key; gateway refuses to start if empty
CACHE_TTL_SECS3600NoCache entry time-to-live in seconds
SEMANTIC_CACHE_ENABLEDfalseNoEnable Qdrant-based semantic similarity cache
SIMILARITY_THRESHOLD0.95NoCosine similarity threshold for cache hits (0.0-1.0)
PII_REDACTION_ENABLEDtrueNoEnable PII scanning before LLM calls
KEYCLOAK_JWKS_URLhttp://gw-keycloak:8080/realms/gateway/protocol/openid-connect/certsNoKeycloak JWKS endpoint for JWT signature verification. Used for offline RS256 validation (no introspection). Cache refreshes every 5 minutes.
KEYCLOAK_URLhttp://gw-keycloak:8080NoKeycloak base URL for token introspection (fallback when JWKS unavailable)
KEYCLOAK_CLIENT_IDapisix-clientNoKeycloak client ID for token introspection
KEYCLOAK_CLIENT_SECRETapisix-client-secretNoKeycloak client secret for token introspection
RUST_LOGai_gateway=infoNoRust log level filter
RUST_TLS_CERT(empty)NoPath to TLS certificate file; when set, enables HTTPS instead of HTTP
RUST_TLS_KEY(empty)NoPath to TLS private key file; required when RUST_TLS_CERT is set
RUST_TLS_CA(empty)NoPath to CA certificate for client verification; enables mTLS when set
GUARD_ENABLEDfalseNoEnable multi-layer prompt guard pipeline (regex + webhook). When enabled, all chat completions are scanned before reaching the LLM.
GUARD_WEBHOOK_URL(empty)NoExternal webhook URL for custom prompt guard. Receives POST with prompt, returns {"action":"reject"} to block.
GUARD_WEBHOOK_TIMEOUT_MS5000NoTimeout for guard webhook calls in milliseconds
OBSERVABILITY_WEBHOOK_ENABLEDfalseNoEnable LLM event webhook (sends batched events to external observability tool like Langfuse/LangSmith)
OBSERVABILITY_WEBHOOK_URL(empty)NoWebhook URL for LLM observability events. Receives batched POST with model, tokens, latency, cache_hit.
CONFIG_WATCH_PATHS(empty)NoComma-separated file paths to watch for changes. Triggers hot config reload via /admin/reload when files change. Polling-based (no inotify dependency).

:::note The docker-compose.yml overrides SEMANTIC_CACHE_ENABLED to true and QDRANT_URL to http://qdrant:6333 (HTTP port, not gRPC). The code default uses port 6334 (gRPC), but the compose environment takes precedence. :::


Agent Gateway (L3)

Source: layers/agent-gateway/src/config.rs AgentGatewayConfig::from_env().

VariableDefaultRequiredDescription
PORT5000NoHTTP listen port (mapped to external 5001)
REDIS_URLredis://gw-redis:6379NoRedis connection URL for session state
CLICKHOUSE_URLhttp://clickhouse:8123NoClickHouse HTTP URL for audit logging
AI_GATEWAY_URLhttp://ai-gateway:4000NoAI Gateway URL for LLM calls from agents
OTEL_EXPORTER_OTLP_ENDPOINThttp://otel-collector:4317NoOpenTelemetry Collector gRPC endpoint
OTEL_SERVICE_NAMEagent-gatewayNoService name for OTel traces and metrics
OTEL_RESOURCE_ATTRIBUTESservice.name=agent-gatewayNoOTel resource attributes
SESSION_TTL_SECS3600NoDefault agent session TTL in seconds
MAX_CONCURRENT_TOOLS10NoMaximum concurrent tool executions per session
HITL_WEBHOOK_URL(empty)NoWebhook URL for human-in-the-loop approval notifications
KEYCLOAK_JWKS_URLhttp://gw-keycloak:8080/realms/gateway/protocol/openid-connect/certsNoKeycloak JWKS endpoint for JWT signature verification. Used for offline RS256 validation (no introspection). Cache refreshes every 30 minutes.
KEYCLOAK_URLhttp://gw-keycloak:8080NoKeycloak base URL for token introspection (fallback when JWKS unavailable)
KEYCLOAK_CLIENT_IDapisix-clientNoKeycloak client ID for token introspection
KEYCLOAK_CLIENT_SECRETapisix-client-secretNoKeycloak client secret for token introspection
RUST_LOGagent_gateway=infoNoRust log level filter
RUST_TLS_CERT(empty)NoPath to TLS certificate file; when set, enables HTTPS instead of HTTP
RUST_TLS_KEY(empty)NoPath to TLS private key file; required when RUST_TLS_CERT is set
RUST_TLS_CA(empty)NoPath to CA certificate for client verification; enables mTLS when set
MCP_HEALTH_CHECK_INTERVAL_SECS30NoInterval between MCP server health checks in seconds. Set to 0 to disable health checks.
MCP_EXCLUDE_UNHEALTHYfalseNoWhen true, unhealthy MCP servers are excluded from tool discovery. Prevents routing tool calls to degraded servers.
MCP_OAUTH_ENABLEDfalseNoEnable MCP OAuth per RFC 9728 + RFC 8414. When enabled, the gateway acts as an OAuth proxy for MCP clients.
MCP_OAUTH_ISSUER(empty)NoOAuth issuer URL (typically Keycloak realm URL). Used in .well-known/oauth-authorization-server response.
MCP_OAUTH_JWKS_URL(empty)NoJWKS endpoint for MCP token validation. Proxied via /v1/mcp/auth/jwks.
MCP_OAUTH_MODEpermissiveNoToken validation mode: strict (require token), optional (validate if present), permissive (skip validation).
MCP_OAUTH_RESOURCE_URL(empty)NoProtected resource URL for RFC 9728 metadata.
MCP_OAUTH_SCOPES(empty)NoComma-separated OAuth scopes required for MCP access.
CONFIG_WATCH_PATHS(empty)NoComma-separated file paths to watch for config changes. Triggers hot reload via /admin/reload.

Control Plane API

Source: layers/control-plane-api/src/clients.rs, main.rs, middleware.rs.

VariableDefaultRequiredDescription
REDIS_URLredis://127.0.0.1:6379NoRedis connection URL
APISIX_ADMIN_URLhttp://localhost:9180NoAPISIX Admin API base URL
APISIX_ADMIN_KEYedd1c9f034335f136f87ad84b625c8f1NoAPISIX Admin API key (warning logged if using default)
CLICKHOUSE_URLhttp://localhost:8123NoClickHouse HTTP URL for analytics queries
AGENT_GATEWAY_URLhttp://localhost:5001NoAgent Gateway URL for agent management
ALLOWED_ORIGINShttp://localhost:3003,http://localhost:3004NoComma-separated CORS allowed origins
MASTER_KEYsk-local-dev-keyNoMaster API key for service-to-service auth
KEYCLOAK_JWKS_URLhttp://gw-keycloak:8080/realms/gateway/protocol/openid-connect/certsNoKeycloak JWKS endpoint for JWT signature verification. Used for offline RS256 validation (no introspection). Cache refreshes every 30 minutes.
KEYCLOAK_URLhttp://localhost:8081NoKeycloak base URL for JWT introspection (fallback when JWKS unavailable)
KEYCLOAK_CLIENT_IDapisix-clientNoKeycloak client ID for JWT introspection
KEYCLOAK_CLIENT_SECRETapisix-client-secretNoKeycloak client secret for JWT introspection
RUST_LOGcontrol_plane_api=infoNoRust log level filter
ENVIRONMENT(none)NoControls API behavior mode; set to development to allow manual API key entry in dev environments
GATEZ_LICENSE_KEY(none)NoLicense key JWT. Without it, the platform runs in Community tier. Generate with scripts/generate-license.sh.
RUST_TLS_CERT(empty)NoPath to TLS certificate file; when set, enables HTTPS instead of HTTP
RUST_TLS_KEY(empty)NoPath to TLS private key file; required when RUST_TLS_CERT is set
RUST_TLS_CA(empty)NoPath to CA certificate for client verification; enables mTLS when set
VAULT_TOKEN(empty)NoHashiCorp Vault token for secret resolution. Used when provider key source is vault.
VAULT_CACHE_TTL_SECS300NoCache TTL for Vault secret lookups in seconds (default 5 min). Reduces Vault API calls.

:::note In docker-compose.yml, the Control Plane API uses Docker-internal hostnames (e.g., http://apisix:9180, http://keycloak:8080). The code defaults use localhost with external ports for local development without Docker. :::


Jaeger

VariableDefaultRequiredDescription
COLLECTOR_OTLP_ENABLEDtrueNoEnable OTLP trace ingestion

External ports: 16686 (UI), 14268 (HTTP collector).


OpenTelemetry Collector

Configured via infra/otel/config.yaml mounted into the container. No environment variables are set in docker-compose.yml.

External ports: 4317 (OTLP gRPC), 4318 (OTLP HTTP), 8889 (Prometheus metrics).


Prometheus

Configured via infra/prometheus/prometheus.yml. CLI flags: --storage.tsdb.retention.time=15d.

External port: 9090.


Grafana

VariableDefaultRequiredDescription
GF_SECURITY_ADMIN_USERadminNoGrafana admin username
GF_SECURITY_ADMIN_PASSWORDadminNoGrafana admin password. Can be overridden via environment variable for production deployments.
GF_INSTALL_PLUGINSgrafana-clickhouse-datasourceNoPlugins to install on startup

External port: 3002 (mapped from internal 3000).

WARNING

Change GF_SECURITY_ADMIN_PASSWORD from the default admin value before deploying to production. Set it via environment variable in your deployment environment.


Mock Backend

No environment variables. Uses the httpbin image for testing.

External port: 8000 (mapped from internal 80).


Landing Page

No environment variables. Static nginx serving landing-page/ directory.

External port: 8899 (mapped from internal 80).

Enterprise API + AI + Agent Gateway