Every environment variable Mira reads, what it does, and which deployments need it.
Environment variables are how you wire Mira's secrets into your
infrastructure: GitHub App credentials, OpenRouter key, database URL,
admin password.
Non-secret review behaviour (model defaults, filter thresholds, walkthrough
toggles, etc.) now lives in the deployment-wide
mira.yaml. The env vars below are mostly
for things you don't want in a checked-in YAML file. MIRA_MODEL and
DATABASE_URL are kept as fallbacks for backwards compatibility, but
mira.yaml is the recommended place for them.
OPENROUTER_API_KEY is always required, plus credentials for at least one
platform — GitHub, GitLab, or Forgejo, in any combination. mira serve won't
start without one platform configured.
Variable
Description
OPENROUTER_API_KEY
Your OpenRouter key. (Mira also accepts OPENAI_API_KEY as a fallback name for backwards compatibility.)
MIRA_GITHUB_APP_ID
GitHub: numeric ID from your GitHub App settings page.
MIRA_GITHUB_PRIVATE_KEY
GitHub: contents of the .pem file generated when you created the GitHub App. The CLI also accepts @/path/to/key.pem syntax.
MIRA_WEBHOOK_SECRET
GitHub: random 32+ byte string. Must match the value you set in the GitHub App's webhook settings.
MIRA_GITLAB_TOKEN
GitLab: a group or project access token with the api scope. See the GitLab setup guide.
MIRA_GITLAB_WEBHOOK_SECRET
GitLab: secret token, matching the one set on the project/group webhook.
MIRA_FORGEJO_TOKEN
Forgejo: an access token with repository read/write. See the Forgejo setup guide.
MIRA_FORGEJO_WEBHOOK_SECRET
Forgejo: webhook secret, matching the one set on the repo/org webhook.
Configure these to review Forgejo (or Codeberg) pull requests. GitHub and
GitLab variables become optional when Forgejo is set. Full walkthrough:
Set up Forgejo.
Variable
Default
Description
MIRA_FORGEJO_TOKEN
—
Required for Forgejo. Access token with repository read/write. The token's user is who Mira comments as.
MIRA_FORGEJO_WEBHOOK_SECRET
—
Required for Forgejo. HMAC-SHA256 secret compared against each webhook's X-Forgejo-Signature.
MIRA_FORGEJO_API_URL
https://codeberg.org/api/v1
API base for self-hosted instances, e.g. https://git.acme.com/api/v1.
Accepted as a fallback for OPENROUTER_API_KEY. Don't set both.
MIRA_MODEL
anthropic/claude-sonnet-4-6
Deployment-wide default model. Per-repo .mira.yaml overrides this. See Choosing a model.
MIRA_MODELS_JSON_PATH
unset (bundled registry)
Path to your own models.json to add custom models or override bundled pricing/labels/recommendations — entries merge over the bundled list by id. See Custom pricing and recommendations.
# GitHub App (or use GitLab/Forgejo below — at least one platform required)export MIRA_GITHUB_APP_ID=123456export MIRA_GITHUB_PRIVATE_KEY="$(cat ./private-key.pem)"export MIRA_WEBHOOK_SECRET=replace-with-32-bytes-of-random# GitLab (alternative or in addition to GitHub)# export MIRA_GITLAB_TOKEN=glpat-your-access-token# export MIRA_GITLAB_WEBHOOK_SECRET=replace-with-32-bytes-of-random# Forgejo / Codeberg (alternative or in addition to the above)# export MIRA_FORGEJO_TOKEN=your-access-token# export MIRA_FORGEJO_WEBHOOK_SECRET=replace-with-32-bytes-of-random# LLMexport OPENROUTER_API_KEY=sk-or-v1-your-key-hereexport MIRA_MODEL=anthropic/claude-sonnet-4-6# Database (Postgres recommended for production; omit for SQLite)export DATABASE_URL=postgresql://mira:mira@db.internal:5432/mira?sslmode=require# Dashboardexport ADMIN_PASSWORD=replace-meexport MIRA_DASHBOARD_URL=https://mira.your-org.com
Never commit .env or private-key.pem. Use your platform's secret manager
(Fly secrets, Railway variables, Render env groups, AWS Secrets Manager,
Doppler, etc.). See the security hardening checklist.