Claude Code Setup
Use Claude Code with FreeInference — no Anthropic API key needed.
Quick Setup (macOS / Linux)
# Download and run the setup script:
curl -fsSL -o setup_claude_code.sh https://raw.githubusercontent.com/HarvardMadSys/hybridInference/main/scripts/setup_claude_code.sh
bash setup_claude_code.sh
The script will ask for your FreeInference API key, configure ~/.claude/settings.json, and test connectivity.
You can also skip the prompt by passing your key as an env var:
FREEINFERENCE_API_KEY="your-key-here" bash setup_claude_code.sh
Manual Setup
If you prefer to configure manually, edit ~/.claude/settings.json:
{
"env": {
"ANTHROPIC_BASE_URL": "https://freeinference.org/anthropic",
"ANTHROPIC_AUTH_TOKEN": "<your-freeinference-api-key>",
"API_TIMEOUT_MS": "600000"
}
}
On Windows the file is at %USERPROFILE%\.claude\settings.json.
Available Models
Model |
Description |
|---|---|
|
Default model in Claude Code |
|
Most capable |
Usage
cd your-project
claude
That’s it. All Claude Code features (tool use, file editing, search, etc.) work normally.
Troubleshooting
Error |
Cause |
Fix |
|---|---|---|
401 Authentication error |
Bad API key |
Check |
404 Model not found |
Wrong model ID |
Claude Code uses the correct IDs by default — don’t override |
429 Rate limited |
Too many requests |
Wait a minute and retry |
503 Accounts unavailable |
Subscription pool exhausted |
Wait a minute and retry |
Connection timeout |
Network issue or proxy down |
Check connectivity to |
Uninstall
Remove the three env vars from ~/.claude/settings.json, or delete the file:
rm ~/.claude/settings.json