1. Install Claude Code
- macOS / Linux
- Windows
- npm
2. Configure
Open~/.claude/settings.json (Windows: %USERPROFILE%\.claude\settings.json), create it if it does not exist, and add the env block. Replace YOUR_API_KEY, and deepseek-v4-pro with the model you want.
env instead of replacing the file.
3. Verify
Open a new terminal and run:OK means it works. Each call appears in Usage Logs.
Troubleshooting
model_not_found
model_not_found
One of
ANTHROPIC_MODEL or the three DEFAULT_*_MODEL settings is missing or not an exact RefillAPI model ID. A trailing space also causes this.404 or invalid URL
404 or invalid URL
ANTHROPIC_BASE_URL must be https://refillapi.com — no /v1, no /v1/messages.Claude Code still asks me to log in
Claude Code still asks me to log in
The settings were not loaded. Check that the keys are inside
env, that the file is valid JSON (python3 -m json.tool ~/.claude/settings.json), and restart the terminal.