Claude Code setup
Point Claude Code at APIMaster via settings.json on Windows and macOS.
Claude Code setup
Prerequisites: Environment check, API key.
Use Anthropic-compatible base URL https://apimaster.ai (site root — no /v1; OpenAI uses https://apimaster.ai/v1).
Windows
1. Open config folder
Win + R:
%userprofile%\.claude
2. settings.json
Create the file if missing:
{
"env": {
"ANTHROPIC_BASE_URL": "https://apimaster.ai",
"ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
"CLAUDE_CODE_ATTRIBUTION_HEADER": "0"
}
}
Replace YOUR_API_KEY with your APIMaster console token. If auth fails, try ANTHROPIC_API_KEY with the same value (version-dependent).
3. Test
claude
Run /model claude-sonnet-4-6 (or another supported model) and send a message.
macOS
Command + Shift + G → ~/.claude — same settings.json as Windows.
claude
Troubleshooting
| Symptom | Action |
|---|---|
| Prompts for Anthropic login | Verify ANTHROPIC_BASE_URL is https://apimaster.ai (no /v1) |
| 401 | Regenerate key; no extra spaces |
| Unknown model | Use ids from Supported models |
Env vars only: short guide.