All environment variables are validated at startup using Zod schemas defined in packages/server/src/config/env.ts. The server will exit with descriptive errors if validation fails.
Used by pnpm seed to create the initial administrator account.
Variable
Required
Default
Validation
SUPER_ADMIN_EMAIL
No
admin@ai-gateway.local
Valid email address
SUPER_ADMIN_PASSWORD
Yes
—
12+ characters, must include uppercase, lowercase, digit, and special character
Semantic Cache
Variable
Required
Default
Description
CACHE_EMBEDDING_MODEL
No
nomic-embed-text
Embedding model for cache similarity
CACHE_SIMILARITY_THRESHOLD
No
0.96
Cosine similarity threshold (0.0-1.0)
CACHE_DEFAULT_TTL_SECONDS
No
86400
Cache entry TTL in seconds (default: 24 hours)
Rate Limiting
Variable
Required
Default
Description
RATE_LIMIT_WINDOW_MS
No
60000
Window duration in milliseconds
RATE_LIMIT_MAX_PER_WINDOW
No
60
Max requests per window
CORS and Networking
Variable
Required
Default
Description
CORS_ORIGINS
No
(empty)
Comma-separated allowed origins (each must be a valid URL)
SOCKET_CORS_ORIGIN
No
http://localhost:3001
Socket.io CORS origin
ADMIN_URL
No
http://localhost:3001
Admin dashboard URL
SSO_CALLBACK_BASE_URL
No
(optional)
Base URL for SSO callback endpoints
Background Workers
Variable
Required
Default
Description
BULLMQ_PREFIX
No
aigw
Redis key prefix for BullMQ queues
S3 Backup
All S3 variables are optional. When not configured, audit log backups are stored locally.
Variable
Required
Default
Description
S3_BUCKET
No
—
S3 bucket name
S3_REGION
No
us-east-1
AWS region
S3_ACCESS_KEY_ID
No
—
AWS access key ID
S3_SECRET_ACCESS_KEY
No
—
AWS secret access key
S3_PREFIX
No
backups
Key prefix within the S3 bucket
SIEM Export
All SIEM variables are optional. When not configured, SIEM export is disabled.
Variable
Required
Default
Description
SIEM_TYPE
No
—
Export type: splunk, elk, or webhook
SIEM_URL
No
—
SIEM endpoint URL
SIEM_TOKEN
No
—
Authentication token
SIEM_BATCH_SIZE
No
100
Events per batch
Provider API Keys
Provider API keys are typically managed through the admin dashboard. They can also be set as environment variables, though dashboard-configured keys are encrypted at rest with AES-256-GCM.