Environment variables
Environment variables Miton reads at startup — development overrides, provider keys, and paths. Most configuration belongs in Settings instead.
- Product stage
- Development build
- Last reviewed
- 2026-08-29
- Successful result
- The change is visible in the active project.
Who this is for: developers and power users who configure Miton from a shell, CI job, or .env
file rather than the Settings UI.
Prefer Settings for everyday options (model defaults, budgets, Studio port). Environment variables override file settings only where noted below.
Copy the repository’s .env.example to .env for local development.
Provider keys (BYOK)
Standard provider env vars are read for development convenience. In normal use, store keys in the app’s keychain via Settings → Models.
| Variable | Purpose |
|---|---|
OPENAI_API_KEY |
OpenAI models |
ANTHROPIC_API_KEY |
Anthropic models |
GOOGLE_API_KEY |
Google Gemini models |
MISTRAL_API_KEY |
Mistral models |
OPENROUTER_API_KEY |
OpenRouter models |
GROQ_API_KEY |
Groq models |
COHERE_API_KEY |
Cohere models |
OLLAMA_BASE_URL |
Local Ollama endpoint (default http://localhost:11434) |
CUSTOM_API_BASE_URL |
OpenAI-compatible base URL (documented; no reader yet) |
CUSTOM_API_KEY |
Key for the custom endpoint (documented; no reader yet) |
Managed proxy (when enabled)
Accuracy note:
MITON_PROXY_URLandMITON_PROXY_KEYare documented here but no surface reads them yet — the Miton Cloud proxy is not implemented. Do not rely on them.
| Variable | Purpose |
|---|---|
MITON_PROXY_URL |
Miton Cloud proxy endpoint |
MITON_PROXY_KEY |
Proxy authentication key |
Development paths and logging
| Variable | Default | Purpose |
|---|---|---|
MITON_LOG_LEVEL |
warn |
CLI diagnostic threshold: debug, info, warn, error, or silent |
MITON_CONFIG_DIR |
~/.miton |
CLI configuration, credential fallback and usage-ledger root |
MITON_STATE_DIR |
~/.miton |
CLI workflow, session, model-cache, egress and run-state root |
The two CLI roots are the same by default and may be split for CI, portable installs or isolated
test runs. MITON_LOG_LEVEL affects CLI diagnostics only; use the command-line
--log-level <level> flag when a per-invocation setting is clearer. The desktop does not read the
CLI log-level variable.
CLI overrides
| Variable | Purpose |
|---|---|
MITON_PROVIDER |
Pin the provider route for every CLI command |
MITON_MODEL |
Pin the base model for every CLI command |
MITON_GITHUB_TOKEN |
GitHub token for miton github run (falls back from --token/GITHUB_TOKEN) |
MITON_STATE_DIR |
Override the CLI state directory (workflow stores, model caches, egress, sessions) |
MITON_STALL_TIMEOUT_MS |
Turn-stall watchdog threshold in ms (CLI, default 90000) |
Specialist overrides
| Variable | Purpose |
|---|---|
MITON_AST_GREP_BIN |
Path to ast-grep binary for blueprint tooling |
MITON_PDF_FONTS_DIR |
Custom font directory for PDF export |
MITON_REFERRAL_<PLAN_ID> |
Override affiliate URL for a paid-plan id (upper snake case) |
MITON_BROWSER_CDP_ENDPOINT |
Loopback DevTools endpoint for the browser-automation CDP fallback |
MITON_BROWSER_CDP_ENDPOINT deserves a note, because it is the one variable here that widens what
the agent can reach. Browser automation drives the panel by injecting JavaScript; a page whose
Content-Security-Policy refuses inline scripts drops that injection, and the fallback is to run the
same script over Chrome DevTools Protocol instead. Miton never looks for a DevTools endpoint on its
own — pointing it at one is the whole opt-in, because such an endpoint is total control over
whatever is listening on it. Set it only to the debugging port of Miton’s own browser panel
webview (http://127.0.0.1:9222, or the ws:// URL if you already have it). Non-loopback hosts are
refused, and the fallback only ever evaluates against a page already showing the panel’s current URL
— so aiming it at a browser of your own does not let the agent drive your tabs. Unset, the fallback
is inert and a CSP-blocked action is simply reported as failed.
Override hierarchy
Where an env var is supported:
environment variable → .miton/settings.json → user settings.json → default
Not every Settings field has an env counterpart. If a variable is not listed here, configure it in the UI or project settings file.
Security notes
- Env vars are plain text in the process environment — do not commit
.envwith real keys - Production desktop builds use the OS keychain for secrets
- The CLI vars above (
MITON_CONFIG_DIR,MITON_STATE_DIR,MITON_STALL_TIMEOUT_MS, and friends) are meant for CI and automated test harnesses, not daily desktop use