Skip to content

Environment variables ​

Provider API keys ​

init -P <provider> selects that built-in preset and the API key in the table below. Override the variable name for one provider with providers.<name>.apiKeyEnv. Ollama has no API key.

VariableProvider
OPENROUTER_API_KEYopenrouter
OPENAI_API_KEYopenai
ANTHROPIC_API_KEYanthropic
GOOGLE_API_KEYgemini
DEEPSEEK_API_KEYdeepseek
CEREBRAS_API_KEYcerebras
GROQ_API_KEYgroq
MISTRAL_API_KEYmistral
XAI_API_KEYxai
NVIDIA_API_KEYnvidia
ALIBABA_API_KEYalibaba
APIKEYFAN_API_KEYapikeyfan
CHEAPERINFERENCE_API_KEYcheaperinference

The key is required when that provider is active. For apikeyfan, the legacy APIFUN_API_KEY is accepted when APIKEYFAN_API_KEY is unset or empty. A custom apiKeyEnv disables this fallback. Preset URLs: Built-in providers.

Provider base URLs ​

These two variables override baseUrl for a configured provider. Every other preset changes its URL in config (providers.<name>.baseUrl), not through an environment variable.

VariableOverrides
OPENROUTER_BASE_URLproviders.openrouter.baseUrl (only when that provider is configured)
OLLAMA_BASE_URLproviders.ollama.baseUrl (only when that provider is configured)

Tool and run ​

VariableDescription
AI_I18N_LANGLanguage for the tool's own UI (CLI help, logs, dashboard). Overridden by -L / --ui-lang; overrides config uiLanguage. See Tool UI language.
I18N_SOURCE_LOCALEOverride sourceLocale at runtime.
I18N_TARGET_LOCALESComma-separated locale codes to override targetLocales.
I18N_LOG_LEVELLogger level (debug, info, warn, error). Unknown values (including silent) fall back to info.
NO_COLORWhen 1, disable ANSI colours in log output.
I18N_LOG_SESSION_MAXMax lines kept per log session (default 5000).

When no provider API key is set, the CLI and doctor read .env and .env.local from the directory that contains ai-i18n-tools.config.json. Only the variables in the tables above (plus a custom providers.*.apiKeyEnv) are copied, and only when that variable is unset. .env.local wins when both files set the same name. A warning names the file and the variables that were read. doctor repeats it in the Environment section. If any provider API key already has a value, neither file is read.

Released under the MIT License.