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:
| Pattern | Best for | Guide |
|---|---|---|
| Env vars | Agents that read ANTHROPIC_* / OPENAI_* env vars | Pattern: env vars below |
| Bash alias / function | Wrapping one binary so it always carries your config | Pattern: bash function below |
| Config file | Agents with a TOML/JSON config on disk | Per-agent guides |
Env vars
The two protocol families read different variables. Set whichever your harness honors:
# 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-keyANTHROPIC_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:
# 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:
export SK_KEY=sk-your-key[ -f ~/.secrets.sh ] && source ~/.secrets.shcommandcommand 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.