GLM Free API Tested: Slow at 20 tok/s, Still Useful

Quick answer: The GLM API from Zhipu AI, served internationally via Z.ai, keeps three models permanently free ($0 in / $0 out, no credit card) — including GLM-4.7-Flash with a ~200K-token context tuned for coding and agents. It exposes both OpenAI-compatible and Anthropic-compatible endpoints, so you can point Claude Code, Cline, or Aider at it with a two-variable swap. The only real limit is throughput: one concurrent request, ~1/second.

If you build with LLMs you've probably collected free keys — Gemini, Groq, DeepSeek, OpenRouter. The one most developers outside China miss is GLM from Zhipu AI (a Tsinghua spin-out, current flagship GLM-5.2). What makes it worth wiring in: genuinely free models (not expiring trial credits), a free ~200K coding context, and an Anthropic-compatible endpoint nobody else on this list matches. Every number below comes from Z.ai's own pricing docs — confirm there before you build.

Is the GLM API free? The honest breakdown

Yes, and it survives scrutiny: Z.ai keeps a set of models at $0 input / $0 output for every registered user — a standing free tier, not trial credits. The trade-off is throughput, not access. The three permanently free models:

ModelTypeContextPriceBest for
GLM-4.7-FlashText / coding~200K tokens$0 / $0Coding, agents, long documents
GLM-4.5-FlashText (general)128K tokens$0 / $0Chat, classification, extraction
GLM-4.6V-FlashVisionMultimodal$0 / $0Image understanding, OCR, VQA

The headline is GLM-4.7-Flash (released Jan 19, 2026): a ~200,000-token window on a free model is rare — enough to stuff an entire codebase or long PDF into one call — and it's tuned for coding and agentic loops, not throwaway chat (max 16,384 output tokens). GLM-4.5-Flash is the lighter, low-latency default for high-volume simple jobs (classification, extraction, JSON). GLM-4.6V-Flash fills the rarer slot of a genuinely free vision model sharing the same key. The one caveat: the free tier is throttled to 1 concurrent request, ~1/second — fine for a single-user tool or sequential batch job, not for a public app with many simultaneous users.

Free vs paid: what scaling up costs

GLM's paid pricing is among the most aggressive in the industry, and the ladder is smooth. Per-million-token rates from the pricing docs:

ModelInput / 1MOutput / 1MNotes
GLM-4.7-Flash$0$0Free tier, 1 concurrency
GLM-4.5-Flash$0$0Free tier, general-purpose
GLM-4.7-FlashX$0.07$0.40Same Flash quality, ~3 concurrency
GLM-4.5-Air$0.20$1.10Mid-tier balance
GLM-5$1.00$3.20Previous flagship
GLM-5.2$1.40$4.40Current flagship

The clever part is GLM-4.7-FlashX: the same Flash model with the concurrency cap lifted for $0.07/1M input — you graduate a free prototype to production by changing one model string, no rewrite. And at $1.40 / $4.40, flagship GLM-5.2 runs roughly a fifth to a tenth the price of comparable Western frontier models, which is why it shows up in cost-conscious agent stacks. For the wider landscape, the 10 best free AI APIs comparison puts GLM next to Gemini, Groq, and the rest.

Speed: we measured it, and it's slow

We benchmarked GLM alongside every other free AI API from the same US machine (2026-08-31, open harness):

ProviderFirst tokenGeneration
Groq0.38 s527 tok/s
Mistral0.43 s167 tok/s
NVIDIA NIM3.5 s33 tok/s
GLM 4 Flash2.6 s20 tok/s

That's the slowest generation speed of everything we tested — about 26× slower than Groq. Worth saying plainly, because "Flash" in a model name implies otherwise.

One caveat in GLM's favour: we measured from the US, and Zhipu's infrastructure is in China. Users in Asia will see materially better numbers, especially on first-token latency. But the generation figure is mostly compute, not distance, so don't expect it to close the gap with Groq.

So when is GLM still the right call? When speed isn't the deciding factor: strong Chinese-language handling, a free tier that doesn't ask for a card, and the Claude Code backend use described below. If you need throughput, Groq is a different league. Full comparison: free AI APIs benchmarked.

Get a key and make your first call

Sign up at z.ai (email or Google/GitHub — no card for free models), generate a key in the API Keys dashboard, and export it. Z.ai exposes an OpenAI-compatible endpoint at https://api.z.ai/api/paas/v4, so the official openai library works unchanged — swap base URL and model name:

from openai import OpenAI

client = OpenAI(
    api_key="your-z-ai-api-key",
    base_url="https://api.z.ai/api/paas/v4",
)
resp = client.chat.completions.create(
    model="glm-4.7-flash",          # the free coding model
    messages=[{"role": "user", "content": "Reverse a linked list in Python."}],
)
print(resp.choices[0].message.content)
curl https://api.z.ai/api/paas/v4/chat/completions 
  -H "Authorization: Bearer $ZAI_API_KEY" 
  -H "Content-Type: application/json" 
  -d '{"model": "glm-4.7-flash", "messages": [{"role": "user", "content": "Say hello."}]}'

Because it's OpenAI-shaped, streaming, tool calling, JSON mode, and system prompts work with the parameters you already know — point CrewAI, LangGraph, or any "OpenAI" provider at that base URL. To route multiple providers, drop it behind LiteLLM.

The killer feature: GLM as a free Claude Code backend

Z.ai also ships a genuine Anthropic-compatible endpoint at https://api.z.ai/api/anthropic — a true drop-in for Anthropic's API. That means you can point Claude Code at GLM with zero code changes, using the same env vars the tool already reads:

