GLM API: a Z.ai key, GLM-5.3 and Flash, and a route without a foreign cardAn API for AI coding agents: one key, any OpenAI-compatible tool

GLM API: a Z.ai key, GLM-5.3 and Flash, and a route without a foreign card

The GLM API from Z.ai (Zhipu) is OpenAI-compatible: a key, a base_url and a model name, and GLM-5.3 works in any OpenAI SDK code, Cline, Kilo Code or OpenCode. Below: the official route, models and prices, the free models, an OpenAI-compatible route through Twelver and a cost calculator.

Short answer

Officially: an account on z.ai, a top-up on the Billing page, then API Keys → create a key. Base URL https://api.z.ai/api/paas/v4/, models glm-5.3 and glm-5.3-flash. Through Twelver: the zai (GLM-5.3) and zai-flash (GLM-5.3-Flash) series, with a key issued on this page with no signup and no card.

Models and official prices

ModelInputCached inputOutput
glm-5.3$1.40$0.26$4.40
glm-5.2$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
glm-4.7-flash, glm-4.5-flashfreefreefree
Z.ai prices per 1M tokens, docs.z.ai, 7 October 2026.

GLM-5.3 is text-only, with a 1M-token context and up to 128K output tokens. Reasoning is always on; reasoning_effort picks low, high or max (default), and "thinking": {"type": "disabled"} now fails. GLM-5.3-Flash is multimodal and about nine times cheaper on input.

GLM through Twelver

SeriesModel$ per 1M
zai-flashGLM-5.3-Flash0.244 / 0.813
zaiGLM-5.32.28 / 7.15

Right here

Base URL and key for GLM

Your own values appear in the block and drop straight into the code below.

Press it and get your base_url and API key.

No sign-up, no card.

Free. Your key appears right here.

Template — this will not work as isglm.pyThe highlighted parts are stand-ins. The button above issues them in seconds, no sign-up.
from openai import OpenAI

client = OpenAI(base_url="https://twelver.ru/api/ai/<your-config-id>/v1", api_key="sk-<your-key>")
reply = client.chat.completions.create(
    model="zai",  # GLM-5.3; "zai-flash" for cheap bulk requests
    messages=[{"role": "user", "content": "Write tests for this function: ..."}],
)
print(reply.choices[0].message.content)

Work out what the requests cost

Pick a workload or type your own numbers — the calculator multiplies them by each series’ rates. A token is roughly 4 characters of English text or code.

zaiGLM-5.3$231 per month
request: $0.0771,000 requests: $76.98
zai-flashGLM-5.3-Flash$24.89 per month
request: $0.00831,000 requests: $8.3
autoQwen3.7-Plus$67.86 per month
request: $0.0231,000 requests: $22.62
grokGrok 4.7$328 per month
request: $0.1091,000 requests: $109

Twelver rates as of 4 November 2026; tokens are billed as actually used, caching and discounts not included. The arithmetic runs in your browser.

Agent setup: Cline, Kilo Code, OpenCode. The model itself: GLM 5.3 in Twelver. Other models: Grok API, Qwen API. The whole book: API for AI agents.

Frequently asked questions

How do I get a GLM API key?
On Z.ai: sign up, top up on the Billing page, then API Keys → create a key. Base URL for the OpenAI SDK: https://api.z.ai/api/paas/v4/, models glm-5.3 and glm-5.3-flash.
Is there a free GLM API?
Z.ai offers the older light models glm-4.7-flash and glm-4.5-flash for free. GLM-5.3 and GLM-5.3-Flash are paid: $1.4 / $4.4 and $0.15 / $0.5 per 1M input / output tokens.
Why does GLM-5.3 return an error about thinking?
Reasoning cannot be turned off on GLM-5.3. Send "enabled" and choose the depth with reasoning_effort: low, high or max.
Can I use GLM without a Z.ai top-up?
Yes, through an OpenAI-compatible provider. Twelver serves GLM-5.3 and GLM-5.3-Flash as the zai and zai-flash series, with a key issued without signup or a card.

Try it yourself

Everything in this guide runs inside Twelver

One chat for text, images, video, music and voice — no separate services or subscriptions.

Open Twelver chat
Rate your experience