Claude Code
Point Claude Code CLI at the APIMaster gateway.
Claude Code
Claude Code can use a custom API endpoint.
Full walkthrough (Windows / macOS,
settings.json): CLI setup → Claude Code.
Environment variables
export ANTHROPIC_BASE_URL="https://apimaster.ai"
export ANTHROPIC_API_KEY="YOUR_APMASTER_API_KEY"
Start claude in that shell and pick a model, e.g.:
/model claude-sonnet-4-6
Variable names follow the Claude Code version you run (ANTHROPIC_AUTH_TOKEN vs ANTHROPIC_API_KEY — use one).
Troubleshooting
| Issue | What to try |
|---|---|
| 401 | Key from APIMaster console, not expired |
| Model missing | Check supported models |
| Truncated output | Raise max_tokens for thinking models |
| SSL errors | Use https:// and the correct host |
You can also route via the OpenAI-compatible path if your plugin expects Chat Completions.