AI Tools - Model brief - Updated June 18, 2026
GLM 5.2 guide: benchmarks, OpenRouter setup, and Codex design workflow.
The headline is not just "big context." GLM 5.2 is an open-weights, long-horizon reasoning model that looks unusually good at sustained coding, project planning, and full-page creative briefing.
Context window
1M
OpenRouter and Z.ai list GLM 5.2 with a 1M-token context window for long-horizon agent work.
OpenRouter
OpenRouter pricing
Z.AI: $1.40 / $4.40
Per 1M input/output tokens. OpenRouter's lowest listed route starts at $1.20/$3.20, but first-party Z.AI routing is higher and providers vary.
OpenRouter
AA Intelligence Index
51
Artificial Analysis ranked it as the leading open-weights model on Intelligence Index v4.1.
Artificial Analysis
GDPval-AA v2
1524
Reported ahead of MiniMax-M3 and DeepSeek V4 Pro, roughly in line with GPT-5.5 xhigh.
Artificial Analysis
Section 01 - Benchmark read
The benchmark story is agentic coding.
Z.ai reports major gains over GLM 5.1 on coding and long-horizon tasks. Artificial Analysis independently ranked it as the leading open-weights model on its Intelligence Index v4.1. Benchmarks are not real life, but this is exactly the category that matters when you ask a model to reason across a full website redesign.
Sources: Z.ai launch benchmark table and Artificial Analysis. Treat first-party model comparisons as directional, not gospel.
Section 02 - Design verdict
How good is it for actual web design?
Very good when you use it the right way. It is better as a creative director than a copy-paste engineer.
Excellent for full-page creative direction
The model responded best when given the whole website, business goal, copy, page inventory, and permission to rethink the full experience.
Strong at keeping long briefs in view
The 1M context and long-horizon training make it useful for feeding a full page audit, constraints, assets, and adjacent routes in one pass.
Use Codex for final implementation
GLM 5.2 can produce code, but the best workflow is to treat it as the art director and have Codex translate the design into clean project code.
My practical read: give GLM 5.2 the whole page, the business goal, the current copy, the constraints, and freedom to invent a design system. Then have Codex implement the strongest ideas. That split is the unlock.
Section 03 - Setup preview
OpenRouter setup, without the mystery.
Create the OpenRouter key
Open OpenRouter, create an API key, add a spending cap, and copy the key immediately because secret keys are only shown once.
Open
Use the exact model slug
Use `z-ai/glm-5.2`. OpenRouter lists high and xhigh reasoning modes for this model; xhigh maps to max reasoning.
Open
Give Codex the key as an environment variable
Set `OPENROUTER_API_KEY` in the shell or user environment. Do not paste the raw key as a command.
Open
Section 04 - Codex skill
Install the skill. Then ask Codex for the page.
This does not replace Codex with GLM 5.2. Codex stays the engineer. GLM 5.2 becomes the external creative model Codex calls through OpenRouter, with the workflow packaged as a reusable skill.
Set the OpenRouter key
Use the environment variable route. Do not paste the raw key by itself into a terminal, because your shell will try to run it as a command.
# Windows - set the key for this PowerShell session
$env:OPENROUTER_API_KEY="sk-or-v1-your-key-here"
# Optional: persist it for future Codex sessions
[Environment]::SetEnvironmentVariable("OPENROUTER_API_KEY", "sk-or-v1-your-key-here", "User")
# Restart Codex after setting the persistent value# Mac - set the key for this terminal session
export OPENROUTER_API_KEY="sk-or-v1-your-key-here"
# Optional: persist it for future zsh sessions
echo 'export OPENROUTER_API_KEY="sk-or-v1-your-key-here"' >> ~/.zshrc
source ~/.zshrc
# Restart Codex after setting the persistent valueInstall the skill
Easiest path: download the `SKILL.md` file, give it to Codex, and paste this install prompt. Codex can place the file in the right skill folder for Windows or Mac and grab the helper script.
Download SKILL.mdInstall this Codex skill from the attached SKILL.md file.
Skill name: glm-design-partner
Please:
1. Create the Codex skill folder:
- Windows: %USERPROFILE%\.codex\skills\glm-design-partner
- Mac/Linux: ~/.codex/skills/glm-design-partner
2. Save the attached file as SKILL.md in that folder.
3. Create a scripts folder inside it.
4. Download https://mattfarmer.ai/downloads/ask-openrouter-glm.mjs
and save it as scripts/ask-openrouter-glm.mjs.
5. Confirm OPENROUTER_API_KEY is set. If it is not set, tell me exactly how to set it for my OS.
6. Tell me to restart Codex after the install.Tell Codex what to redesign
After the skill is installed and Codex is restarted, the prompt gets tiny. Codex reads the skill, audits the site, calls GLM, implements the page, and verifies it.
Use the glm-design-partner skill to redesign this page:
[paste the page, route, or local URL here]
Analyze the existing site first, use GLM 5.2 through OpenRouter for the creative direction, then implement the best design cleanly and verify it locally.Section 05 - Quick answers
GLM 5.2 FAQ for the impatient.
The short version: GLM 5.2 is worth testing when you want a model to reason over a whole page, propose a stronger direction, and hand the final implementation back to Codex.
What is GLM 5.2 good for?
GLM 5.2 is useful for long-context reasoning, agentic coding analysis, full-page creative briefs, and design direction when paired with Codex for implementation.
How do you use GLM 5.2 in Codex?
Use OpenRouter model z-ai/glm-5.2 through a Codex skill. Codex keeps control of repository analysis, implementation, and verification while GLM 5.2 supplies creative design direction.
What does GLM 5.2 cost on OpenRouter?
OpenRouter pricing varies by provider. The first-party Z.AI route is $1.40 per 1M input tokens and $4.40 per 1M output tokens, while the lowest listed route starts lower.
Section 06 - Sources
Receipts, not rumor.
Benchmarks move quickly and can overfit the story. I use them as signal, then judge the model by real workflow output.
Best role
Creative system design and whole-page strategy.
Best prompt
A full site audit plus a broad creative brief.
Best handoff
Codex implements, verifies, and cleans up the code.
Work with Matt
Need AI workflow help for your team or tool?
Work with Matt on consulting, AI tool marketing, media buying, sponsored videos, speaking, and training that makes advanced AI workflows easier to apply.