Variable reference
Usage examples
Providing a GitHub token directly
Useful in Docker or CI environments where interactive device-code authentication is not possible:Setting a custom data directory
Using opencode OAuth
Connecting to GitHub Enterprise
Enabling remote admin access
x-admin-token: <token> or Authorization: Bearer <token>.
Enabling Claude token counting
Using a proxy
Proxy variables (
HTTP_PROXY, HTTPS_PROXY) are only read when you pass the --proxy-env flag to the start command. Without that flag, proxy settings are ignored even if the variables are set.Variable precedence for API keys
When determining which API keys to enforce, the server checks in this order:auth.apiKeysinconfig.json(preferred)COPILOT_API_KEYenvironment variable (deprecated fallback)apiKeyfield inconfig.json(deprecated fallback)