Gavin - ហ្គាវីន
cd ../posts

Point Claude's CLI at Any AI Provider on Windows

3 min read#Claude CLI#config#Windows#tutorial

You can point the Claude CLI at any AI provider by editing one small settings file on Windows. No reinstall, no environment-variable juggling. This is the written companion to my video — the same six steps, but with the config file laid out so you can copy it directly.

How it works

Normally every Claude CLI request goes straight to Anthropic's servers. A settings file sits in the middle and redirects each request to the provider you choose. You set three values — the address, your key, and the model — and the CLI does the rest.

NOTE

This edits Claude Code's own settings.json. The three values map to the env block: ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, and ANTHROPIC_MODEL.

Step 1 — open PowerShell

Press Start, type PowerShell, and open it.

Step 2 — open the settings file in Notepad

Paste this and press Enter. It creates the .claude folder if it's missing and opens the settings file in Notepad:

if (!(Test-Path "$env:USERPROFILE\.claude")) { New-Item -ItemType Directory "$env:USERPROFILE\.claude" | Out-Null }
notepad "$env:USERPROFILE\.claude\settings.json"

If Notepad asks to create a new file, click Yes. An empty file is fine — you'll fill it in next.

Step 3 — paste this config

You'll set three values: the address (ANTHROPIC_BASE_URL), your key (ANTHROPIC_AUTH_TOKEN), and the model name (ANTHROPIC_MODEL). Paste this into Notepad and swap in your provider's details:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://your-provider.example.com",
    "ANTHROPIC_AUTH_TOKEN": "your-api-key-here",
    "ANTHROPIC_MODEL": "the-model-name"
  }
}
  • ANTHROPIC_BASE_URL — your provider's API endpoint. It must speak the Anthropic Messages API format (many providers offer an Anthropic-compatible route).
  • ANTHROPIC_AUTH_TOKEN — your key with that provider. Sent as the Authorization: Bearer header.
  • ANTHROPIC_MODEL — the exact model name your provider expects.
WARNING

settings.json must be valid JSON — double quotes on every key and value, commas between entries, no trailing comma after the last one. A single typo stops the CLI from loading it.

Step 4 — save the file

Press Ctrl + S in Notepad to save. Keep the filename exactly settings.json — if Notepad tries to append .txt, wrap the name in quotes in the Save dialog.

Step 5 — reopen the CLI

Close any running Claude CLI session and start it again so it picks up the new settings. It now sends every request to your provider.

Verify it worked

Run a quick prompt. If it responds using your provider's model, you're set:

claude "say hello and tell me which model you are"
TIP

To switch back to Anthropic, delete the three lines inside env (or the whole file) and reopen the CLI. Your settings live in one place, so there's nothing else to undo.

That's the whole trick — one file, three values, no reinstall.