One-command, API-key-only setup for using Claude Code with six models from three provider keys:
- Anthropic:
claude-sonnet-5,claude-opus-4-8 - OpenAI:
gpt-5.6-sol,gpt-5.6-terrathrough the Responses API - Ollama Cloud:
deepseek-v4-flash,glm-5.2
One more model is supported by the launcher but requires a manual config addition (see Adding Grok):
- xAI:
grok-4.5
No provider OAuth login is used.
- macOS 13 or newer
- Homebrew
- API keys for Anthropic, OpenAI, and Ollama Cloud
- An xAI API key, only if you want
grok-4.5(see Adding Grok)
The installer adds CLIProxyAPI, Claude Code (when missing), jq, and ripgrep.
git clone <REPOSITORY_URL>
cd cliproxyapi-claude-code-macos
./install.shThe three API-key prompts are hidden. Real keys are written only to
~/.cli-proxy-api/config.yaml, which is created with mode 600. They are not
written into this repository or shell history.
For non-interactive provisioning, the installer also accepts
ANTHROPIC_API_KEY, OPENAI_API_KEY, and OLLAMA_API_KEY from the environment.
Interactive prompts are safer for ordinary use because exported secrets can be
inherited by child processes.
To configure without making six live test calls:
./install.sh --skip-doctorOpen a new terminal and run:
ccThis opens an interactive picker. Direct aliases are also available:
cc sonnet
cc opus xhigh
cc gpt high
cc deepseek high
cc glm high
cc terra high
cc grok highSee the complete cc usage guide for model aliases, effort
controls, diagnostics, configuration, logs, troubleshooting, and forwarded
Claude Code arguments.
Inside Claude Code, /model retains the model selected by cc. Use /effort
to adjust reasoning during a session.
cc doctor
cc statuscc doctor sends one small live request to each model and requires it to
return an Anthropic-compatible tool call. It verifies routing, reasoning
settings, request/response translation, and function tools.
config/cliproxyapi.example.yamlcontains all providers and deliberately fakeDUMMY_*keys.config/claude-settings.example.jsonshows a minimal Claude Code setting withoutapiKeyHelper.
Do not copy a working ~/.cli-proxy-api/config.yaml into Git: it contains real
provider keys. The repository ignores a root config.yaml as an extra guard.
CLIProxyAPI's generic OpenAI-compatible executor uses Chat Completions.
GPT-5.6 Sol requires the Responses API to combine reasoning effort with
function tools, so this setup uses CLIProxyAPI's API-key codex-api-key
provider pointed at https://api.openai.com/v1. This is still standard OpenAI
API-key authentication, not OAuth.
gpt-5.6-terra reuses the same OpenAI key as gpt-5.6-sol — it's already
provisioned by install.sh, no extra key needed. It's a second model entry
under the same codex-api-key provider in config/cliproxyapi.example.yaml.
grok-4.5 is not yet wired into install.sh's key prompts, so it needs one
manual step after install. Add an xAI API key (from
console.x.ai) as a new openai-compatibility
provider in ~/.cli-proxy-api/config.yaml:
openai-compatibility:
# ...existing providers...
- name: "xai"
base-url: "https://api.x.ai/v1"
api-key-entries:
- api-key: "xai-YOUR-KEY-HERE"
models:
- name: "grok-4.5"
alias: "grok-4.5"
display-name: "Grok 4.5"
thinking:
levels: ["low", "medium", "high"]Then:
chmod 600 ~/.cli-proxy-api/config.yaml
brew services restart cliproxyapi
cc doctor grokGrok 4.5 only supports low/medium/high effort (no none or xhigh).
| Path | Purpose |
|---|---|
~/.local/bin/cc |
Claude Code model picker and diagnostics |
~/.cli-proxy-api/config.yaml |
Private provider configuration and keys |
~/.cli-proxy-api/client-token |
Random localhost proxy token |
$(brew --prefix)/etc/cliproxyapi.conf |
Symlink to the private config |
Existing CLIProxyAPI and Claude settings are timestamp-backed up before they
are changed. If Claude Code has apiKeyHelper, the installer removes only that
field because it conflicts with the launcher's ANTHROPIC_AUTH_TOKEN; the full
settings file is backed up first.
Preserve private configuration:
./uninstall.shAlso remove ~/.cli-proxy-api:
./uninstall.sh --purgeThe smoke test uses an isolated temporary home, fake Homebrew/Claude binaries, dummy keys, and a local mock API. It does not alter the real user setup:
./tests/smoke.sh