{"slug": "glm-5-2-free-setup-guide-the-genuinely-free-ways-to-run-z-ai-glm-5-2-chat-free", "title": "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", "summary": "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.", "body_md": "GLM-5.2 is Z.ai's open-weights (MIT) flagship — 744B-MoE, a 1M-token context, and\nbenchmarks within ~1 point of Claude Opus 4.8 on FrontierSWE. Here's how to actually\nput it to work, starting with the routes that cost **nothing** and need **no credit card**.\n\nFull 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.\n\nTwo genuinely free ways to call a GLM model from code (OpenAI SDK — zero rewrite):\n\n- Sign up at\n→ create an API key[openrouter.ai](https://openrouter.ai) - Use the free model id\n`z-ai/glm-4.5-air:free`\n\n*(this is the free lightweight GLM — full GLM-5.2 on OpenRouter is paid, see below)*\n\n``` python\nimport OpenAI from \"openai\";\n\nconst client = new OpenAI({\n  apiKey: process.env.OPENROUTER_API_KEY,\n  baseURL: \"https://openrouter.ai/api/v1\",\n});\n\nconst r = await client.chat.completions.create({\n  model: \"z-ai/glm-4.5-air:free\",\n  messages: [{ role: \"user\", content: \"Write quicksort in TypeScript\" }],\n});\n\nconsole.log(r.choices[0].message.content);\n```\n\nThe free tier is rate-limited (currently ~50 requests/day) — fine for testing.\n\n- Go to\n→ create an API key (new accounts get free starter credits to try GLM-5.2 directly)[z.ai/manage-apikey/apikey-list](https://z.ai/manage-apikey/apikey-list) - OpenAI-compatible base URL:\n`https://api.z.ai/api/paas/v4/`\n\n· model`glm-5.2`\n\n``` js\nconst client = new OpenAI({\n  apiKey: process.env.ZAI_API_KEY,\n  baseURL: \"https://api.z.ai/api/paas/v4/\",\n});\n\nconst r = await client.chat.completions.create({\n  model: \"glm-5.2\",\n  messages: [{ role: \"user\", content: \"...\" }],\n});\n```\n\nAfter the free credits, it's pay-as-you-go — about **$0.95 / $3 per M tokens** (in/out).\nYou only pay for what you use; no subscription.\n\nStraight answer: there's **no free CLI** for this. Running GLM-5.2 natively as your\nClaude Code model goes through Z.ai's **GLM Coding Plan** (paid — Lite starts at\n**$18/mo**, ~$12.60/mo billed yearly). It's cheap, but it's not free.\n\nOnce you have a Coding Plan key:\n\n```\n# 1. install Claude Code if you haven't\nnpm install -g @anthropic-ai/claude-code\n\n# 2. point it at Z.ai's Anthropic-compatible endpoint\nexport ANTHROPIC_BASE_URL=https://api.z.ai/api/anthropic\nexport ANTHROPIC_AUTH_TOKEN=your-zai-key\n\n# 3. run, then set the model to GLM-5.2 (or GLM-5.2[1m] for the full 1M context)\nclaude\n```\n\nOr let Z.ai's helper auto-configure your tool:\n\n```\nnpx @z_ai/coding-helper\n```\n\n| GLM-5.2 | |\n|---|---|\n| Parameters | 744B MoE |\n| Context | 1M tokens |\n| License | MIT — open weights on\n|\n\n`z-ai/glm-4.5-air:free`\n\n**Reality check:** \"free GLM-5.2\" means the web chat and the free API model above —\nno card needed. Running GLM-5.2 *as your Claude Code model* is the paid Coding Plan\n($18/mo). Now you know exactly which door is which.", "url": "https://wpnews.pro/news/glm-5-2-free-setup-guide-the-genuinely-free-ways-to-run-z-ai-glm-5-2-chat-free", "canonical_source": "https://gist.github.com/conradcaffier03/da1ce3691926170d3c22a272b1fab957", "published_at": "2026-06-23 16:05:24+00:00", "updated_at": "2026-06-24 12:39:10.075119+00:00", "lang": "en", "topics": ["large-language-models", "developer-tools", "artificial-intelligence"], "entities": ["Z.ai", "GLM-5.2", "OpenRouter", "Claude Code", "Claude Opus 4.8", "MIT"], "alternates": {"html": "https://wpnews.pro/news/glm-5-2-free-setup-guide-the-genuinely-free-ways-to-run-z-ai-glm-5-2-chat-free", "markdown": "https://wpnews.pro/news/glm-5-2-free-setup-guide-the-genuinely-free-ways-to-run-z-ai-glm-5-2-chat-free.md", "text": "https://wpnews.pro/news/glm-5-2-free-setup-guide-the-genuinely-free-ways-to-run-z-ai-glm-5-2-chat-free.txt", "jsonld": "https://wpnews.pro/news/glm-5-2-free-setup-guide-the-genuinely-free-ways-to-run-z-ai-glm-5-2-chat-free.jsonld"}}