GLM Coding Plan's Coding Agent uses the model routing value glm-5.4; to use 1M context, use the exact suffix glm-5.4[1m] and set Claude Code's automatic compaction window to 1000000. After switching models, use Claude Code's /status to check the configuration source and current model.
Suitable tasks: Switch to GLM-5.4 in coding tools that support custom models, such as Claude Code, Goose, Codex, and Cline, and verify that 1M context and reasoning intensity are active.
Unsuitable tasks: Treat the Coding Plan configuration as generic Model API integration instructions, or force these values into an Agent that does not support custom models.
Applicable model versions: GLM-5.4; the 1M-context variant is written as glm-5.4[1m].
Applicable clients, agents, or APIs: Claude Code, Goose, Codex, and other Coding Agents that support custom models under the GLM Coding Plan. The page makes no separate model ID or integration commitment for a general public API.
Recommended reasoning tier and parameters: Use max effort for complex coding tasks; Claude Code also defaults to max. Set the context window to 1000000 as required by the tool configuration.
Add or update the following keys in ~/.claude/settings.json; preserve any other existing configuration in the file rather than replacing it wholesale:
{
"env": {
"CLAUDE_CODE_AUTO_COMPACT_WINDOW": "1000000",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-5.4[1m]",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5.4[1m]",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5.4[1m]"
}
}If 1M context is not needed, use glm-5.4 as the model name. To enable 1M, you must use both the [1m] suffix and CLAUDE_CODE_AUTO_COMPACT_WINDOW=1000000. If the tool says that a model with the [1m] suffix does not exist, upgrade Claude Code first.
The page provides the following endpoints by tool; these are Coding Plan configuration values and do not constitute a general public API release statement:
| Tool type | Base URL |
|---|---|
| Claude Code / Goose (Anthropic-compatible) | https://api.z.ai/api/anthropic |
| Codex | https://api.z.ai/api/v1 |
| Other OpenAI-compatible tools | https://api.z.ai/api/coding/paas/v4 |
Use the endpoint corresponding to the tool, a Z.AI API key, and the model name glm-5.4 or glm-5.4[1m]. The page covers switching models for existing GLM Coding Plan users, not the general Model API documentation; do not infer additional public API model IDs, SDKs, or service availability from it.
Confirm that you have a valid GLM Coding Plan subscription and Z.AI API key.
Set the correct endpoint for the tool type; first complete a basic call with an existing model (for example, glm-5.3-flash). If the basic call fails, fix the endpoint, credentials, or tool configuration before switching models.
Add the environment variables above to ~/.claude/settings.json in Claude Code. For 1M context, set all three default models to glm-5.4[1m].
Start claude, enter /effort in the session, and confirm or switch the reasoning intensity. Choose max for complex coding tasks.
Enter /status in the same session and check that:
Settings source points to ~/.claude/settings.json;
Model shows glm-5.4 or glm-5.4[1m].
If the 1M model does not exist, upgrade Claude Code and verify again; do not assume that the switch succeeded merely because the configuration file exists.
The page is titled “How to Switch Models” and states that the GLM Coding Plan supports GLM-5.4; Max, Pro, and Lite users can switch models in their preferred Coding Agent.
The Claude Code configuration example explicitly gives glm-5.4[1m] as the value for ANTHROPIC_DEFAULT_HAIKU_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, and ANTHROPIC_DEFAULT_OPUS_MODEL, and 1000000 as the value for CLAUDE_CODE_AUTO_COMPACT_WINDOW.
The page explicitly states that the [1m] suffix enables GLM 1M context; if the model is unavailable, Claude Code should be upgraded.
The Effort handling rules are as follows:
| Input | Actual level |
|---|---|
thinking.type not set, true, enabled, or adaptive | max |
thinking.type is false, disabled, none, or off | low |
reasoning_effort is minimal, light, or low | low |
reasoning_effort is medium or high | high |
reasoning_effort is xhigh, max, or ultra | max |
| Any other unknown string | Falls back to max and records a notice |
The priority is “explicit Effort > thinking toggle > default max.” Claude Code uses thinking.type and output_config.effort; Codex uses reasoning.effort. Turning off thinking only changes the level to low; it does not switch to another model.
The Cline example requires selecting OpenAI Compatible, using https://api.z.ai/api/coding/paas/v4, entering the custom model value glm-5.4 or glm-5.3-flash, and setting Context Window Size to 1000000.
glm-5.4 and glm-5.4[1m] are the tool-side model values given on this Coding Plan model-switching page; do not treat the [1m] suffix as a generic model ID accepted by every API.
The endpoint, API key, and model values only establish the configuration path for Coding Agents. The page provides no separate request example, SDK version, authentication details, or additional model ID for the general public Model API.
CLAUDE_CODE_AUTO_COMPACT_WINDOW=1000000 is Claude Code's automatic compaction-window setting; it does not mean that every request can actually use the full 1M context.
/effort changes only thinking intensity; turning off thinking lowers it to low and does not route the request to another model.
This applies only to Coding Agents that support custom model configuration; tools without this capability must wait for official support.
Open the original page and locate Before You Start, Switching Models in Claude Code, Enable 1M Context, Switch Effort (Thinking Intensity), and Step 2: Confirm that the model has been switched.
In the target Coding Agent, first verify a basic call with an existing GLM model, then write the glm-5.4 configuration.
When 1M context is needed, write both the [1m] suffix and CLAUDE_CODE_AUTO_COMPACT_WINDOW=1000000.
Use /effort to set reasoning intensity and /status to check the configuration source and displayed model value; record actual tool behavior separately from the configuration rules on the official page.
GLM-5.4