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.2
z-ai/glm-5.2Try Z.ai: GLM 5.2 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.2 at a glance
- Input price is 92% lower than the median of 434 Text models.
- Context window of 1,048,576 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.01.
About Z.ai: GLM 5.2
GLM 5.2 is a large-scale reasoning model from Z.ai, listed on api14 under the model id z-ai/glm-5.2. It sits in the text category, so it is built for language work rather than image, audio or video handling. Z.ai positions it around long-horizon agent workflows and project-level software engineering, which tells you the intended shape of the work: tasks that run for many steps and touch a lot of material rather than single quick questions.
The model takes text as input and returns text as output. Its context window is 1,048,576 tokens, and the maximum output is 943,718 tokens, so both the prompt side and the generated side are large. That combination matters for workloads where the model must read a substantial body of material and then produce a long, coherent result in one pass, such as a full specification, a lengthy refactor plan or an extended reasoning trace. Reasoning behaviour is exposed through the reasoning and include_reasoning parameters, and reasoning_effort lets you tune how much effort the model spends before answering.
Those capabilities point to a few practical uses. Agent workflows that need to hold state across many tool calls fit the long context and the tool support. Repository-scale software engineering tasks, where several files and their relationships must be considered together, are a natural match. Long document analysis, multi-step research summarisation and structured extraction from large inputs also follow from the same properties, since the model can keep the whole source in view instead of chunking it.
You call it through api14's OpenAI-compatible API using the model id z-ai/glm-5.2, so existing OpenAI client libraries work with a change of base URL and model name. The request parameters it supports are frequency_penalty, include_reasoning, logit_bias, logprobs, max_tokens, min_p, parallel_tool_calls, presence_penalty, reasoning, reasoning_effort, repetition_penalty, response_format, seed, stop, structured_outputs, temperature, tool_choice, tools, top_k, top_logprobs and top_p. Tool calling is available through tools and tool_choice, with parallel_tool_calls for concurrent invocations, and structured_outputs and response_format cover cases where the reply must conform to a schema. Sampling controls such as temperature, top_p, top_k, min_p and the penalty parameters give you room to tune determinism, and seed plus logprobs and top_logprobs help when you need reproducible or inspectable output.
Since the model is text only, a task that depends on image or audio input will need a different model. The very large context and output limits are useful but not free in terms of latency, so short, simple requests may be served better by a smaller model. Within text work, though, GLM 5.2 is aimed at the long, multi-step end of the range.
How to call the Z.ai: GLM 5.2 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.2".
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.2",
"messages": [
{
"role": "user",
"content": "Explain vector databases in two sentences."
}
]
});
console.log(result.choices[0].message.content);
Supported parameters
frequency_penaltyinclude_reasoninglogit_biaslogprobsmax_tokensmin_pparallel_tool_callspresence_penaltyreasoningreasoning_effortrepetition_penaltyresponse_formatseedstopstructured_outputstemperaturetool_choicetoolstop_ktop_logprobstop_pSpecifications
- Context length
- 1,048,576
- Max output
- 943,718
- Input
- text
- Output
- text
Requests on api14 · last 7 days
Z.ai: GLM 5.2: frequently asked questions
- How much does the Z.ai: GLM 5.2 API cost?
- Z.ai: GLM 5.2 costs Input $0.12 / 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.2?
- Z.ai: GLM 5.2 reads up to 1,048,576 tokens per request: prompt, history and documents together. It writes up to 943,718 output tokens per response.
- What can Z.ai: GLM 5.2 do?
- Z.ai: GLM 5.2 accepts text and returns text. It supports tool calling, structured JSON output, reasoning effort control.
- How do I call Z.ai: GLM 5.2 from my code?
- Point any OpenAI SDK at https://api14.com/api/v1 and set the model to "z-ai/glm-5.2". No other code changes. Copy a ready example from the code panel on this page.
- What are alternatives to Z.ai: GLM 5.2?
- Comparable Text models at a similar price: OpenAI: GPT-5.6 Terra Pro (batch), OpenAI: GPT-5.6 Terra (batch), Google: Gemini 3.1 Pro Preview (batch). Each runs through the same API key, so switching is one string.
Z.ai: GLM 5.2 community
New topicThis community has no topics yet. Open the first one about Z.ai: GLM 5.2.