Prerequisites
- Claude Code installed (
npm install -g @anthropic-ai/claude-codeor via installer) - A ClearMaas API key starting with
sk-
Setup
Set two environment variables before launching Claude Code:/v1/messages itself, so the base URL must be the bare host �?no /v1 suffix.
Persistent configuration
Rather than exporting env vars each time, add them to your shell profile:settings.json under the env key:
.claude/settings.json�?project-scoped~/.claude/settings.json�?user-scoped
Choosing a model
By default Claude Code usesclaude-sonnet-4-7-latest. Override the model in settings.json:
anthropic/ prefix routes through ClearMaas’s Anthropic-compatible path. To use models from other providers (GPT, Grok, DeepSeek, etc.), Claude Code can route them via ClearMaas’s translation layer.
Model routing via ClearMaas
ClearMaas translates OpenAI-style requests to upstream providers. To use a non-Anthropic model with Claude Code:MCP and tool search
WhenANTHROPIC_BASE_URL points to a non-Anthropic host, Claude Code disables MCP tool search by default. If your proxy forwards tool_reference blocks correctly, re-enable it:
Verification
Run a quick test after setup:Troubleshooting
| Issue | Solution |
|---|---|
ANTHROPIC_BASE_URL ignored during setup | Upgrade Claude Code to the latest version; this was fixed after v2.0.74 |
| MCP tools not working | Set ENABLE_TOOL_SEARCH=true or upgrade Claude Code |
| Model not found | Ensure the model ID uses the correct prefix (anthropic/, openai/, etc.) |
| Auth error | Verify your ClearMaas API key starts with sk- |