Invite & Earn

How invite rewards work

Share your invite link. When a friend registers through it and tops up, you receive the displayed reward on their subsequent top-ups.

Claude Code Still Uses the Old Provider: How to Verify Its Route

You changed the Base URL but Claude Code behaves the same. Identify the affected client, find the active settings source, and match a test request to provider records.

Contents
Claude Code Still Uses the Old Provider: How to Verify Its Route

You changed ANTHROPIC_BASE_URL, but Claude Code still appears to contact the old service. Before replacing the key or reinstalling the client, check two things: which process you are testing and what record its request leaves with the provider. A correct answer, a model name in the UI, or a variable in one terminal does not establish the destination by itself.

This guide assumes you already have a configuration. For first-time setup and current values, use the Claude Code setup guide. The task here is to locate a conflict and verify the route used by one specific client.

Start with the symptom you can reproduce

What you observeFirst comparisonWhat it separates
The terminal works, but VS Code appears to use the old serviceRun one request from each client in the same directoryA project-wide issue from an extension launch or settings difference
Only one project is affectedUse the same client in the affected project and a test directoryA project setting from a machine-wide source
The issue returns after every new launchCompare settings before and after starting the provider managerA persistent change from a value rewritten by a tool
Claude Code responds, but no matching BetterToken record appearsCheck the time, account, key, and history filtersLooking in the wrong place from a route that is still unverified

These comparisons narrow the search; they do not prove the cause. Before making changes, record the client, launch method, directory, and test time.

Separate the shell, settings files, and running client

On macOS or Linux, run these commands in the terminal you will use to launch the CLI:

printenv ANTHROPIC_BASE_URL
test -n "$ANTHROPIC_AUTH_TOKEN" && echo "ANTHROPIC_AUTH_TOKEN is set"
test -n "$ANTHROPIC_API_KEY" && echo "ANTHROPIC_API_KEY is set"

The first result belongs to that shell. The other lines report only whether a value exists; they do not print the key. Empty output does not prove that Claude Code has no authentication because another source may supply it. This check also does not read the environment of an already running process or the VS Code extension.

Next, locate files that may define the same variables. From the project root, this command prints only matching filenames in common locations:

grep -lE '"ANTHROPIC_(BASE_URL|AUTH_TOKEN|API_KEY)"' \
  ~/.claude/settings.json \
  .claude/settings.json \
  .claude/settings.local.json 2>/dev/null

This is not an exhaustive search. A custom configuration directory, managed organizational settings, or a separate launch tool may add other sources. No result means only that no readable match was found in these three paths. On Windows, inspect the equivalent files in an editor without copying their contents into a chat.

Claude Code applies precedence across settings sources, and the effective value cannot be inferred from printenv alone. Consult the official settings reference and run /status in the CLI to identify loaded sources. If an organizational policy applies, ask the administrator to check its effective value.

Isolate the difference between terminal and VS Code

Keep the directory and test inputs the same. In VS Code, also inspect claudeCode.environmentVariables, described in the client setup guide. Do not assume the extension was launched with the environment of its integrated terminal.

If you use a shell script or provider manager, check whether it defines variables or rewrites a file during startup. An .env file matters only when a component in the launch path loads it; its presence is not proof that it is active.

Correct one identified source at a time and preserve the other fields in the file. To compare two launches, close the client under test and start it again in the same way. Restart VS Code when needed for the extension. This restart makes the comparison repeatable; it does not imply that every setting always requires a restart.

Verify the destination with an identifiable request

In a test directory with no sensitive data, note the time and send this from the affected client:

Reply only: ROUTE_CHECK_A7. Do not read files,
change anything, or run commands.

This is a short response instruction, not a security boundary. Do not run the test in a sensitive repository or approve any additional actions.

If BetterToken is the expected destination, open request history in Workspace. Check the account and filters, then look for new records around the noted time. When the key is identifiable, match it along with the model, status, and usage. One client action may produce several calls, so do not require a one-message-to-one-row match.

ResultSupported conclusionNext step
A response arrives and matching records exist for the expected keyThe test is consistent with routing through BetterTokenRepeat after a fresh client launch
A response arrives but no matching record appearsThe destination is still unverifiedCheck the account, filters, display delay, and other settings sources
A record appears with an errorThe request reached the service but did not complete correctlyCorrect the configuration using the API Key and Base URL guide
Several clients or people use the same key at the same timeTime alone cannot attribute the record to your testRepeat with a personal key and no concurrent activity

ROUTE_CHECK_A7 identifies the answer in the client. Do not assume that this text appears in provider history. A nearby record remains indirect evidence when another request could explain it.

Know when the diagnosis is complete

Treat the route as confirmed when the affected client produces matching records at the expected provider and keeps that result after a fresh launch. If only VS Code still fails, continue with its launch path and settings instead of changing the working CLI again.

If the destination remains unclear, prepare the client version, launch method, whether the issue depends on one directory, the time with timezone, identified settings sources, and comparison result for support. Remove API Key values, authorization headers, and project content. This gives support a reproducible difference without granting access.

Ready to optimize your LLM workflow?

Join thousands of developers building faster, smarter, and more cost-effective AI applications with BetterToken.

Get Started for Free