Providers / Z.ai (Zhipu GLM)
Z.ai (Zhipu GLM)
Z.ai, also known as Zhipu, makes the GLM family of language models. The current generation is GLM-5.3: the base GLM-5.3 model and a low-cost Flash. GLM-5.2 and GLM-5.1 are earlier flagship models. GLM-5.3 and Flash reason on every request. Z.ai also makes vision models (GLM-5V) and image models (CogView).
Models
USD per 1M tokens · prices as of 2026-11-21
| Model | Best for | Input | Output | Context |
|---|---|---|---|---|
| GLM-5.1 | A setup already tuned on GLM-5.1 | $0.6438 | $2.5753 | 31K |
| GLM-5.2 | Long agent runs on an earlier model | $0.8584 | $3.0045 | 128K |
| GLM-5.3 | Coding agent, main model | $1.3949 | $4.8823 | 128K |
| GLM-5.3 Flash | Sub-agents and quick steps · Screenshots and video in the prompt | Price coming soon | Not listed | |
Which model for which job
GLM-5.3 is popular with coding-agent users. Because GLM-5.3 and Flash reason on every request, expect reasoning tokens in your output count even for simple steps.
| Job | Use | Input / output per 1M | Why |
|---|---|---|---|
| Coding agent, main model | GLM-5.3 | $1.3949 / $4.8823 | Tool calling with parallel calls |
| Sub-agents and quick steps | GLM-5.3 Flash | Price coming soon | Much cheaper; accepts image and video input (not yet live on Yunshu) |
| Long agent runs on an earlier model | GLM-5.2 | $0.8584 / $3.0045 | Z.ai lists a 1M-token context; thinking can be switched off |
| A setup already tuned on GLM-5.1 | GLM-5.1 | $0.6438 / $2.5753 | Z.ai lists a 200K context; text only |
| Screenshots and video in the prompt | GLM-5.3 Flash | Price coming soon | Multimodal input; GLM-5.3, GLM-5.2 and GLM-5.1 are text only |
Data handling
What research shows about Z.ai
Per Z.ai’s own terms, its API is based in Singapore, does not train on prompts, and has zero retention.
What Yunshu does
Prompts aren’t stored by default. Batches are the one exception: batch inputs and results are kept for 7 days after the batch finishes, then deleted. An organisation can turn on zero retention, which refuses batches as well.
Pricing notes
- Prompt caching. Z.ai caches repeated prompt prefixes automatically.
- Reasoning tokens are output tokens.
- Yunshu’s own cache. Exact repeats of a request are answered from our cache and not charged.
Use it in your coding tool
Paste these settings to use GLM-5.1. Swap in any Z.ai model ID from the table above.
export ANTHROPIC_BASE_URL=https://api.yunshurouter.com
export ANTHROPIC_AUTH_TOKEN=YOUR_YUNSHU_KEY
export ANTHROPIC_MODEL=glm-5.1
export CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1OpenAI API Key: YOUR_YUNSHU_KEY
Override OpenAI Base URL: https://api.yunshurouter.com/v1
Add model: glm-5.1 (then Verify)model = "glm-5.1"
model_provider = "yunshu"
model_context_window = 31744
[model_providers.yunshu]
name = "Yunshu Router"
base_url = "https://api.yunshurouter.com/v1"
env_key = "YUNSHU_API_KEY"
wire_api = "responses"Base URL: https://api.yunshurouter.com/v1
API Key: YOUR_YUNSHU_KEY
Model ID: glm-5.1Run these in your shell before starting Claude Code, or put them in ~/.claude/settings.json (see the guide). No /v1 in the address: Claude Code adds it. The last line stops Claude Code sending fields only Anthropic models accept. Full guide →
In Cursor Settings → Models: paste the key under OpenAI, turn on the base URL override and keep the /v1. Then pick the model in the chat panel. Full guide →
Add this to ~/.codex/config.toml and set YUNSHU_API_KEY to your key. Codex sends the whole conversation each turn; we don't store responses. Full guide →
Set API Provider to OpenAI Compatible. Then set the context window and prices from the model page, so Cline's cost estimate matches your bill. Full guide →
Questions
Is GLM-5.3 good for coding?
It is popular with coding-agent users. It supports tool calling with parallel calls.
How do I use GLM-5.3 with Claude Code?
Point ANTHROPIC_BASE_URL at Yunshu, use your Yunshu Router key as ANTHROPIC_AUTH_TOKEN, and set
ANTHROPIC_MODEL=glm-5.3. The Claude Code guide has every step.
Are Z.ai and Zhipu the same company?
Yes. Sites list the lab as “Z.ai (Zhipu)”; its models are the GLM family.
Can I turn GLM reasoning off?
Z.ai’s docs let you switch thinking on or off for GLM-5.2 and GLM-5.1.
Does Z.ai keep my prompts?
See Data handling.