Using Downsizing with Claude Code
Route Claude Code traffic through Downsizing in seconds using the CLI.
Prerequisites
Install the Downsizing CLI — see the CLI guide if you haven't already.
Link Claude Code (Recommended)
Link Claude Code to Downsizing:
ds link claudeThe CLI prompts you to choose a scope — global (all projects) or local (current folder only). You can skip the prompt by passing the scope directly:
ds link claude globalds link claude localThe CLI writes the correct ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN to the appropriate settings file.
Manual Setup
If you prefer to configure manually, edit ~/.claude/settings.json (global) or .claude/settings.local.json in your project directory (local) and add:
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.downsizing.dev/YOUR_INFERENCE_ID/anthropic",
"ANTHROPIC_AUTH_TOKEN": "dws_YOUR_API_KEY"
}
}Find your Inference ID and API key on the Inference API page. The local file takes precedence over the global one — Claude Code picks up settings.local.json from the working directory.
Verify
Run a quick one-shot query to confirm traffic is routing through Downsizing:
claude -p "hello"If Claude Code responds, Downsizing is set up correctly. You can also check your savings dashboard to see the request appear in your usage metrics.
Unlinking
To remove Downsizing from Claude Code and restore your original settings:
ds unlink claudeSpot an error or something not working? Tell us on Discord or email docs@downsizing.dev.