| Variable | Value |
|---|---|
ANTHROPIC_BASE_URL | https://api.emix.ai/claude |
ANTHROPIC_API_KEY | Bearer <your emix.ai API Key> |
ANTHROPIC_AUTH_TOKEN | <your emix.ai API Key> (alternative to ANTHROPIC_API_KEY β no Bearer prefix needed) |
Important Notes Set ANTHROPIC_BASE_URLtohttps://api.emix.ai/claudeonly β do not append/v1/messages. Claude Code appends that automatically.There are two ways to provide your API Key β choose one: Option 1: Use ANTHROPIC_API_KEY. The value must start withBearer(note the space after Bearer). Example:Bearer sk-emix-abc123xxxOption 2: Use ANTHROPIC_AUTH_TOKEN. Set it directly to the Key value β no Bearer prefix. Example:sk-emix-abc123xxx
irm https://claude.ai/install.ps1 | iexclaude --version. If you see a version number, the installation succeeded.β οΈ If the claudecommand is not found, check that Claude Code was added to your PATH.β οΈ After installing, do not log in with an Anthropic account. You will connect using your emix.ai credentials in the next step.
# Option 1: ANTHROPIC_API_KEY (Bearer prefix required)
[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://api.emix.ai/claude", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_API_KEY", "Bearer your_emix_API_Key", "User")# Option 2: ANTHROPIC_AUTH_TOKEN (no Bearer prefix)
[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://api.emix.ai/claude", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "your_emix_API_Key", "User")claude. Does not affect other programs on your system β a cleaner option if you prefer isolation.~/.claude/settings.jsonC:\Users\<your-username>\.claude\settings.json// Option 1: ANTHROPIC_API_KEY (Bearer prefix required)
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.emix.ai/claude",
"ANTHROPIC_API_KEY": "Bearer your_emix_API_Key"
}
}// Option 2: ANTHROPIC_AUTH_TOKEN (no Bearer prefix)
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.emix.ai/claude",
"ANTHROPIC_AUTH_TOKEN": "your_emix_API_Key"
}
}https://github.com/farion1231/cc-switch/releases
| Symptom | Cause / Solution |
|---|---|
| Still prompted to log in with Anthropic account | Environment variables not loaded. Fully close all terminal windows (Mac: right-click Terminal β Quit; Windows: close all PowerShell processes) and reopen. |
401 Unauthorized error | API Key is wrong or expired. If using ANTHROPIC_API_KEY, confirm the Bearer prefix is present. If using ANTHROPIC_AUTH_TOKEN, set it to the raw Key with no prefix. Check your key in the emix.ai dashboard. |
model not found error | Inside Claude, run /model and switch to a model supported by emix.ai. |
| Windows β changes still not working | Close all terminals, including built-in terminals in VSCode, Cursor, and other editors. Fully quit those apps and relaunch. |
claude --debug and review the detailed logs..claude/settings.json to .gitignore. Files placed in your home directory (~/.claude/) are safe by default.