Skip to content

How to Switch Models ​

This guide is intended for existing Coding Flow users who want to switch models. It is not a beginner's getting-started tutorial.

Before you start, make sure you have completed the following

  1. You have an active Coding Flow subscription and a valid API Key.
  2. You have configured the correct endpoint URL for your tool (see the table below).
  3. You have confirmed that your tool can successfully call an existing GLM model (for example, glm-5.1). If the basic call fails, please troubleshoot that issue first.
ProtocolEndpoint URL
OpenAI Chat Completionshttps://api.codingflow.ai/v1
Anthropic Messageshttps://api.codingflow.ai
Google Geminihttps://api.codingflow.ai

Option 1: Switch in Claude Code ​

Step 1 Change the Default Configuration ​

The location of the Claude Code configuration file differs across operating systems. Please edit it according to your OS.

GLM-5.2 Environment Variable Configuration

Regardless of the platform, you need to add or replace the following environment variables in the settings.json configuration file:

json
{
  "env": {
    "CLAUDE_CODE_AUTO_COMPACT_WINDOW": "1000000",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-4.7",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5.2[1m]",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5.2[1m]"
  }
}

macOS ​

The configuration file is located at ~/.claude/settings.json. You can open and edit it in either of the following ways:

  • Method 1 (Terminal): Open the file with vim ~/.claude/settings.json. After editing, press ESC and type :wq to save.
  • Method 2 (Finder): Open Finder → Go to Folder → enter ~/.claude/settings.json, then locate and edit the configuration file.

Windows ​

The configuration file is located at %USERPROFILE%\.claude\settings.json. Create or open the file in PowerShell:

powershell
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.claude"
notepad "$env:USERPROFILE\.claude\settings.json"

You can also paste %USERPROFILE%\.claude into the address bar of File Explorer to open the folder directly.

Note

If you use Git Bash or WSL, ~/.claude may resolve to a different home directory. Make sure you are editing the same configuration file that the currently launched Claude Code installation reads.

Linux / WSL ​

The configuration file is located at ~/.claude/settings.json. Create or open the file:

bash
mkdir -p ~/.claude
${EDITOR:-nano} ~/.claude/settings.json

Note

If you use both WSL and native Windows Claude Code, the configuration file location may differ. Make sure you are editing the configuration file used by the Claude Code installation you actually launch.

Using the 1M Context ​

Enabling the GLM 1M Context

  • The model name must have the [1m] suffix, i.e., glm-5.2[1m].
  • Also configure the compaction window size parameter "CLAUDE_CODE_AUTO_COMPACT_WINDOW": "1000000".
  • If Claude Code reports that the model does not exist after adding the [1m] suffix, please upgrade Claude Code to the latest version and try again.

Switching effort (Reasoning Intensity) ​

In a Claude Code session, type the /effort command to switch the reasoning intensity. After switching, Claude Code internally maps the selected effort to the effort that actually takes effect in GLM-5.2, as shown below:

effort selected in Claude Codeeffort actually mapped in GLM-5.2
low, medium, high (default)high
xhigh, max, ultracodemax

Recommendation

For coding tasks, it is recommended to switch to max effort for deeper reasoning and more stable performance on complex tasks.

Step 2 Confirm the Model Has Been Switched ​

Launch a new command-line window, run claude to start Claude Code, and type /status in Claude Code to confirm the model status:

  1. Settings source shows your ~/.claude/settings.json.
  2. Model shows glm-5.2 or glm-5.2[1m].

claude

Option 2: Switch Using a Tool ​

Using cc switch as an example:

1. Install cc switch

Go to the cc switch official website to start the download. Website: https://ccswitch.io/en/

2. Add a New Provider

Click "+" to add a new provider and configure it, then select Custom Configuration.

ccswitch_1

3. Fill in the Basic Information

Scroll down for detailed configuration and fill in the relevant information as follows:

  • Provider Name: Your custom name.
  • API Key: Create a new API Key via the Coding Flow Console, in the format sk-apv-cp-xxxxxx.
  • Request URL: https://api.codingflow.ai

ccswitch_2

4. Fill in the Environment Variables

Continue filling in the relevant information as follows:

  • ANTHROPIC_BASE_URL: The API URL of the model provider, fixed to https://api.codingflow.ai.
  • ANTHROPIC_AUTH_TOKEN: The authentication key. Enter your API Key (here it is YOUR_API_KEY).
  • ANTHROPIC_MODEL: The model name.
  • CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS: Set to 1 to forcibly disable all experimental Beta features.

ccswitch_3

5. Complete the Setup

Click Add to complete the configuration.