Seongwoo Choi / Journal

Z.ai GLM Coding Plan: models, limits, and Claude Code setup

At a glanceZ.ai sells GLM models two ways: a pay-per-token API and a coding subscription from $18 a month. Prices, credit limits, key types and the Claude Code settings.

Not testedAn overview of Z.ai's documentation. No account was created and nothing was subscribed to.

In this article 6 sections
  1. 1. Two ways to pay, two kinds of key
  2. 2. The models and what the API charges
  3. 3. What the Coding Plan includes
  4. 4. Connect it to Claude Code
  5. 5. Rules that can get an account restricted
  6. 6. Which one to choose

Z.ai makes the GLM family of models. It sells them in two ways that are easy to confuse: an API billed per token, and a subscription called the GLM Coding Plan for use inside coding tools. They have different prices, different keys and different rules. This guide sets out what the documentation says about each, and how the plan connects to Claude Code.

1. Two ways to pay, two kinds of key

The standard API is pay-as-you-go. You top up a balance and each call is charged per token. The Coding Plan is a monthly subscription with a usage allowance, and it only works in supported coding tools.

Since October 16, 2026 the keys for the two are managed separately, and the type of key decides how a call is billed. The documentation gives the case that catches people out: a Standard API key used in a coding tool does not draw on your Coding Plan allowance, even if you have a subscription. It is charged to your balance. Create the key from the section that matches what you are paying for.

2. The models and what the API charges

The current flagship is GLM-5.3. The documentation describes it as text-only, with a 1M-token context window and a maximum output of 128K tokens. Reasoning is always on, with three effort levels: low, high and max.

Per 1M tokensInputCached inputOutput
GLM-5.3$1.40$0.26$4.40
GLM-5.3-FlashX$0.37$0.075$1.25
GLM-5.3-Flash$0.15$0.03$0.50

Storing cached input is listed as free for a limited time. The built-in web search tool costs $0.01 per use. Two older models, GLM-4.7-Flash and GLM-4.5-Flash, are listed as free.

The API follows the OpenAI format. With the OpenAI SDK, set the base URL to https://api.z.ai/api/paas/v4/ and use a Standard API key.

3. What the Coding Plan includes

The plan starts at $18 a month and has three tiers: Lite, Pro and Max. The documentation does not list the Pro and Max prices on the pages read for this guide; they are on the subscription page.

All tiers include GLM-5.3 and GLM-5.3-Flash. Requests for GLM-5.2 or GLM-5.1 are routed to GLM-5.3, and requests for GLM-4.7 go to GLM-5.3-Flash. Every tier also includes image understanding and three MCP servers: web search, web reader and Zread.

Usage is counted in credits, with a limit per five hours and a limit per week:

TierCredits per 5 hoursCredits per weekSuggested use
Lite2,00010,000One project at a time
Pro12,00060,000One or two projects at once
Max28,000140,000Two or more projects at once

The five-hour allowance refills five hours after it is used. The weekly allowance resets every seven days from the day you subscribe. Credits are calculated from tokens: input, cached input and output tokens are each multiplied by a rate for the model, added together and divided by 10,000. Tool calls through the MCP servers use credits too. The billing page in the console shows the tokens and tool calls counted against you.

Whether a tier is enough depends on how the multipliers apply to your work, which this guide could not measure. Start on the lowest tier and watch the usage page for a week before moving up.

4. Connect it to Claude Code

The plan offers an endpoint in Anthropic's format, which is what Claude Code speaks. After installing Claude Code, the documentation's setup adds three values to ~/.claude/settings.json:

{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "your_zai_api_key",
    "ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
    "API_TIMEOUT_MS": "3000000"
  }
}

Use a Coding Plan key here, not a Standard one. Open a new terminal window for the change to take effect, then run claude in your project.

By default the plan maps Claude Code's three model slots to GLM-5.3-Flash. To use GLM-5.3 for the larger slots, the documentation's manual configuration sets them explicitly in the same env block:

"ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-5.3-flash[1m]",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5.3[1m]",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5.3[1m]"

Z.ai also offers two shortcuts: a helper started with npx @z_ai/coding-helper, and a shell script that edits the settings file for you. Both change files on your machine. Editing settings.json by hand takes a minute and lets you see exactly what was added.

Other tools use other endpoints on the same plan:

ProtocolBase URL
Anthropic Messageshttps://api.z.ai/api/anthropic
OpenAI Chat Completionshttps://api.z.ai/api/coding/paas/v4
OpenAI Responseshttps://api.z.ai/api/v1

How Claude Code's own project files work is covered in Claude Code project setup. They apply the same way whichever model is answering.

5. Rules that can get an account restricted

The usage policy is short and worth reading before subscribing:

  • The subscription is for the subscriber only. Sharing an account or letting several people use it is prohibited.
  • The plan may only be used in officially supported tools. Using a plan key elsewhere may lead to restricted benefits.
  • Violations can trigger rate limiting or an account freeze, and the policy says accounts with more than three violations may be banned.

If you want to call the models from your own scripts or a product, that is what the standard API and its separate key are for.

6. Which one to choose

  • You work in Claude Code, Cline, OpenCode or a similar tool most days: the Coding Plan gives a fixed monthly cost.
  • You are building something that calls the model, or your use is occasional: the pay-per-token API has no subscription and no tool restriction.
  • You want both: keep two keys and check which one each tool is configured with.

This guide did not review Z.ai's privacy terms or test the models. Read the terms before sending confidential code, and try your own tasks before committing to a tier. A similar setup with a different provider is described in the DeepSeek API guide.

Sources

This article reflects public information available when it was written. Versions, defaults and prices can change; check the linked official documentation.

This is an overview of Z.ai's documentation as read on November 12, 2026, not a hands-on review. No account was created, nothing was subscribed to, and no requests were sent. Prices, credits and rules are Z.ai's published figures. Written for this site with AI assistance, from the sources above. For errors or additional information, please request a correction. Editorial policy