Documentation
All documents

Model providers & local proxy

Six preset providers, a loopback-only proxy that injects real keys, and CLI takeover.

Windows

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.

IDProviderAnthropic-compatible base URLCategory
kimiKimi (Moonshot)https://api.moonshot.cn/anthropicCnOfficial
deepseekDeepSeekhttps://api.deepseek.com/anthropicCnOfficial
zhipuGLM (Zhipu)https://open.bigmodel.cn/api/anthropicCnOfficial
xiaomiMiMo (Xiaomi)https://api.xiaomimimo.com/anthropicCnOfficial
minimaxMiniMaxhttps://api.minimaxi.com/anthropicCnOfficial
customCustom / gatewayleave blank and fill in yourselfCustom

Add and switch a provider

1

Open Settings > Model config

Pick the agent tab you want to configure (Claude Code, Codex, OpenCode or pi).

2

Choose a preset

Select one of the catalog entries, or choose Custom to enter a base URL by hand.

3

Fill in the key

Provide your own API key. It stays on this machine.

4

Save and switch

Save the entry, then use Switch Provider to make it active for that agent.

5

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.

CLIConfig file touchedWhat is written
Claude Code~/.claude/settings.jsonenv.ANTHROPIC_BASE_URL and env.ANTHROPIC_AUTH_TOKEN
Codex CLI~/.codex/config.toml[model_providers.brewping] section
pi~/.pi/agent/models.jsonproviders.brewping entry
OpenCode~/.config/opencode/opencode.jsonread for configuration
text
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 instead

Failover 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

Providers, the active selection per agent, the proxy switch and port, and the failover switch are all persisted in ~/.brewping/model_providers.json.