Setup guide

Provider setup guide

Browse setup steps and troubleshooting by tool.

Provider setup guide/Claude Code Configuration

Claude Code Configuration

Claude Code is Anthropic's terminal programming tool for developers. It can read the current project, help you explain code, modify files, run check commands, and can also work with the Claude model to handle more complex development tasks.

What this tool is and what it is used for

Code modificationTerminal toolsClaude modelAuthorization needs to be careful

Where to look for configuration first

LocationWho it is suitable forDescription
~/. claude/settings.jsonPeople who want to save the configuration permanentlyWrite the environment variables related to Claude Code into the configuration file, it's easier to troubleshoot.
Current terminal environment variablesPeople who just want to test temporarilyIt usually will not continue to take effect after the terminal is closed.
CC SwitchPeople who manage multiple CLIs at the same timeFirst configure the Provider on the CC Switch page, then apply it to Claude Code

How to fill in Key and interface

If using the official Claude, prioritize following the official login or official Key process through Anthropic / Claude Code. If using an AI provider, you must confirm that the provider offers the Claude / Anthropic interface, and do not enter a regular OpenAI compatible address into Claude Code.

Claude Code settings.json example
{ "env": { "ANTHROPIC_API_KEY": "YOUR_KEY", "ANTHROPIC_BASE_URL": "https://YOUR_PROVIDER_CLAUDE_API_URL", "ANTHROPIC_MODEL": "PROVIDER_SUPPORTED_CLAUDE_MODEL" } }
SettingWhere are you fromCommon mistakes
ANTHROPIC_API_KEYClaude / Anthropic Key in the provider backendDo not use the token remark name as the Key
ANTHROPIC_BASE_URLThe Claude / Anthropic interface address provided by the providerDo not copy the OpenAI compatible address
ANTHROPIC_MODELThe Claude model name in the provider model listCopy the case, hyphens, and version numbers exactly

How to test after saving

Claude Code Minimal Test
claude "Please reply only: Configuration successful"

If you are still using the old configuration, first check whether there is an old Key or old Base URL in the system environment variables. The priority of environment variables may cause the settings you just changed to not take effect.

Claude Code settings Official Documentation Check the scope and configuration method of settings.json.
Claude Code environment variables View authentication, Base URL, and model variable instructions.