Use Claude Code with amazee.ai¶
Claude Code is Anthropic's agentic coding tool that works directly in your terminal. By routing it through amazee.ai, you get access to Claude models hosted in your region — with your data staying in your chosen geography and your usage tracked through your amazee.ai workspace.
Why use Claude Code with amazee.ai?¶
Data residency. Claude Code requests are processed through your regional amazee.ai endpoint. Pick Switzerland, Germany, the US, Australia, or the UK.
Team budget controls. Set spending limits per team, user, and key from my.amazee.io. No surprise invoices.
Usage visibility. All Claude Code activity shows up in your amazee.ai usage dashboard — per key, per user, per team.
Quick start¶
Step 1 — Install Claude Code¶
Step 2 — Get your endpoint and key¶
Log in at my.amazee.io, go to your workspace, and copy:
- Your API endpoint:
https://llm.[your-region].amazee.ai - Your API key
Step 3 — Connect Claude Code to amazee.ai¶
Add these environment variables to your shell profile (~/.zshrc, ~/.bashrc, or ~/.config/fish/config.fish):
export AMAZEEAI_API_KEY="your-api-key-here"
export ANTHROPIC_BASE_URL="https://llm.[your-region].amazee.ai"
export ANTHROPIC_AUTH_TOKEN="$AMAZEEAI_API_KEY"
export ANTHROPIC_API_KEY="" # must be explicitly empty
Then reload your shell:
ANTHROPIC_API_KEY must be empty — not unset
Claude Code falls back to direct Anthropic authentication if this variable is unset. Set it to an empty string "" to prevent that.
If you were previously logged in to Anthropic
Run /logout inside a Claude Code session to clear cached credentials before the new config takes effect.
Step 4 — Start a session¶
Step 5 — Verify¶
Run /status inside Claude Code:
You can also check my.amazee.io → Usage to see requests appearing in real time.
How it works¶
amazee.ai's API gateway speaks the same protocol as the Anthropic API. When you set ANTHROPIC_BASE_URL, Claude Code routes all requests to your amazee.ai endpoint instead of Anthropic's servers. No local proxy needed.
Configuring models¶
Claude Code uses different models for different task types. You can pin each role to a specific model:
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4"
export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-4-5"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-4-5"
export CLAUDE_CODE_SUBAGENT_MODEL="claude-sonnet-4-5"
| Variable | Used for |
|---|---|
ANTHROPIC_DEFAULT_OPUS_MODEL |
Complex reasoning tasks |
ANTHROPIC_DEFAULT_SONNET_MODEL |
General coding |
ANTHROPIC_DEFAULT_HAIKU_MODEL |
Quick completions |
CLAUDE_CODE_SUBAGENT_MODEL |
Sub-agents spawned during a session |
Add these to the same shell profile as your ANTHROPIC_BASE_URL.
See Available Models for the full list.
GitHub Actions¶
To use amazee.ai in the Claude Code GitHub Action:
- name: Run Claude Code
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.AMAZEEAI_API_KEY }}
env:
ANTHROPIC_BASE_URL: https://llm.[your-region].amazee.ai
Store your key as a GitHub secret named AMAZEEAI_API_KEY.
Troubleshooting¶
- Auth errors / "invalid API key"
- Make sure
ANTHROPIC_API_KEYis set to""(empty string), not unset. Runecho $ANTHROPIC_API_KEY— it should print nothing. If it prints a key value, something in your shell config is still setting it. - Requests going to Anthropic instead of amazee.ai
- Run
/logoutin Claude Code, then verifyANTHROPIC_BASE_URLis set correctly withecho $ANTHROPIC_BASE_URL. - Model not found
- Check Available Models. Use the exact model ID shown there. Model availability depends on your region and plan.
- Context length errors
- Break the task into smaller chunks or start a fresh session (
/clear).