Skip to main content
Claude Code talks to models through the Anthropic Messages API. RefillAPI serves that API for its text models, so you can point Claude Code at DeepSeek, Kimi, GLM or Qwen with one settings file.
On the API Keys page, click Integration config next to the key and choose Claude Code. It generates this file with your key already filled in, and Copy for your agent turns it into instructions for an AI assistant to apply.

1. Install Claude Code

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.
If the file already has other settings, merge these keys into its env instead of replacing the file.
Background tasks (titles, summaries) run often, so a cheaper model such as deepseek-flash works well for ANTHROPIC_DEFAULT_HAIKU_MODEL.

3. Verify

Open a new terminal and run:
An OK means it works. Each call appears in Usage Logs.

Troubleshooting

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.
ANTHROPIC_BASE_URL must be https://refillapi.com — no /v1, no /v1/messages.
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.
The key is wrong, disabled, expired or out of quota, or your wallet is empty. See API keys and Errors.