Overview
Codex Multi-Auth supports environment variable overrides for most configuration settings. Environment variables take precedence over settings.json values.Directory and Path Configuration
Override the Codex home directory.Default:
~/.codexExample: export CODEX_HOME="/custom/path"Override the multi-auth storage directory.Default:
~/.codex/multi-authExample: export CODEX_MULTI_AUTH_DIR="/custom/multi-auth"Override the config file location (legacy).Note: This is for legacy config.json files. Modern installations use settings.json.
Override the Codex CLI accounts file path.Default:
~/.codex/accounts.jsonOverride the Codex CLI auth file path.Default:
~/.codex/auth.jsonCore Features
Enable CODEX_MODE for Codex CLI parity.Values:
1 = enabled, 0 = disabledExample: export CODEX_MODE=1Enable the v2 terminal user interface.Values:
1 = enabled, 0 = disabledTUI color profile mode.Options:
truecolor, ansi16, ansi256Example: export CODEX_TUI_COLOR_PROFILE=ansi256TUI glyph rendering mode.Options:
ascii, unicode, autoExample: export CODEX_TUI_GLYPHS=unicodeSession Management
Enable fast session optimization.Values:
1 = enabled, 0 = disabledFast session strategy.Options:
hybrid, alwaysMaximum input items for fast session.Minimum: 8
Enable conversation state persistence.Values:
1 = enabled, 0 = disabledAutomatically resume interrupted sessions.Values:
1 = enabled, 0 = disabledEnable session-to-account affinity.Values:
1 = enabled, 0 = disabledSession affinity TTL in milliseconds (20 minutes).Minimum: 1000
Maximum session affinity cache entries.Minimum: 8
Account Management
Enable per-project account storage.Values:
1 = enabled, 0 = disabledEnable live account synchronization.Values:
1 = enabled, 0 = disabledLive sync debounce interval in milliseconds.Minimum: 50
Live sync polling interval in milliseconds.Minimum: 500
Token Refresh
Token refresh skew window in milliseconds.Minimum: 0
Enable proactive token refresh guardian.Values:
1 = enabled, 0 = disabledProactive refresh check interval in milliseconds.Minimum: 5000
Buffer time before expiry to refresh in milliseconds (5 minutes).Minimum: 30000
Enable refresh lease coordination (advanced).Values:
1 = enabled, 0 = disabledDirectory for refresh lease coordination files.
Refresh lease TTL in milliseconds.
Maximum wait time for refresh lease in milliseconds.
Refresh lease polling interval in milliseconds.
Refresh result cache TTL in milliseconds.
Retry and Error Handling
Retry all accounts when rate limited.Values:
1 = enabled, 0 = disabledMaximum wait time for retry-all in milliseconds (0 = no limit).Minimum: 0
Maximum retry attempts when all accounts are rate limited.Minimum: 0
Maximum retries for empty responses.Minimum: 0
Delay between empty response retries in milliseconds.Minimum: 0
Cooldown after network errors in milliseconds.Minimum: 0
Cooldown after server errors in milliseconds.Minimum: 0
Model Fallback
Policy for unsupported models.Options:
strict, fallbackExample: export CODEX_AUTH_UNSUPPORTED_MODEL_POLICY=fallbackLegacy. Use
CODEX_AUTH_UNSUPPORTED_MODEL_POLICY=fallback instead.Values: 1 = enabled, 0 = disabledFallback GPT-5.3 to GPT-5.2 when unsupported.Values:
1 = enabled, 0 = disabledTimeouts
HTTP fetch timeout in milliseconds (1 minute).Minimum: 1000Example:
export CODEX_AUTH_FETCH_TIMEOUT_MS=30000Stream stall detection timeout in milliseconds (45 seconds).Minimum: 1000
Rate limit toast debounce in milliseconds.Minimum: 0
Toast notification duration in milliseconds.Minimum: 1000
Preemptive Quota
Enable preemptive quota checking.Values:
1 = enabled, 0 = disabled5-hour quota remaining percentage threshold.Range: 0-100
7-day quota remaining percentage threshold.Range: 0-100
Maximum quota deferral time in milliseconds (2 hours).Minimum: 1000
Advanced Features
Enable parallel account health probing.Values:
1 = enabled, 0 = disabledMaximum concurrent health probes.Minimum: 1
Enable process ID offset.Values:
1 = enabled, 0 = disabledEnable automatic storage backups.Values:
1 = enabled, 0 = disabledSync and Bypass
Sync accounts with official Codex CLI.Values:
1 = enabled, 0 = disabledPath to real Codex CLI binary for sync.
Bypass multi-auth and use direct authentication.Values:
1 = enabled, 0 = disabledLogging and Debugging
Log full request/response bodies.Values:
1 = enabled, 0 = disabledWarning: Logs may contain sensitive data.Enable debug logging.Values:
1 = enabled, 0 = disabledSet log level.Options:
debug, info, warn, errorEnable console logging (in addition to file logging).Values:
1 = enabled, 0 = disabledPrompt Customization
Override URL for Codex prompt templates.
Legacy. Use
CODEX_PROMPT_SOURCE_URL instead.Set collaboration mode for multi-user scenarios.
Quick Reference Table
| Variable | Default | Type | Description |
|---|---|---|---|
CODEX_HOME | ~/.codex | string | Codex home directory |
CODEX_MULTI_AUTH_DIR | ~/.codex/multi-auth | string | Multi-auth directory |
CODEX_MODE | 1 | boolean | Enable CODEX_MODE |
CODEX_TUI_V2 | 1 | boolean | Enable TUI v2 |
CODEX_AUTH_FETCH_TIMEOUT_MS | 60000 | number | Request timeout |
CODEX_AUTH_STREAM_STALL_TIMEOUT_MS | 45000 | number | Stream timeout |
CODEX_AUTH_SESSION_AFFINITY | 1 | boolean | Session affinity |
CODEX_AUTH_LIVE_ACCOUNT_SYNC | 1 | boolean | Live sync |
CODEX_AUTH_PROACTIVE_GUARDIAN | 1 | boolean | Proactive refresh |
CODEX_AUTH_PREEMPTIVE_QUOTA_ENABLED | 1 | boolean | Quota checks |
Boolean Value Format
For boolean environment variables:1= enabled/true0= disabled/false