Skip to content

Environment variables

VariableDescription
PORTPort (default 4000)
MOKA_HOSTBind address (default 127.0.0.1)
MOKA_TOKENFixed access token
MOKA_CONFIGConfig file path
MOKA_HOMEData directory (default ~/.moka): default config + chat sessions
MOKA_NO_OPEN1 to never open a browser
MOKA_PUBLIC_URLThe URL browsers use to reach Moka (default http://localhost:<port>). Used for OAuth redirects
OLLAMA_HOSTWhere to look for Ollama on first run (default http://localhost:11434)
VariableDescription
HTTPS_PROXY / HTTP_PROXYProxy for model providers, HTTP MCP servers and catalog URLs (Node 22.21+ / 24+)
NO_PROXYHosts that bypass the proxy. Local addresses are always added
NODE_EXTRA_CA_CERTSExtra root certificates (PEM), e.g. a corporate TLS-inspection CA

These, plus SSL_CERT_FILE, REQUESTS_CA_BUNDLE, npm_config_registry, PIP_INDEX_URL and UV_INDEX_URL, are passed through to stdio MCP servers. See corporate networks.

VariableCreates a profile for
OPENAI_API_KEYOpenAI
ANTHROPIC_API_KEYAnthropic
GOOGLE_GENERATIVE_AI_API_KEY or GEMINI_API_KEYGoogle Gemini
AZURE_API_KEY + AZURE_RESOURCE_NAMEAzure OpenAI
OPENROUTER_API_KEYOpenRouter
GROQ_API_KEYGroq
DEEPSEEK_API_KEYDeepSeek
MISTRAL_API_KEYMistral
XAI_API_KEYxAI
TOGETHER_API_KEYTogether AI

Profiles reference the variable (env:OPENAI_API_KEY), so rotating a key only requires restarting Moka with the new value.

Any other variable can be referenced from moka.json with env:NAME or ${NAME}.