# Claude Code AI API Proxy switch

Short answer: yes—pair **Opcode** (a native Claude Code GUI) with a **GUI-driven LLM gateway** like **LiteLLM + Open WebUI** (both open-source). This lets you keep using Claude Code while **switching the underlying API/provider from a Mac GUI**.

### What to use

* **Opcode** — a macOS desktop GUI built specifically for Claude Code (sessions, agents, MCP, usage). It doesn’t switch providers by itself, but it’s the nicest Claude Code GUI to sit on top of your workflow. ([GitHub](https://github.com/getAsterisk/claudia))
    
* **LiteLLM (Proxy/Gateway)** — open-source router that exposes an **OpenAI/Anthropic-compatible endpoint** and lets you map aliases to 100+ providers (Anthropic Console, AWS Bedrock, Vertex AI, OpenRouter, local models, etc.). ([GitHub](https://github.com/BerriAI/litellm?utm_source=chatgpt.com))
    
* **Open WebUI** or **LibreChat** — open-source, self-hosted GUIs that plug into LiteLLM so you can **select/swap models/providers** from a web interface instead of editing config files. ([GitHub](https://github.com/open-webui/open-webui?utm_source=chatgpt.com))
    

### Why this works with Claude Code

Claude Code respects Anthropic-style env vars (e.g., `ANTHROPIC_API_KEY`) and can be pointed at a **custom Anthropic-compatible base URL**—so you can route it through LiteLLM (or even Bedrock/Vertex in enterprise setups). ([Claude Help Center](https://support.claude.com/en/articles/12304248-managing-api-key-environment-variables-in-claude-code?utm_source=chatgpt.com))

### Minimal setup (macOS)

1. **Install Opcode** for a nice Claude Code GUI. ([GitHub](https://github.com/getAsterisk/claudia))
    
2. **Run LiteLLM proxy** (Docker or `pip`) and define routes in `config.yaml` (e.g., alias `anthropic/sonnet` → Anthropic Console, Bedrock, or Vertex). ([GitHub](https://github.com/BerriAI/litellm?utm_source=chatgpt.com))
    
3. **Add a GUI:** run **Open WebUI** and connect it to LiteLLM; you can now switch the active model/provider from the browser. ([docs.litellm.ai](https://docs.litellm.ai/docs/tutorials/openweb_ui?utm_source=chatgpt.com))
    
4. **Point Claude Code at the gateway:**
    
    ```bash
    export ANTHROPIC_API_KEY=your_gateway_key
    export ANTHROPIC_BASE_URL=http://localhost:4000/v1  # LiteLLM’s Anthropic/OpenAI-compatible endpoint
    ```
    
    Claude Code will use whatever provider/model the gateway maps to; change it in Open WebUI and you’ve “switched the API” without touching Claude Code. (Claude Code prioritizes `ANTHROPIC_API_KEY` when present.) ([Claude Help Center](https://support.claude.com/en/articles/12304248-managing-api-key-environment-variables-in-claude-code?utm_source=chatgpt.com))
    

If you’d prefer a single app name to start with: **Opcode** for the Claude GUI, and **Open WebUI + LiteLLM** for the clickable provider switch. This combo is fully open-source and runs great on macOS.
