Published: 2026-06-20

GLM-5.2 vs Opus 4.8 in Claude Code: Near-Parity Output at a Fraction of the Cost

Chapters / key moments (click to jump — plays here on the page)

Nick Saraev pits the open-weight GLM-5.2 against Opus 4.8 across roughly 40 creative coding scenes — 3D/WebGL, interactive explainers, dashboards, landing pages and mini-games — and finds GLM frequently matches or beats Opus on visual "taste." He then walks through the simplest way to run GLM-5.2 inside the Claude Code harness (plus Open Code and Crush) via OpenRouter, and ranks the most cost-effective providers.

Source video

"GLM-5.2 is Basically Opus (For 1/5 the Price)" by Nick SaraevWatch on YouTube →

Key Takeaways

  • Across 40+ naively-prompted creative scenes, GLM-5.2’s output often looked cleaner than Opus 4.8 — Saraev argues benchmarks are saturated, so you have to judge by "taste."
  • GLM struggled most on interactive mini-games (physics and difficulty tuning); Opus kept an edge there.
  • Run GLM-5.2 in the Claude Code harness by pointing the ANTHROPIC_BASE_URL variable at an OpenRouter (or Z.AI) endpoint — same harness, different model under the hood.
  • GLM has no built-in web search; wire in Exa AI ("set up exa.ai for web search") to give the agent browsing.
  • Four cost routes: Z.AI’s coding plan (light/pro/$80-a-month max), OpenRouter pay-per-token (his pick), dedicated hosts (Fireworks / DeepInfra / GMI), or self-hosting a heavily-quantized 2-bit build (~82% accuracy) on a 256GB Mac.

Commands & Code Mentioned

export ANTHROPIC_BASE_URL=<your OpenRouter endpoint>   # point Claude Code at GLM-5.2
brew install opencode      # run GLM-5.2 in the Open Code harness
brew install crush         # run GLM-5.2 in the Crush harness
glm                         # launch the Claude Code instance wired to GLM-5.2
# prompt: "set up exa.ai for web search within this GLM directory"

Weekly Digest — In Your Inbox

Get the week's top AI agent news, updates, and guides — every Friday.