export ANTHROPIC_BASE_URL="https://api.z.ai/api/anthropic"
export ANTHROPIC_AUTH_TOKEN="your-z-ai-api-key"
claude   # now talks to GLM instead of Anthropic

The reason this gets attention in 2026 is arithmetic: GLM is strong at agentic coding, and running an agent that burns millions of tokens against a $0.07-per-million (or free, at Flash throughput) backend costs a fraction of a frontier-model bill. The same trick works for any tool reading the standard Anthropic env vars. Two honest notes: on the free Flash tier, single-concurrency means the agent runs one request at a time (fine solo, slow if you expected parallelism); and self-hosted runners can register Z.ai as a provider directly (see the OpenClaw provider docs). For more BYOK agents, see the 5 free AI coding assistants roundup.

The GLM Coding Plan: subscription vs pay-per-token

Z.ai also sells a flat monthly GLM Coding Plan for developers who live inside coding agents — a large usage quota instead of metered tokens, billed quarterly, with access to flagship GLM-5.2. Mid-2026 tiers: Lite ~$10/mo, Pro ~$30/mo, Max ~$80/mo (Q2 promos brought these to ~$27/$81/$216 per quarter). It uses a dedicated endpoint (https://api.z.ai/api/coding/paas/v4) — a detail that trips people up. The decision is simple: prototyping or a personal tool → free Flash models; pushing an agent hard where per-token would sting but a flat $10-30/mo is comfortable → the Coding Plan; serving app traffic that needs concurrency → pay-per-token FlashX.

GLM vs DeepSeek vs the free APIs you already use

GLM (Z.ai)DeepSeekOpenRouter freeTogether AI free
Truly free models3 (incl. 200K coding)Low-cost, small free trialRotating free variantsHandful of "-Free" models
Free context ceiling~200K (GLM-4.7-Flash)VariesVariesUp to model max
OpenAI-compatibleYesYesYesYes
Anthropic-compatibleYes (Claude Code drop-in)NoNoNo
Free vision modelYes (GLM-4.6V-Flash)NoSometimesYes (Llama Vision)
Coding/agent focusStrong (Flash tuned for it)Strong (V4 thinking mode)Depends on modelGeneral
Free concurrency1 req/secRate-limitedShared, variableRate-limited
  • Choose GLM for a free coding/agent model with a huge context, or to run Claude Code / Cline against a cheap backend — the Anthropic endpoint is the differentiator.
  • Choose DeepSeek for top-tier open reasoning (V4's thinking mode) at rock-bottom pay-as-you-go prices.
  • Choose OpenRouter to sample many models — including free GLM variants — through one aggregator key.
  • Choose Together AI for free chat, vision, and image generation (FLUX) behind one key.

In practice these are complements: GLM-4.7-Flash for coding agents, DeepSeek V4 for hard reasoning, Together's FLUX for images — all routed through LiteLLM so switching is one line.

Limits and honest caveats

  • Free tier is single-concurrency (~1 req/sec) — generous for a personal tool, inadequate for a multi-user product. Move to FlashX or paid before real traffic; it's a one-string change.
  • Two platforms, two accounts. Z.ai (international, English, this article) and the Zhipu Open Platform (open.bigmodel.cn, China, RMB) are separate — a key from one won't work on the other.
  • Data residency. GLM is operated by a China-based company with its own data terms. Fine for hobby and non-sensitive code; for regulated or proprietary data, read the terms and consider a self-hosted model or a provider in your jurisdiction. Treat it as a compliance decision.
  • Free tiers move — confirm model tiers and prices against the live pricing docs before architecting around a limit.

Frequently Asked Questions

Is the GLM API really free?

Yes. Z.ai keeps GLM-4.7-Flash (text/coding, ~200K), GLM-4.5-Flash (general), and GLM-4.6V-Flash (vision) permanently free at $0/$0, no card — a standing free tier, not expiring credits. The only limit is throughput: one concurrent request at ~1/second.

Can I use GLM with Claude Code?

Yes. Set ANTHROPIC_BASE_URL to https://api.z.ai/api/anthropic and ANTHROPIC_AUTH_TOKEN to your Z.ai key, then run Claude Code normally — it sends requests to GLM instead of Anthropic. This is a main reason GLM is popular as a low-cost coding-agent backend.

What's the difference between GLM-4.7-Flash and FlashX?

Same underlying model quality. Flash is the free tier, capped at single concurrency. FlashX is the paid, higher-throughput version ($0.07/1M in, $0.40/1M out) for serving real traffic. Develop on Flash for free, switch the model string to FlashX for production.

GLM vs DeepSeek — which is better?

Different strengths. GLM offers a genuine free tier with a huge coding context and an Anthropic-compatible endpoint for agents; DeepSeek is renowned for deep reasoning (now V4's thinking mode) at very low pay-as-you-go prices, though it no longer has a free tier. For free coding agents, GLM; for cheap heavyweight reasoning, DeepSeek. Many developers use both.

Bottom line

The GLM free API is one of the most under-used free keys a developer can add in 2026: three permanently free models — a ~200K coding model, a lightweight general model, and a vision model — with no card, no expiry, and both OpenAI- and Anthropic-compatible endpoints. Driving a coding agent solo? Point Claude Code or Cline at GLM-4.7-Flash free, or the ~$10/mo Coding Plan for all-day use. Need a free model that swallows a whole repo? The ~200K free context is rare at $0. Going to production? Switch one string to FlashX. It's not the model for regulated data, and single-concurrency makes it shine as a personal and prototyping tool — but as a free, drop-in coding brain, it slots right into the stack you already have.

Related Reads