MorseSign inOpen Morse

GLM 5.2 for coding: its scores, and real Claude Code and Codex runs through a private API

The Morse teamPublished Facts checked 3 min read

GLM 5.2 is a strong open-weight coding model: Z.ai built it for long software tasks, gave it a usable million-token window, and on its own table it scores 62.1 on SWE-bench Pro and 81.0 on Terminal Bench 2.1. Through Morse's private API it runs in Claude Code and Codex with a few settings. We ran both on December 3, 2026, and each fixed a real bug in about 12 seconds.

This page covers what GLM 5.2 is good at in code, the settings for each tool, what happened in our runs, and when to pick a different model. The model's full specs and limits are on its model page.

How good is GLM 5.2 at coding?

Z.ai's GLM-5.2 card reports these coding scores, beside GLM 5.1:

BenchmarkWhat it measuresGLM 5.2GLM 5.1
SWE-bench ProFixing real repository issues62.158.4
NL2RepoBuilding a repository from a spec48.942.7
ProgramBenchWriting complete programs63.750.9
Terminal Bench 2.1 (best harness)Working in a shell82.769.0
FrontierSWELong engineering tasks74.430.5
SWE-MarathonMulti-hour sessions13.01.0

Source: GLM-5.2 model card, read December 3, 2026.

The pattern is that the longer the task, the bigger the gain. Single-issue fixes improve a few points; tasks that run for hours improve many times over. That matches what Z.ai built it for: long-horizon work over a million-token context.

How do you set up Claude Code with GLM 5.2?

Claude Code speaks Anthropic's Messages API, which Morse serves. Set these in the shell you start it from, with your Morse key in MORSE_API_KEY:

export ANTHROPIC_BASE_URL=https://inference.trymorse.ai
export ANTHROPIC_AUTH_TOKEN="$MORSE_API_KEY"
export ANTHROPIC_MODEL=z-ai/glm-5.2
export ANTHROPIC_DEFAULT_OPUS_MODEL=z-ai/glm-5.2
export ANTHROPIC_DEFAULT_SONNET_MODEL=z-ai/glm-5.2
export ANTHROPIC_DEFAULT_HAIKU_MODEL=z-ai/glm-5.2
export CLAUDE_CODE_MAX_OUTPUT_TOKENS=32000
export CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000
claude

The base URL has no /v1, since Claude Code adds the path itself, and all four model lines point at GLM 5.2 so background work doesn't fall back to names Morse doesn't serve. Morse's Claude Code guide has the full walkthrough.

How do you set up Codex with GLM 5.2?

Codex speaks OpenAI's Responses API. Add Morse as a provider in ~/.codex/config.toml and run codex in your project:

model = "z-ai/glm-5.2"
model_provider = "morse"
web_search = "disabled"
model_context_window = 1048576
model_auto_compact_token_limit = 200000

[model_providers.morse]
name = "Morse"
base_url = "https://inference.trymorse.ai/v1"
env_key = "MORSE_API_KEY"
wire_api = "responses"

The context window matches GLM 5.2's million tokens, and Codex compacts the conversation at 200,000 so long sessions stay quick. Morse's Codex guide has the rest.

What happened when we ran it?

We gave both tools the same one-file Python project: a find_user function that built a SQL query by joining strings, and the instruction "Fix it with a parameterized query. Change nothing else."

ToolResultTimeNotes
Claude Code (2.1.333)Replaced the string join with a ? placeholder and a (name,) tuple11 s4 turns, only Read and Edit allowed
Codex (0.172.0)The same fix, on the same line12 sAbout 14,000 tokens used

Both left the rest of the file untouched and explained the change in one line. Morse's model page measured GLM 5.2 on December 1, 2026 at 0.38 s to the first token and 87 tokens per second, which keeps the back-and-forth of an agent loop quick.

Which reasoning effort should you use?

On Morse, reasoning_effort for GLM 5.2 takes "none", "high", or "xhigh". Thinking costs output tokens and time, so match it to the task:

  • none for small, well-specified edits like the one above, renames, and test fixes.
  • high for changes across several files, debugging with unclear causes, and planning.
  • xhigh for the hardest long tasks, where a wrong plan costs more than the wait.

When should you use a different model?

When the work is security-sensitive and a stock model stops short. Morse serves GLM 5.3 Uncensored, an abliterated build of the next GLM, for cybersecurity, agent security, AI and ML research, and training data: writing a proof of concept against your own staging server, for example. For fast, cheap edits, GLM 5.3 Flash is priced lower. Our best models for coding agents compares more options.

What does a coding session cost?

GLM 5.2 bills at $1.40 per million input tokens and $4.40 per million output tokens, and input it has already seen at $0.26 per million cached input tokens. Coding agents resend the same files on every turn, so most of a long session's input bills at the cached rate. Our Codex run used about 14,000 tokens for one small fix. It runs under zero-data-retention terms, and the provider sees Morse as the customer, not you. Get an API key and point either tool at it.

Common questions

Is GLM 5.2 good for coding?

On Z.ai's own table, yes: 62.1 on SWE-bench Pro, 81.0 on Terminal Bench 2.1 in the Terminus-2 harness, and 74.4 on FrontierSWE, all well above GLM 5.1. In our runs it fixed a SQL injection in both Claude Code and Codex.

Can I use GLM 5.2 in Claude Code?

Yes. Set ANTHROPIC_BASE_URL to Morse's API origin, put your Morse key in ANTHROPIC_AUTH_TOKEN, and set the four model variables to z-ai/glm-5.2.

Can I use GLM 5.2 in Codex?

Yes. Add Morse as a provider in ~/.codex/config.toml with wire_api set to responses and the model set to z-ai/glm-5.2. Our run used about 14,000 tokens to fix one function.

What reasoning effort should I use for coding?

Start at high for multi-file changes and drop to none for small, well-defined edits. On Morse, reasoning_effort for GLM 5.2 takes "none", "high", or "xhigh".

Ask what you actually want to ask.

80+ models, characters, and images, with every chat encrypted and kept on your device. Free to start.

Start a private chat

Read next