Integrations/Claude Code/Configure Model Provider
Configure Model Provider
Two environment variables point Claude Code at StarUnion, plus optional model mapping.
1. Get an API key
Console → API Keys → create a key and copy it. The full value is shown only once.
2. Set environment variables
export ANTHROPIC_BASE_URL=https://www.starunion.net/v1/anthropic
export ANTHROPIC_AUTH_TOKEN=YOUR_API_KEYAdd them to ~/.zshrc or ~/.bashrc to persist. On Windows PowerShell:
setx ANTHROPIC_BASE_URL "https://www.starunion.net/v1/anthropic"
setx ANTHROPIC_AUTH_TOKEN "YOUR_API_KEY"Use ANTHROPIC_AUTH_TOKEN, not ANTHROPIC_API_KEY — the latter takes the official auth path and returns 401. Do not add a trailing slash to the URL.
3. Verify
Start Claude Code in any project:
cd your-project
claudePress Esc on first launch to skip the official login, then run /status and check:
| Field | Expected | Notes |
|---|---|---|
| Anthropic base URL | https://www.starunion.net/v1/anthropic | no trailing slash |
| Auth | API billing | requests are routed through StarUnion, not a subscription |
4. Use other models
StarUnion can map Claude Code requests to non-Claude models (Qwen, GLM, DeepSeek and others).
Step 1: In the Model Plaza, filter by the Anthropic protocol to list models you can map directly.
Step 2: Copy the model ID from the model card.
Step 3: Set the model variables:
export ANTHROPIC_MODEL=THE_MODEL_ID_YOU_COPIED
export ANTHROPIC_SMALL_FAST_MODEL=A_LIGHTER_MODEL_ID| Variable | Purpose |
|---|---|
ANTHROPIC_MODEL | primary model for coding tasks |
ANTHROPIC_SMALL_FAST_MODEL | lightweight model for summaries, titles and similar |
If the provider already serves Claude models natively, leave the mapping empty.
Troubleshooting
Authentication error
Confirm you used ANTHROPIC_AUTH_TOKEN, that the key is enabled in the console, and that its group includes the target model.
Connection timeout
Check the base URL is https://www.starunion.net/v1/anthropic with no trailing slash.
Model not found
Check in the Model Plaza that the model is listed and available to your group.
Updated: 2026-08-24