GLM 5.4 API
Use GLM 5.4 by Z.ai through Refract's OpenAI-compatible API for $0.55 per 1M input and $1.71 per 1M output tokens. Pay per token, no subscription.
| Model ID | glm-5.4 |
|---|---|
| Provider | Z.ai |
| Input, per 1M tokens | $0.55 |
| Output, per 1M tokens | $1.71 |
| Context window | 1,000,000 tokens |
GLM 5.4 for coding and long-context reasoning.
About this model
GLM 5.4 is the newest GLM model on Refract, and the highest-priced of the 3 Z.ai models here. It replaces GLM 5.3 as the latest GLM model. It reads up to 1M tokens of context and writes up to 128K tokens per reply. Repeated prompt prefixes are read from cache at $0.10 per 1M tokens, 81% less than fresh input, which is what makes long agent sessions cheap.
How it compares
- GLM 5.3: GLM 5.3 costs 67% less; GLM 5.4 is the newer release; cached input $0.10 vs $0.14.
- GLM 5.3 Flash: GLM 5.3 Flash costs 77% less; cached input $0.10 vs $0.016.
What a request costs
A typical chat message (2,000 tokens in, 400 out) costs about $0.0018. A coding-agent step (60,000 tokens in, 54,000 of them from cache, 800 out) costs about $0.010.
Chat with GLM 5.4 · Get an API key
Use it from code
curl https://refracthub.com/v1/chat/completions \
-H "Authorization: Bearer $REFRACT_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "glm-5.4", "messages": [{"role": "user", "content": "Hello"}]}'from openai import OpenAI
client = OpenAI(base_url="https://refracthub.com/v1", api_key="YOUR_REFRACT_KEY")
reply = client.chat.completions.create(model="glm-5.4", messages=[{"role": "user", "content": "Hello"}])
print(reply.choices[0].message.content)
Questions
How much does GLM 5.4 cost on Refract?
$0.55 per 1M input tokens and $1.71 per 1M output tokens. You pay only for the tokens you use, with no subscription.
GLM 5.4 or GLM 5.3: which should I use?
GLM 5.3 is cheaper. GLM 5.4 is the newer release. Both work with the same key and the same API, so you can try one and switch by changing the model name from "glm-5.4" to "glm-5.3".
Does it work with the OpenAI SDK?
Yes. Point the OpenAI SDK, or any OpenAI-compatible app, at https://refracthub.com/v1 with your Refract key and use the model name "glm-5.4". The Anthropic Messages format works too.
Can I use GLM 5.4 without writing code?
Yes. Chat with it on the web at https://refracthub.com/chat, or use the Refract desktop app for Windows.
Other Z.ai models
- GLM 5.3: $0.18 / $0.57 per 1M tokens
- GLM 5.3 Flash: $0.12 / $0.40 per 1M tokens