Configure Claude Code
Set two environment variables to route all Claude Code requests through Chuizi.AI with native Anthropic protocol passthrough.
| Variable | Value | Purpose |
|---|---|---|
ANTHROPIC_BASE_URL | https://api.chuizi.ai/anthropic | API endpoint URL |
ANTHROPIC_API_KEY | ck-your-key-here | Your Chuizi.AI API key |
Make sure to use the /anthropic path. This is the native Anthropic protocol endpoint with zero format conversion, giving you the best performance and full compatibility with all Claude Code features including streaming, tool use, and prompt caching.
Method 1: Shell Profile (Recommended)
Add the environment variables to your shell profile so they're set automatically every time you open a terminal.
zsh users (macOS default):
terminal
bash
echo 'export ANTHROPIC_BASE_URL=https://api.chuizi.ai/anthropic' >> ~/.zshrc echo 'export ANTHROPIC_API_KEY=ck-your-key-here' >> ~/.zshrc source ~/.zshrc
bash users (most Linux distributions):
terminal
bash
echo 'export ANTHROPIC_BASE_URL=https://api.chuizi.ai/anthropic' >> ~/.bashrc echo 'export ANTHROPIC_API_KEY=ck-your-key-here' >> ~/.bashrc source ~/.bashrc
Once configured, just run:
terminal
bash
claudeNext Steps
- Model Selection - Learn how to switch between Claude models
- Troubleshooting - Solutions for common issues