GLM API key: how to get a key for GLM 5.3 and which URL to use
A GLM key can come from the Z.ai platform or from a gateway. We show both routes, the correct addresses, model ids and a cost comparison on an example.
5 min · · API keys · models
There are two ways to get GLM 5.3: a key on the official Z.ai platform, or a gateway key that works with GLM and with every other model. Below, step by step: how to get a GLM API key in both cases, which URL to put in code, which model ids to use, what it costs on an example, and how to read typical errors.
The Z.ai platform was checked against its documentation on 18 October 2026. Zukko prices are given for the same date: the current ones are always at GET https://api.zukko.pro/v1/models or on the Models page in the dashboard.
GLM API Z.ai: a key on the official platform
According to the Z.ai documentation (Quick Start section), the path is:
- Open the Z.ai platform, register or sign in.
- On the Billing page, top up the balance if the model you chose requires it.
- On the API Keys page, create a key of type Standard API Key.
- Copy the key and store it safely.
Separately, Z.ai has a GLM Coding Plan subscription for coding tools, which according to the documentation has its own dedicated endpoint. It is configured by a separate guide on the platform, and we do not cover it here.
A request to the platform, following the example from the documentation:
curl -X POST "https://api.z.ai/api/paas/v4/chat/completions" \
-H "Content-Type: application/json" \
-H "Accept-Language: en-US,en" \
-H "Authorization: Bearer YOUR_ZAI_KEY" \
-d '{"model": "glm-5.3", "messages": [{"role": "user", "content": "Hello! Introduce yourself."}]}'This answers the query "glm api url": the Z.ai platform's base address for OpenAI-compatible clients is https://api.z.ai/api/paas/v4/, and the model is called glm-5.3. You can also use the regular openai SDK:
from openai import OpenAI
client = OpenAI(api_key="YOUR_ZAI_KEY", base_url="https://api.z.ai/api/paas/v4/")
r = client.chat.completions.create(
model="glm-5.3",
messages=[{"role": "user", "content": "Hello! Introduce yourself."}],
)
print(r.choices[0].message.content)Access terms, top-up methods and country restrictions are set by the platform itself. See its Payment Method section and rules on its site.
A GLM API key through the Zukko gateway
The second way is a Zukko key. You need just one for all models: GLM, Claude, GPT, Gemini, DeepSeek, Qwen. The balance is shared, in dollars, with pay-per-token billing and no subscription.
- Open the dashboard and create a key. The full
fetch_...key is shown only once, so save it right away. - Top up the balance from $1.
- Set the address
https://api.zukko.pro/v1and the modelglm-5.3orglm-5.3-flashin your client.
curl https://api.zukko.pro/v1/chat/completions \
-H "Authorization: Bearer fetch_your_key" \
-H "Content-Type: application/json" \
-d '{"model": "glm-5.3-flash", "messages": [{"role": "user", "content": "Hello! Introduce yourself."}]}'from openai import OpenAI
client = OpenAI(base_url="https://api.zukko.pro/v1", api_key="fetch_your_key")
r = client.chat.completions.create(
model="glm-5.3",
messages=[{"role": "user", "content": "Hello! Introduce yourself."}],
)
print(r.choices[0].message.content)Access from Russia goes through the gateway, with payment by SBP (the payment page adds 8.5% on top), MasterCard, or crypto. GLM models can also be called in the Anthropic format: POST https://api.zukko.pro/v1/messages. In Claude Code and the official Anthropic SDK the address is given without /v1: ANTHROPIC_BASE_URL=https://api.zukko.pro, with the key in ANTHROPIC_AUTH_TOKEN. Details are in the Claude Code guide.
Two addresses not to mix up
| Where the key is from | Base address | Key |
|---|---|---|
| Z.ai platform | https://api.z.ai/api/paas/v4/ | Z.ai key |
| Zukko, OpenAI format | https://api.zukko.pro/v1 | fetch_... |
| Zukko, Claude Code and Anthropic SDK | https://api.zukko.pro | fetch_... |
A Z.ai key does not work with the Zukko address and vice versa: you will get a 401.
GLM models and their parameters
Data as of 18 October 2026. Zukko prices are dollars per 1M tokens.
| id | Zukko input / output | Official input / output | Context | Image input | Strength index |
|---|---|---|---|---|---|
glm-5.3 | 0.1 / 0.1 | 1.4 / 4.4 | 128K | no | 45 |
glm-5.3-flash | 0.04 / 0.04 | 0.15 / 0.5 | 128K | no | 42 |
For GLM the cache is counted if the provider reports it in the response; there is no separate charge for writes. The strength index is the Artificial Analysis Intelligence Index; we give no other quality numbers, so test the model on your own tasks.
Cost calculation
A request with 500K input tokens and 100K output tokens:
glm-5.3on Zukko: 0.5 × 0.1 + 0.1 × 0.1 = 0.05 + 0.01 = $0.06;glm-5.3at official prices: 0.5 × 1.4 + 0.1 × 4.4 = 0.70 + 0.44 = $1.14;glm-5.3-flashon Zukko: 0.5 × 0.04 + 0.1 × 0.04 = 0.02 + 0.004 = $0.024;glm-5.3-flashat official prices: 0.5 × 0.15 + 0.1 × 0.5 = 0.075 + 0.05 = $0.125.
Official prices come from our table and matched the Pricing page of the Z.ai platform on the check date. The provider may change them.
Free GLM API: what is true here
People search "free glm api" a lot. We do not promise free access. On its Pricing page, Z.ai at the time of checking marked some older models as Free (for example GLM-4.7-Flash and GLM-4.5-Flash) and some items as Limited-time Free. Such terms change, they may come with limits, and they do not replace the current 5.3. If you want to spend pennies, take glm-5.3-flash at $0.04 per 1M tokens: 100K input tokens plus the same number of output tokens cost 0.1 × 0.04 + 0.1 × 0.04 = $0.008.
Errors when connecting GLM
- 401: wrong key, or the addresses from the table above are mixed up. Check the
fetch_prefix and stray spaces. - 402: not enough money on the Zukko balance. Top it up.
- 403
model_not_allowed_for_key: the key'sallowed_modelslist does not include the model. Add it in the key settings. - 404
model_not_found: wrong name. Take ids fromGET /v1/models, for exampleglm-5.3-flash(hyphens and the dot in the version). - 429: the key's daily or monthly limit is exhausted (
key_daily_limit_reached), or the model provider is limiting you. - 413 or a truncated context: GLM has a 128K window, not 1M like most other models in the catalog.
The other codes are covered in 401, 402, model not found. More on the model itself: GLM 5.3: connecting. On headers and keys: API authentication.
FAQ
Which base URL does GLM need?
For the Z.ai platform: https://api.z.ai/api/paas/v4/. For Zukko in OpenAI clients: https://api.zukko.pro/v1. For Claude Code and the Anthropic SDK: https://api.zukko.pro without /v1.
What is the model called in the request?
glm-5.3 and glm-5.3-flash. GET /v1/models returns the list of current ids.
Can one key serve both GLM and Claude?
On Zukko, yes: one fetch_... key and one balance. The model is chosen by the model string. For separate projects it is better to create separate keys with a daily limit.
Does GLM understand images?
In our catalog, image input is not marked for glm-5.3 and glm-5.3-flash. For image tasks, look at the other models in the table that accept image input.
zukko
Pay 25×
less
for Claude Code & ChatGPT
One fetch_* key and base URL api.zukko.pro — for Cursor, Claude Code, Codex, and any SDK.
Related articles
- xAI Grok API: Connecting Grok 4.7, Price and the 256K ContextHow to call grok-4.7 through an OpenAI-compatible API, what to do about the 256K context limit and what typical requests cost. Plus a comparison with Grok 4.6.
- Grok API from Russia: connecting without a foreign cardStep by step connection to Grok 4.7, 4.6 and 4.5 through a gateway: key, address, first request in curl and Python, streaming, images and payment by SBP or crypto.
- Claude Sonnet 5.5 via API: connection, prices and cache at October 18, 2026How to call claude-sonnet-5-5 from Python and curl, what a typical request costs with and without cache, and how it differs from Sonnet 5 and Sonnet 4.6.
- Claude on Android in Russia: what to do if the app won't installIf the official Claude app won't install on Android in Russia, you can still use the model from your phone: through the gateway's web chat or a client with your own key.