/ agents

Coding Agents

Connect any coding agent to base/mnt.ai — env vars, config files, or a bash alias.

Every popular coding agent lets you override two things: where it sends requests (base URL) and what key it sends (API key). Because base/mnt.ai speaks both the OpenAI and Anthropic wire protocols natively, swapping an agent’s upstream is a config change — the agent never knows.

Three patterns cover every harness:

PatternBest forGuide
Env varsAgents that read ANTHROPIC_* / OPENAI_* env varsPattern: env vars below
Bash alias / functionWrapping one binary so it always carries your configPattern: bash function below
Config fileAgents with a TOML/JSON config on diskPer-agent guides

Env vars

The two protocol families read different variables. Set whichever your harness honors:

env-vars.sh
# Anthropic-protocol clients (Claude Code, Anthropic SDKs):
export ANTHROPIC_BASE_URL=https://api.basemnt.ai
export ANTHROPIC_AUTH_TOKEN=sk-your-key

# OpenAI-protocol clients (Codex, OpenCode, Pi, omp, OpenAI SDKs):
export OPENAI_BASE_URL=https://api.basemnt.ai/v1
export OPENAI_API_KEY=sk-your-key
AUTH_TOKEN vs API_KEY
Anthropic-protocol clients use ANTHROPIC_AUTH_TOKEN (sent as Authorization: Bearer) or ANTHROPIC_API_KEY (sent as x-api-key). The router accepts either header — use AUTH_TOKEN when the harness supports both, since it wins the precedence check in most tools.

Put these in ~/.zshrc / ~/.bashrc to apply to every new shell, or in the agent’s own env file (Claude Code reads ~/.claude/settings.json env, Codex reads ~/.codex/config.toml).

Bash function

For binaries you call yourself, a shell function injects the env without polluting your global environment:

~/.zshrc
# Route claude through base/mnt.ai without touching global env
claude() {
  ANTHROPIC_BASE_URL=https://api.basemnt.ai \
  ANTHROPIC_AUTH_TOKEN="$SK_KEY" \
  command claude "$@"
}

# Same pattern for any OpenAI-protocol CLI
codex() {
  OPENAI_BASE_URL=https://api.basemnt.ai/v1 \
  OPENAI_API_KEY="$SK_KEY" \
  command codex "$@"
}

Keep the key in one place and reference it — export it once from a private rc file or a secrets manager:

~/.secrets.sh
export SK_KEY=sk-your-key
~/.zshrc
[ -f ~/.secrets.sh ] && source ~/.secrets.sh
Why command
Inside the function, the bare name would recurse into itself. command claude resolves the real binary on PATH. An alias also works for pure env injection (alias claude="ANTHROPIC_BASE_URL=… claude") but can't take arguments conditionally the way a function can.

Model IDs

Agents often default to a hard-coded model name (e.g. claude-sonnet-4-5). Pass a catalog model ID explicitly via the agent’s model flag — z-ai/glm-5.2, deepseek/deepseek-v4-flash-0731, or minimax/minimax-m3.

Per-harness guides

  • Claude Code — env vars, settings.json, or a wrapper function
  • Codex CLI — ~/.codex/config.toml model provider
  • OpenCode — opencode.json provider config
  • Pi — model provider env vars
  • omp — base URL env var
  • Others — Cursor, Aider, Continue, Goose, generic OpenAI SDKs