cd /news/large-language-models/glm-5-2-free-setup-guide-the-genuine… · home topics large-language-models article
[ARTICLE · art-37701] src=gist.github.com ↗ pub= topic=large-language-models verified=true sentiment=· neutral

GLM-5.2 Free Setup Guide — the genuinely free ways to run Z.ai GLM-5.2 (chat + free API), plus the paid Claude Code path

Z.ai's open-weights GLM-5.2 model (744B MoE, 1M-token context) is available for free via web chat and a rate-limited API through OpenRouter, with no credit card required. For developers, the free API tier offers about 50 requests per day, while the full GLM-5.2 API on Z.ai provides starter credits before switching to pay-as-you-go pricing. Running GLM-5.2 as a Claude Code model requires a paid Coding Plan starting at $18 per month.

read2 min views2 publishedJun 23, 2026

GLM-5.2 is Z.ai's open-weights (MIT) flagship — 744B-MoE, a 1M-token context, and benchmarks within ~1 point of Claude Opus 4.8 on FrontierSWE. Here's how to actually put it to work, starting with the routes that cost nothing and need no credit card.

Full GLM-5.2 in the browser. No key, no card, no install. Best for asking questions, drafting code, and pressure-testing the model before you wire it into anything.

Two genuinely free ways to call a GLM model from code (OpenAI SDK — zero rewrite):

  • Sign up at → create an API keyopenrouter.ai - Use the free model id z-ai/glm-4.5-air:free

(this is the free lightweight GLM — full GLM-5.2 on OpenRouter is paid, see below)

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.OPENROUTER_API_KEY,
  baseURL: "https://openrouter.ai/api/v1",
});

const r = await client.chat.completions.create({
  model: "z-ai/glm-4.5-air:free",
  messages: [{ role: "user", content: "Write quicksort in TypeScript" }],
});

console.log(r.choices[0].message.content);

The free tier is rate-limited (currently ~50 requests/day) — fine for testing.

  • Go to → create an API key (new accounts get free starter credits to try GLM-5.2 directly)z.ai/manage-apikey/apikey-list - OpenAI-compatible base URL: https://api.z.ai/api/paas/v4/

· modelglm-5.2

const client = new OpenAI({
  apiKey: process.env.ZAI_API_KEY,
  baseURL: "https://api.z.ai/api/paas/v4/",
});

const r = await client.chat.completions.create({
  model: "glm-5.2",
  messages: [{ role: "user", content: "..." }],
});

After the free credits, it's pay-as-you-go — about $0.95 / $3 per M tokens (in/out). You only pay for what you use; no subscription.

Straight answer: there's no free CLI for this. Running GLM-5.2 natively as your Claude Code model goes through Z.ai's GLM Coding Plan (paid — Lite starts at $18/mo, ~$12.60/mo billed yearly). It's cheap, but it's not free.

Once you have a Coding Plan key:

npm install -g @anthropic-ai/claude-code

export ANTHROPIC_BASE_URL=https://api.z.ai/api/anthropic
export ANTHROPIC_AUTH_TOKEN=your-zai-key

claude

Or let Z.ai's helper auto-configure your tool:

npx @z_ai/coding-helper
GLM-5.2
Parameters 744B MoE
Context 1M tokens
License MIT — open weights on

z-ai/glm-4.5-air:free

Reality check: "free GLM-5.2" means the web chat and the free API model above — no card needed. Running GLM-5.2 as your Claude Code model is the paid Coding Plan ($18/mo). Now you know exactly which door is which.

── more in #large-language-models 4 stories · sorted by recency
── more on @z.ai 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/glm-5-2-free-setup-g…] indexed:0 read:2min 2026-06-23 ·