Configuration
The client is configured entirely through environment variables, so launchd/systemd/
container deployments behave identically. Flags to modelpilot-client override env.
Connection & auth
| Variable | Default | Description |
|---|---|---|
ANTHROPIC_API_KEY | — | Your Anthropic key. Stays on your machine; the proxy uses it to call Anthropic directly. |
MODELPILOT_API_KEY | — | Authenticates your gateway to ModelPilot (created on the Connect page). Sent as a bearer token; recommended over a bare deployment id. |
MODELPILOT_DEPLOYMENT_ID | — | Your deployment id (dep_…). Identifies which account's mode, policy & billing apply. |
MODELPILOT_BRAIN_URL | — | The hosted routing brain. Set it to enable routing; unset = pure passthrough. |
MODELPILOT_CONSOLE_URL | — | The console base URL — enables metering, approved-policy fetch, and proposals. |
MODELPILOT_UPSTREAM | https://api.anthropic.com | Where the proxy forwards traffic. |
MODELPILOT_PORT | 8400 | Port the proxy listens on. |
Mode & refresh
| Variable | Default | Description |
|---|---|---|
MODELPILOT_MODE | autopilot | Local fallback mode. The account mode set in the console is authoritative when a brain is configured. |
MODELPILOT_POLICY_REFRESH | 300 | Seconds between background refetches of admin-approved floors & rules. Newly approved tuning applies without a restart. |
Metering & billing
When MODELPILOT_CONSOLE_URL + a key/deployment id are set, the client reports realized-savings
deltas to the console so your bill reflects delivered savings — aggregate dollars and counts only, never
prompt text.
| Variable | Default | Description |
|---|---|---|
MODELPILOT_METER_INTERVAL | 60 | Seconds between background metering reports. |
MODELPILOT_DB | modelpilot.db | Local ledger path (counts/dollars; no prompt text). |
Prefer a sidecar/cron? Run modelpilot meter --watch instead of the
built-in reporter.
Proxy URL for your app
| Variable | Default | Description |
|---|---|---|
MODELPILOT_PROXY_URL | http://127.0.0.1:8400 | Used by the SDK helper (SDKs) to find your local proxy. |
Set a spend budget and a minimum model per deployment in
Settings — those are enforced server-side, no client config needed.
© 2026 ModelPilot · krethikram@gmail.com