Skip to content

Instantly share code, notes, and snippets.

@conradcaffier03
Last active September 15, 2026 12:27
Show Gist options
  • Select an option

  • Save conradcaffier03/da1ce3691926170d3c22a272b1fab957 to your computer and use it in GitHub Desktop.

Select an option

Save conradcaffier03/da1ce3691926170d3c22a272b1fab957 to your computer and use it in GitHub Desktop.
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

GLM-5.2 Free Setup Guide

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.


1. Free, zero setup — just chat

👉 chat.z.ai

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.


2. Free GLM API to build with

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

A) OpenRouter free model (no cost, rate-limited)

  1. Sign up at openrouter.ai → create an API key
  2. 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.

B) Z.ai platform — free starter credits, then pay-as-you-go

  1. Go to z.ai/manage-apikey/apikey-list → create an API key (new accounts get free starter credits to try GLM-5.2 directly)
  2. OpenAI-compatible base URL: https://api.z.ai/api/paas/v4/ · model glm-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.


3. GLM-5.2 inside Claude Code

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:

# 1. install Claude Code if you haven't
npm install -g @anthropic-ai/claude-code

# 2. point it at Z.ai's Anthropic-compatible endpoint
export ANTHROPIC_BASE_URL=https://api.z.ai/api/anthropic
export ANTHROPIC_AUTH_TOKEN=your-zai-key

# 3. run, then set the model to GLM-5.2 (or GLM-5.2[1m] for the full 1M context)
claude

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

npx @z_ai/coding-helper

Key facts (verified against Z.ai's GLM-5.2 release)

GLM-5.2
Parameters 744B MoE
Context 1M tokens
License MIT — open weights on HuggingFace
FrontierSWE 74.4 (Claude Opus 4.8: 75.1)
SWE-bench Pro 62.1
Terminal-Bench 2.1 81.0
API price ~$0.95 / $3 per M tokens (in/out)
Genuinely free chat.z.ai · OpenRouter 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.

@Molavi12

Copy link
Copy Markdown

Hello

@mezerguet-hue

Copy link
Copy Markdown

créer une grille d'évaluation de transfert des acquis pour la formation management par objectif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment