English
English
Type "glm api key buy" into Google and the first page mixes Z.ai's pay-as-you-go console, its coding subscription, OpenRouter's model page, FlexAI, Gate.AI, and several Vietnamese resellers. Every result looks like a place to buy a key. They sell different products, in different units, with different limits and different exit terms.
The expensive mistake is buying the wrong product class and finding out after the first invoice. A developer who wants to call GLM from a Python service buys a coding subscription because it looks cheaper per month. A Claude Code user buys a pay-as-you-go key and wonders why the plan he also owns never moves. A buyer in Vietnam pays a reseller in đồng and receives something that works in one client and fails in the next.
Below are the three products, the October key split, and the checks that tell them apart. Price numbers stay on the live pages. The structure is what you need before you pay.
Z.ai's own site now describes two products: a Standard API key billed per token, and a GLM Coding Plan billed per week. The search page adds a third: gateway keys sold by OpenRouter, FlexAI, Gate.AI, shopaikey, api.airforce and others. A gateway key may be a Standard key, a plan key, or something else. The page rarely says.
| What you want to do | What to buy | What you get | What you give up |
|---|---|---|---|
| Call GLM from your own app, script, or backend | Standard API key | Per-token access to the catalogue, a usage block, a cash balance | No weekly subscription; you manage spend |
| Use GLM inside Claude Code, Cline, Codex, or OpenCode | Coding Plan | Weekly credits, a five-hour cap, two models, a list of supported tools | No general API; no balance overflow on individual plans; no refund |
| Pay in local currency or use one key across model families | Gateway key | The gateway's unit, support, and limits | A direct relationship with Z.ai; the plan terms may not apply |
The table looks obvious. The failure happens one level down, when the product name on the invoice does not match the thing the key can do. The October change matters because it moved the decision from the endpoint to the key itself.
Z.ai's API key management guide separates three key objects: a Standard API key, a personal Coding Plan key, and a Team Plan key. For keys created from 16 October 2026, the guide says the key type determines how calls are billed across supported endpoints. Changing the endpoint does not change the key type.
Older keys can carry a "Compatible" label. Their billing follows the endpoint and whether the account has ever had a plan. A Compatible key on the standard endpoint can charge the cash balance while plan quota sits unused. The same key on a coding endpoint can use plan quota. Two people can run the same command, get the same HTTP 200, and pay from different wallets.
The documentation lists three symptoms:
The awkward part is that the official pages do not agree on what a plan key does outside its supported endpoints. The 16 October notice says key type governs billing "across supported endpoints," which implies a plan key on another route might still bill plan quota. The tool-integration page says an incorrect endpoint prevents the quota from being used at all. Community reports show a plan key returning 1113 on the general endpoint, but those reports predate the October split.
So 1113 is not a key-type detector. It means the request authenticated and found no wallet for that route. A Standard account with no balance produces the same code. A Compatible key on the standard endpoint bills cash even while plan credits sit unused; that is the documented money leak.
The fix is boring. Ask for the exact product name before you pay. After you pay, look at the console section that issued the key, not the key string alone. Do not probe a plan key outside the endpoints its terms allow; the probe can violate the terms and still produce an ambiguous answer.
The Coding Plan is a subscription with its own meter, its own model list, and its own rules about where it can be used.
The meter is credits per week, with a five-hour rolling cap. The current individual tiers make the five-hour cap exactly one fifth of the weekly cap. A single marathon session can use at most a fifth of the week. Draining a full week takes at least five separate windows, roughly twenty hours of elapsed time from the first request. The weekly meter is anchored to the purchase date and is not restarted by a renewal.
Z.ai publishes the credit formula:
credits = (input tokens × input multiplier
+ cached input tokens × cached input multiplier
+ output tokens × output multiplier) / 10,000On GLM-5.3 the multipliers are 6.9 for input, 1.7 for cached input, and 24 for output. On GLM-5.3-Flash they are 2.3, 0.56, and 8. Output costs about 3.5 times input per token, and about 14 times cached input. A long agent loop re-sends the whole context on every turn, so cached input often dominates the total even though it is the cheapest line per token.
A worked example makes the shape concrete. Take one Claude Code-style turn with 150,000 input tokens, of which 140,000 are cached, and 3,000 output tokens:
(10,000 × 6.9 + 140,000 × 1.7 + 3,000 × 24) / 10,000
= (69,000 + 238,000 + 72,000) / 10,000
= 37.9 credits per turnFifty turns cost about 1,895 credits, which is 95 percent of the entry tier's five-hour window. The same session off-peak is about half. Context re-sending and output volume drive the bill; the headline token price is secondary.
Other rules that matter before you buy:
That is a lot of rules for something marketed next to an API key. Z.ai prices the plan for a person using a coding tool; a service calling a model is a different product. If your code calls the model, the plan is the wrong product.
The Standard API is the product most developers actually need, and its bill is more granular than the two-column quote most resellers show. Z.ai's price table has four columns: input, cached input, cached-input storage, and output.
Each line has its own failure mode.
Uncached input is the new content in the request. There is no separate cache-write premium in the published table; Z.ai bills new content at the ordinary input rate. A cache miss is not surcharged. The risk sits in the storage line.
Cached input is the part of the prompt that matched a cached prefix. It is cheaper than fresh input, but the published discount is inconsistent across Z.ai's own pages. The cache guide says hits are "usually 50 percent" of the input price. The FAQ says "approximately one fifth." The table implies about 18.6 percent on z.ai and 25 percent on the China platform. Do not budget from the prose. Divide the cached-input column by the input column and use that ratio.
Output includes the visible answer and the thinking tokens. GLM-5.3 always runs with reasoning enabled, and there is no separate reasoning rate. The usage block puts those tokens inside completion_tokens. A short answer can carry a long internal transcript, and the output line pays for it.
Cached-input storage is free for now on both platforms, and the post-promotion price is not published. The unit is per million tokens per hour. A 20,000-token prompt held for 30 days is 14.4 million token-hours. If storage is ever charged at even a tenth of the input rate, that line can exceed the saving from the cache hits. "Free storage" is carrying the caching business case at the moment. That price is a promotion with no published end date.
Two more differences separate the international and China platforms. The international list is a flat USD price per model. The China list is in CNY and bands some models by context length; a long request can move the whole request to a higher band. The China platform also sells a Batch API at half the standard price. The international documentation has no Batch page, so do not assume the discount exists there.
A cache example shows why the sticker price is not the bill. Send a stable 20,000-token system prompt fifty times. With no cache, you pay full input on all fifty calls. With a cache hit on the last forty-nine, the same workload costs about 20 percent of the no-cache bill on z.ai and about 26.5 percent on the China platform. The first call saves nothing; the saving comes entirely from the repeats. If your client changes the prefix, the hit rate collapses and the bill goes back up.
The model name on the key is not a reliable description of what answers. Z.ai documents several ways the label and the model diverge.
GLM-5.3 is text-only. It has a 1M-token context and a 128K maximum output. It always thinks. Effort is low, high, or max, with max as the default. On the standard API, GLM-5.3 accepts only those three values; the plan endpoint maps other strings to the nearest tier, and unknown strings to max. If you send thinking.type: disabled, the request fails; the migration guide says to rewrite it to enabled with reasoning_effort: low before switching the model ID.
GLM-5.3-Flash is the multimodal member of the family. It accepts video, image, text, and file input, has the same 1M context and 128K output, and gets three times the plan quota of GLM-5.3. It is the model to pick when the job involves screenshots, PDFs, or mixed input. It is not a replacement for GLM-5.3 on hard coding tasks.
GLM-5.3-FlashX is faster and more expensive, and it is not on the Coding Plan. GLM-5.1 and GLM-5.2 are legacy on the plan: the plan routes their names to GLM-5.3 or GLM-5.3-Flash. On the Standard API they remain separately billable, so a reseller can sell a legacy name at a legacy price while the plan buyer gets a different model.
One client-level trap is worth its own line. TRAE ships two providers, "Z.ai" and "Z.ai-plan." They look the same in the picker. The first bills the balance, the second uses the plan. Choosing the wrong one leaves the plan untouched and the wallet lighter.
Two settings cause most of the "it works but feels wrong" reports:
[1m] and sets CLAUDE_CODE_AUTO_COMPACT_WINDOW to 1000000. Without the suffix, you are running a smaller effective window while believing you bought 1M.model field in the response.Use these checks in order. Each one is cheaper than the one after it.
| # | Check | Good answer | Where to look |
|---|---|---|---|
| 1 | Key class | The product name is specific: Standard API key or Coding Plan key | The console section that issued the key, or the seller's invoice |
| 2 | Endpoint | Standard: api.z.ai/api/paas/v4. Coding: api.z.ai/api/coding/paas/v4. Claude Code: api.z.ai/api/anthropic. Codex: api.z.ai/api/v1 with the Responses protocol | The product's setup page and the client config |
| 3 | Model | The exact ID you will call, whether it is on the plan, and whether it needs [1m] | The model list and the response model field |
| 4 | Quota | Credits per week, the five-hour cap, peak and off-peak, and what happens at zero | The plan overview and the usage page |
| 5 | Exit | Refund rule, cancellation deadline, resale and sharing terms, support channel | The terms and the usage policy |
The checks catch the common mistakes before money moves. The remaining question is what to do after the key arrives.
The cleanest evidence of what you bought is the console section that issued the key and the usage page it points to. A Standard key has a cash balance and a token usage detail. A Coding Plan key has a five-hour and a weekly credit bar. If the seller cannot show either page, you are holding a gateway key, and the only terms that matter are the seller's.
A small request is still useful as a smoke test for a Standard key. Send one request with max_tokens set to 16 to the standard endpoint and read the JSON body, not the status line alone:
200 with a usage block: the key authenticates and has a wallet on that route.401 with code 1000, 1001, 1003, or 1005: the key was rejected. That can mean a fake key, a BigModel key, an expired key, a 2FA challenge, or a gateway key. It does not identify which.400 with code 1211: the key authenticated, and the model alias is wrong.429 with body code 1113: no balance or resource package on that route. The same code appears for a Standard account with no balance and, in community reports, for a plan key on the wrong endpoint. It measures the wallet, not the key class.A request can also return HTTP 200 with an error object in the body. Parse the JSON. Do not trust the status line alone.
For a Coding Plan, do not probe outside the endpoints the plan licenses. The terms restrict the plan to supported tools and endpoints, and a probe can violate them while still producing an ambiguous answer. Ask for the console view and the plan usage page instead. A five-hour and weekly credit bar is stronger evidence than any error code.
Two more cautions. A passing test proves the key works at that moment; it does not prove ownership, tier, or future supply. A resold plan key can pass today and be revoked when Z.ai enforces its sharing rules. And billing data is delayed by a day, so a same-day unchanged balance does not prove the request was free. Check the plan usage page for credits, and the billing page the next day for token charges.
The probe narrows the possibilities; it does not certify ownership. The strongest signal is still the invoice and the console section that issued the key.
GLM-5.3 is a strong value model. It is not the frontier, and the gap is visible on independent leaderboards.
On Terminal-Bench 3.0, GLM-5.3 resolves 32.4 percent of tasks and finishes fourth. Claude Opus 5 scores 42.7 percent. On Terminal-Bench 4.0, GLM-5.3 scores 41.8 percent and GLM-5.3-Flash scores 35.8 percent; Claude Opus 5.5 scores 64.8 percent. The Flash run cost on that board is a fraction of the frontier runs, which is the point of the model.
A separate independent test on real coding sessions put GLM-5.3 at 74 percent overall and 71 percent on long agentic sessions, at about 20.5 minutes per long session. DeepSeek V4.1 Flash scored 80 percent on the same test, and Claude Sonnet 5.5 scored 75 percent; both finished at a lower cost per session. GLM-5.3 is competitive with the mid-tier and behind the cheapest high scorer on that workload.
Vendor numbers differ from the boards. Z.ai's own documentation says 28.3 on Terminal-Bench 3.0, lower than the board's 32.4. The likely cause is the effort setting and the agent harness. A benchmark number without the harness and effort level is not a specification.
Walk away, or buy a different product, in these cases:
Is the GLM Coding Plan the same as a GLM API key? No. The plan is a subscription with weekly credits, a five-hour cap, two callable models, and a list of supported tools. A Standard API key bills per token and works in your own application. The plan's quota cannot be used for ordinary API calls outside the supported tools.
Why do I get "insufficient balance" after buying a Coding Plan? Error 1113 means the request found no wallet for that route. The official cause list is the client, the base URL, or the model. Check that you are in a supported tool, that the endpoint matches the product, and that the model is GLM-5.3 or GLM-5.3-Flash. The same error appears on a Standard key with an empty balance, and the official pages do not fully agree on what a plan key does on the general endpoint. Read the console and the plan usage page before you buy another plan.
Can I use my existing OpenAI SDK with GLM? Yes, on the Standard API. Change the base URL to https://api.z.ai/api/paas/v4/, keep the OpenAI client, and use a GLM model ID. The Coding Plan is a different product with different endpoints. If you point an OpenAI SDK at the coding endpoint without the right client configuration, you get a protocol or balance error, not a cheaper plan.
Which GLM model should I use in Claude Code? Start with GLM-5.3 for hard coding and GLM-5.3-Flash for multimodal or quota-sensitive work. Add the [1m] suffix if you need the 1M window, and set the auto-compact window to 1000000. Check the model field in the response; the client's "Opus" label does not mean an Opus-class model.
What happens when the plan credits run out? On the individual plans, the plan stops. It does not spend your cash balance or sell you an overage; you wait for the five-hour window to roll. Team plans have their own seat and overage rules. If you need continuous service, keep a Standard key for production and use the plan for interactive coding.
Is GLM cheaper than Claude? For many coding and extraction jobs, yes. The comparison depends on the tier, the cache hit rate, the thinking budget, and the harness. Compare the same workload, not the headline token price. A plan that looks cheap per month can be the wrong product if your code needs an API, and an API that looks cheap per token can be expensive if every call re-sends a long context.
On KuaiAPI, the GLM line sits in the Chinese-models group and is served through the OpenAI-compatible entry, so the client change is the base URL and the model name. The model plaza lists the live model IDs and each group's multiplier without a login. The status page shows how the group is running, and the refund page states the written path if you stop.
If you are still choosing between products, read One API Key for All Models for the client setup, Is a Cheap Claude API Reseller Safe? for the trust checks that apply to any reseller, and Cheap Qwen API for the same bill-structure exercise on another family.
Ready to start calling?
Create an account, generate a key and make your first multi-model call in five minutes. One key for GPT, Claude, Gemini, Grok, DeepSeek and Chinese models.