GLM API key, where Z.ai issues one and how to call every GLM model with a Morse key
The Morse teamPublished Facts checked 6 min read
A GLM API key comes from Z.ai, the brand Zhipu, the company that trains GLM, uses outside China: you register on the Z.AI Open Platform and create a Standard API Key on its API Keys page, as Z.ai's quick start lays out. That key calls GLM on Z.ai's own API, and Zhipu's China platform, BigModel, issues its own.
The same GLM models also answer to a Morse key. A single secret beginning with sk_morse_ reaches every GLM id in Morse's catalog, from GLM 4.5 Air to GLM 5.3 and its two abliterated builds, through an OpenAI-compatible endpoint at https://inference.trymorse.ai/v1. Below: what the key is for, how to create one with the steps in Morse's API docs, and a GLM 5.3 request we sent on December 4, 2026.
What does a GLM API key do?
It identifies the caller. Each request your code sends carries the key as a Bearer token in its Authorization header, and the server uses it to find your account, confirm there is balance to draw on, run the GLM model the request asks for, and charge the tokens to you. No key, no answer.
For GLM on Morse, a client needs exactly three values:
- The secret,
sk_morse_..., which you copy once when you create it. - The base URL,
https://inference.trymorse.ai/v1. Any library written for OpenAI's chat completions takes it asbase_url. - A model id such as
z-ai/glm-5.3. Changing GLM versions means editing that one string.
Tools built on Anthropic's message format can pass the key in an x-api-key header instead. Every Morse key ends in a checksum, which helps secret scanners recognise one that slipped into a repository. A request with no key, a mistyped one, or a revoked one is refused with 401 invalid_api_key.
How do I get a GLM API key on Morse?
From the Morse console, following the quickstart:
- Sign in at console.trymorse.ai. The account's email must be verified before it can create keys.
- Choose Create key, give it a name that says which app will hold it, and press Create.
- Copy the secret straight away. Morse stores only a hash of it, so the console never shows it a second time.
- Add credits on the console's credits page. Every call spends from that balance, and an account with nothing left gets
402 insufficient_balance. - Put the key in an environment variable, not in your code:
export MORSE_API_KEY="sk_morse_..."
The script below reads that variable at run time. A key kept in the environment stays out of commits, shared notebooks and screenshots, and replacing it later touches your shell profile only.
How do you call GLM 5.3 with the key?
Point the OpenAI SDK at Morse, hand it the key from the environment, and name a GLM id. GLM 5.3 thinks before it answers, so the script sets the effort to low and keeps max_tokens small. This is the script we ran on December 4, 2026:
import os
import time
from openai import OpenAI
client = OpenAI(
base_url="https://inference.trymorse.ai/v1",
api_key=os.environ["MORSE_API_KEY"],
)
start = time.monotonic()
reply = client.chat.completions.create(
model="z-ai/glm-5.3",
reasoning_effort="low",
max_tokens=300,
messages=[{
"role": "user",
"content": "In two sentences, why should a team rotate an API key that was pushed to a public repository?",
}],
)
print(round(time.monotonic() - start, 2), "s")
print(reply.usage)
print(reply.choices[0].message.content)
It came back in 1.19 seconds, timed from our side. The usage block reported 32 prompt tokens and 76 completion tokens, none of them spent on reasoning at low, and the model stopped on its own well before the cap. The reply, word for word:
Once a key is in a public repository, anyone may have already copied it, and automated bots scan repos for exposed credentials within minutes, so treating it as compromised is the only safe assumption. Rotating the key immediately revokes access to anyone who obtained it, and because git history preserves the key even after deletion from the code, removal alone doesn't fix the exposure.
GLM 5.3 accepts the efforts "low", "high", or "max". Higher settings spend more tokens thinking first, so raise max_tokens along with them, or the reply can be cut off before it starts. Read this call as a check that key, URL and id fit together, nothing more. The GLM 5.3 guide runs the model on real work.
Which GLM models answer to a Morse key?
Every GLM id in the catalog, with no per-model setting on the key.
| Model | Id | Context | Efforts | Privacy tiers |
|---|---|---|---|---|
| GLM 5.3 | z-ai/glm-5.3 | 1M tokens | "low", "high", or "max" | TEE, Private |
| GLM 5.3 Flash | z-ai/glm-5.3-flash | 1M tokens | "low", "high", or "max" | TEE, Private |
| GLM 5.3 Uncensored | z-ai/glm-5.3-uncensored | 1M tokens | "low", "high", or "max" | TEE |
| GLM 5.3 Flash Uncensored | z-ai/glm-5.3-flash-uncensored | 1M tokens | "low", "high", or "max" | Private |
| GLM 5.2 | z-ai/glm-5.2 | 1M tokens | "none", "high", or "xhigh" | Private |
| GLM 5.1 | z-ai/glm-5.1 | 200K tokens | "none" or "high" | Private |
| GLM 5 | z-ai/glm-5 | 198K tokens | "none" or "high" | Private |
| GLM 4.7 | z-ai/glm-4.7 | 198K tokens | "none" or "high" | Private |
| GLM 4.6 | z-ai/glm-4.6 | 198K tokens | "none" or "high" | Private |
| GLM 4.5 Air | z-ai/glm-4.5-air | 128K tokens | "none" or "high" | Private |
How they differ:
- GLM 5.3 is the newest full-size GLM here and the default pick for coding and agents.
- GLM 5.3 Flash is its faster, lighter sibling, and the only stock GLM on Morse that reads text and images.
- GLM 5.3 Uncensored and GLM 5.3 Flash Uncensored are those two abliterated, covered in the last section.
- GLM 5.2 shares GLM 5.3's long context, with the efforts
none,highandxhighin place of GLM 5.3's three. Our GLM 5.2 guide has the details. - GLM 5.1, GLM 5, GLM 4.7, GLM 4.6 and GLM 4.5 Air are older releases with a choice of no reasoning or high reasoning. Keep them for prompts already tuned to one.
Each model's page under /inference/models lists its price, longest reply and accepted parameters. A script can fetch the live list of ids with GET /v1/models.
When should a GLM request run in a TEE?
When the prompt holds material the machine's operator shouldn't be able to read. Three GLM ids have a TEE endpoint: GLM 5.3, GLM 5.3 Flash and GLM 5.3 Uncensored. Take GLM 5.3 on that tier. It runs in attested hardware enclaves, under zero-data-retention terms. For the two stock 5.3 models the enclave is opt-in, so a request goes there only when you ask. GLM 5.3 Uncensored has no other tier and always runs in one. The remaining GLM ids run on the Private tier.
To ask, add extra_body={"provider": {"min_privacy": "tee"}} to the call, or set a privacy floor of tee on the key when you create it, which covers every request it makes, including those from tools you can't edit. A model with nothing at the floor fails with 400 privacy_floor_unmet before any charge. The privacy tiers page describes each tier.
How do I keep a GLM key safe?
Whoever has it can spend your balance, so keep it on servers and your own machine and never bundle it into a website or mobile app. The console then lets you fence each key in:
- Spend limit: the most a key may use per day, week or month, or in total. Past it, calls get
402 key_spend_limit_reached. - Expiry: a date after which the key returns
401 api_key_expired. - IP allowlist: up to 100 addresses or ranges; anything else gets
403 ip_not_allowed. - Privacy floor: the lowest tier any request on the key may use.
GET /v1/key reports a key's name, prefix, limits and what remains, without the secret and without a charge. An account can hold 25 active keys, enough for one per tool. Revoking a key on the console's API keys page takes effect at once and can't be undone, so create the replacement before you revoke a key something still uses.
Can I use GLM in Claude Code, Cline or Codex?
Yes, through Morse's setup guides for Claude Code, Cline and Codex, and any other tool that accepts an OpenAI-compatible base URL. Name a GLM 5.3 id and write the reasoning effort into the tool's config instead of leaving its default: low for quick edits, high when a step needs planning. Effort decides how long every turn thinks. Give each tool its own key with a spend limit.
What are the abliterated GLM builds for?
Work a stock model refuses partway through. GLM 5.3 Uncensored and GLM 5.3 Flash Uncensored are GLM 5.3 and GLM 5.3 Flash abliterated: the refusal behaviour has been taken out of the weights. Morse serves its uncensored models for four kinds of work: cybersecurity, agent security, AI and ML research, and training data. Both run on the same key and the same script with a new model id, and each has a walkthrough: GLM 5.3 Uncensored and GLM 5.3 Flash Uncensored.
Where do I start?
Create a key on the Morse API page, export it, and run the script with the GLM id you need. For the story of the lab behind the models, read what Zhipu AI is. To try GLM in a chat window first, sign up for Morse and pick it from the model menu.
Common questions
Is a Z.ai API key the same as a Zhipu API key?
They come from the same company. Zhipu sells its API as Z.ai outside China and as BigModel inside it, and each platform hands out its own keys. Our explainer on what Zhipu AI is covers the lab and the two names.
Does a key from the Z.ai Open Platform work on Morse?
No. A key is only good where it was made. Z.ai keys belong on Z.ai's endpoint, and Morse takes its own keys, which begin with sk_morse_, at https://inference.trymorse.ai/v1.
Which GLM model should I call first with a Morse key?
GLM 5.3 for general and coding work, set to low effort while you test. GLM 5.3 Flash is the lighter choice and the one that reads text and images.
How do I reach the abliterated GLM models?
Keep the script and change the model to z-ai/glm-5.3-uncensored or z-ai/glm-5.3-flash-uncensored. Both answer to the same Morse key.