Model providers & local proxy
Six preset providers, a loopback-only proxy that injects real keys, and CLI takeover.
Preset providers
The catalog ships with five China-region official providers plus a custom entry. These are static templates only — they contain no API keys.
| ID | Provider | Anthropic-compatible base URL | Category |
|---|---|---|---|
| kimi | Kimi (Moonshot) | https://api.moonshot.cn/anthropic | CnOfficial |
| deepseek | DeepSeek | https://api.deepseek.com/anthropic | CnOfficial |
| zhipu | GLM (Zhipu) | https://open.bigmodel.cn/api/anthropic | CnOfficial |
| xiaomi | MiMo (Xiaomi) | https://api.xiaomimimo.com/anthropic | CnOfficial |
| minimax | MiniMax | https://api.minimaxi.com/anthropic | CnOfficial |
| custom | Custom / gateway | leave blank and fill in yourself | Custom |
Add and switch a provider
Open Settings > Model config
Pick the agent tab you want to configure (Claude Code, Codex, OpenCode or pi).
Choose a preset
Select one of the catalog entries, or choose Custom to enter a base URL by hand.
Fill in the key
Provide your own API key. It stays on this machine.
Save and switch
Save the entry, then use Switch Provider to make it active for that agent.
Optionally browse models
Fetch the provider's model list and pick a default model, or leave it on Follow Agent Config.
Local model proxy
When enabled, BrewPing runs a small axum server bound to 127.0.0.1:15721. The CLI agents are pointed at it, and it forwards requests to the real provider — injecting the real key on the way.
- Alias routes strip a prefix: /claude/*, /codex/*, /gemini/*, /pi/* and /opencode/*.
- Authentication headers sent by the CLI (authorization, x-api-key, x-goog-api-key) are discarded, then replaced with the configured key as Bearer or x-api-key.
- Protocol translation is handled per provider format: Anthropic, OpenAI Chat or OpenAI Responses.
- Bound to loopback only — the proxy is never reachable from your network.
CLI takeover
Takeover rewrites the agent's own config so it talks to the proxy. The real key is never written into the CLI config — only the placeholder string brewping-proxy is.
| CLI | Config file touched | What is written |
|---|---|---|
| Claude Code | ~/.claude/settings.json | env.ANTHROPIC_BASE_URL and env.ANTHROPIC_AUTH_TOKEN |
| Codex CLI | ~/.codex/config.toml | [model_providers.brewping] section |
| pi | ~/.pi/agent/models.json | providers.brewping entry |
| OpenCode | ~/.config/opencode/opencode.json | read for configuration |
Alias endpoints written into CLI configs:
http://127.0.0.1:15721/claude
http://127.0.0.1:15721/codex
http://127.0.0.1:15721/pi
Placeholder key stored in CLI configs:
brewping-proxy <- discarded by the proxy, real key injected insteadFailover and circuit breaker
- A request is retried up to 3 times before it is given up.
- Three consecutive failures open the circuit breaker for 30 seconds; calls in that window fail fast instead of hanging.
- Both the proxy and failover can be switched off in Model config.
- The port is configurable; the default is 15721.
Storage