We use cookies. Cookies and browser storage keep you signed in and remember your preferences. With your permission we also measure how the site is used. You can any time. See our cookie policy.
Z.ai: GLM 5
z-ai/glm-5Try Z.ai: GLM 5 now
Runs on your balance at the prices above. New accounts start with free usage.
One API. Every model.
Session cost $0.00
Settings
Advanced parameters
Z.ai: GLM 5 at a glance
- Input price is 122% higher than the median of 434 Text models.
- Context window of 204,800 tokens, enough for long documents and multi-turn conversations.
- Supports tool (function) calling for agents and integrations.
- Supports structured JSON output with a schema.
- Supports reasoning effort control.
- A typical request (1,000 input / 500 output tokens) costs about $0.00910.
About Z.ai: GLM 5
GLM 5 is Z.ai's flagship open-source foundation model, released on 11 February 2026. Z.ai builds it for complex systems design and long-horizon agent workflows, positioning it toward expert developers who need production-grade performance on large-scale programming tasks. It sits in the text category, so it is a language model rather than a multimodal one.
The model accepts text as input and returns text as output. Its context window is 204,800 tokens, and its maximum output is 128,000 tokens, which means you can supply very large inputs (whole codebases, long transcripts, extended documentation) and still leave room for a substantial generated response. Among the parameters it supports are temperature, top_p, top_k, frequency_penalty, presence_penalty and repetition_penalty for controlling sampling, plus max_tokens and stop for shaping the response. It also supports reasoning and include_reasoning, so the model can expose a reasoning process alongside its answer, and logprobs with top_logprobs if you need token-level probabilities.
Those capabilities point to a few practical uses. Long-context handling plus strong programming performance makes it a fit for repository-scale code analysis, refactoring plans, and design work on systems that span many files. The reasoning support suits tasks where you want to inspect how a conclusion was reached, such as debugging or technical decision support. Tool calling and structured outputs make it usable as the reasoning core of an agent that has to call functions, follow multi-step workflows, or return data in a fixed schema. The seed parameter helps when you need repeatable sampling during testing.
You call it through api14's OpenAI-compatible API using the model id "z-ai/glm-5". Because the interface follows the OpenAI format, existing OpenAI client libraries and request shapes work with a change of base URL and model id. The request parameters listed above are all available, including tools and tool_choice for function calling, response_format and structured_outputs for constrained output, and reasoning with include_reasoning when you want the model's reasoning surfaced. Sampling controls (temperature, top_p, top_k, penalties, seed, stop) and max_tokens behave as expected.
One thing to keep in mind is modality: input and output are text only, so if your task centers on images or audio, a multimodal model would fit better. The large context window and output ceiling also mean requests can be heavy, so it is worth setting max_tokens deliberately rather than leaving it open. For straightforward, short text tasks, a smaller model may be sufficient, but for long-horizon agent work and large-scale programming tasks, GLM 5 is built for exactly that.
How to call the Z.ai: GLM 5 API
- Create an API key in your dashboard.
- Install the official openai SDK for your language.
- Set baseURL to https://api14.com/api/v1 and model to "z-ai/glm-5".
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api14.com/api/v1",
apiKey: process.env.API14_API_KEY,
});
const result = await client.chat.completions.create({
"model": "z-ai/glm-5",
"messages": [
{
"role": "user",
"content": "Explain vector databases in two sentences."
}
]
});
console.log(result.choices[0].message.content);
Supported parameters
frequency_penaltyinclude_reasoninglogprobsmax_tokenspresence_penaltyreasoningrepetition_penaltyresponse_formatseedstopstructured_outputstemperaturetool_choicetoolstop_ktop_logprobstop_pSpecifications
- Context length
- 204,800
- Max output
- 131,072
- Input
- text
- Output
- text
Requests on api14 · last 7 days
Z.ai: GLM 5: frequently asked questions
- How much does the Z.ai: GLM 5 API cost?
- Z.ai: GLM 5 costs Input $3.50 / 1M tokens. It is charged from your USD balance only for successful requests; failed requests are free.
- What is the context window of Z.ai: GLM 5?
- Z.ai: GLM 5 reads up to 204,800 tokens per request: prompt, history and documents together. It writes up to 131,072 output tokens per response.
- What can Z.ai: GLM 5 do?
- Z.ai: GLM 5 accepts text and returns text. It supports tool calling, structured JSON output, reasoning effort control.
- How do I call Z.ai: GLM 5 from my code?
- Point any OpenAI SDK at https://api14.com/api/v1 and set the model to "z-ai/glm-5". No other code changes. Copy a ready example from the code panel on this page.
- What are alternatives to Z.ai: GLM 5?
- Comparable Text models at a similar price: Qwen: Qwen3.5 397B A17B, MoonshotAI: Kimi K2.6, MoonshotAI: Kimi K2.7 Code. Each runs through the same API key, so switching is one string.
Z.ai: GLM 5 community
New topicThis community has no topics yet. Open the first one about Z.ai: GLM 5.