# Zhipu: glm-5.2

- Model ID: `glm-5.2`
- Provider: Zhipu
- Web version: https://www.moleapi.com/en/models/zhipu/glm-5.2
- Content status: verified

## Model introduction

GLM-5.2 is Z.AI's text model for long-horizon coding and engineering, with 1M context, 128K output, and configurable reasoning effort.

## Model capabilities

- OpenAI compatible
- Responses API
- Anthropic compatible
- Gemini compatible
- Prompt cache
- Reasoning

### Verified specifications

- Official positioning: Long-horizon coding and engineering
- Context window: 1,000,000 tokens
- Maximum output: 128,000 tokens
- Verified capabilities: reasoning_effort, functions, structured output, MCP

## Model pricing and access

Pricing is supplied dynamically by the MoleAPI console API.

### Standard (default, x1)

- Input: $0.87 / 1M tokens
- Output: $3.48 / 1M tokens
- Cache read: $0.19 / 1M tokens

### Discount (discount, x0.8)

- Input: $0.696 / 1M tokens
- Output: $2.784 / 1M tokens
- Cache read: $0.152 / 1M tokens

### Relay (relay, x0.3)

- Input: $0.261 / 1M tokens
- Output: $1.044 / 1M tokens
- Cache read: $0.057 / 1M tokens

### Temporary (availability may vary) (temp, x0.1)

- Input: $0.087 / 1M tokens
- Output: $0.348 / 1M tokens
- Cache read: $0.019 / 1M tokens

### Access protocols

| Protocol | Method | Endpoint |
| --- | --- | --- |
| openai | POST | /v1/chat/completions |
| openai-response | POST | /v1/responses |
| anthropic | POST | /v1/messages |
| gemini | POST | /v1beta/models/{model}:generateContent |

- Live pricing source: https://home.moleapi.com/api/pricing

## About glm-5.2

## GLM-5.2 model guide

GLM-5.2 is Z.AI’s flagship text foundation model for long-horizon engineering and coding work, with an emphasis on repository-scale context, sustained task execution, and engineering-constraint adherence. [5][6] It supports configurable thinking modes, including `reasoning_effort`, for adjusting reasoning depth across tasks. [5][6]

## Positioning and core capabilities

GLM-5.2 is positioned for long-running development workflows that span requirements, codebases, dependencies, implementation, testing, and deployable outputs. [5][6] Z.AI describes its 1M-token context as intended to preserve project architecture, dependencies, and task progress across extended engineering tasks. [5][6]

The model supports streaming responses, function calling, streaming tool calls, structured output, context caching, and MCP-connected tools and data sources. [5] Its thinking modes and `reasoning_effort` control provide configurable reasoning depth. [5][6]

## Capabilities and specs

GLM-5.2 accepts text input and produces text output. [5] Its stated context window is 1M tokens, and its maximum output is 128K tokens. [5]

| Specification | Value |
| --- | --- |
| Positioning | Flagship foundation model for long-horizon tasks [5][6] |
| Input modality | Text [5] |
| Output modality | Text [5] |
| Context window | 1M tokens [5] |
| Maximum output | 128K tokens [5] |
| Reasoning controls | Thinking modes and configurable `reasoning_effort` [5][6] |
| Tool and integration support | Function calling, streaming tool calls, structured output, context caching, and MCP [5] |

## Use cases

GLM-5.2 is positioned for project-level codebase analysis, dependency-aware refactoring, SDK migrations, and multi-file implementation work. [5] Z.AI also identifies test-fix-verify loops, mobile debugging with ADB and logcat, WeChat Mini Program migration, research reproduction, and code-driven video workflows as supported engineering scenarios. [5]

Its long context and tool integration are designed for agentic workflows that need to retain large bodies of project evidence while using external functions, MCP tools, or connected data sources. [5][6]

## Material limitations

GLM-5.2 is specified as a text-input, text-output model. [5] Image, video, and GUI-understanding workloads require a separate vision-language model. [1]

## Sources

- [1] [B.AI GLM-5.2 model guide](https://docs.b.ai/llmservice/models/glm-5-2/)
- [5] [GLM-5.2 - 智谱AI开放文档](https://docs.bigmodel.cn/cn/guide/models/text/glm-5.2)
- [6] [GLM-5.2: Built for Long-Horizon Tasks](https://z.ai/blog/glm-5.2)


## Code examples

### cURL

```bash
curl https://api.moleapi.com/v1/responses \
  -H "Authorization: Bearer $MOLEAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"glm-5.2","input":"Explain this problem step by step."}'
```

### Python

```python
from openai import OpenAI

client = OpenAI(base_url="https://api.moleapi.com/v1", api_key="YOUR_MOLEAPI_API_KEY")
response = client.responses.create(model="glm-5.2", input="Explain this problem step by step.")
print(response.output_text)
```

### TypeScript

```typescript
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.moleapi.com/v1", apiKey: process.env.MOLEAPI_API_KEY });
const response = await client.responses.create({ model: "glm-5.2", input: "Explain this problem step by step." });
console.log(response.output_text);
```

## More related models

- [glm-5.3](https://www.moleapi.com/en/models/zhipu/glm-5.3) — Zhipu
- [z-ai/glm-5.2](https://www.moleapi.com/en/models/zhipu/z-ai-glm-5.2) — Zhipu
- [glm-5.1](https://www.moleapi.com/en/models/zhipu/glm-5.1) — Zhipu

## Frequently asked questions

### How is glm-5.2 priced?

Prices are read from the MoleAPI console API and update with model prices, context tiers, and account groups.

### How can I access glm-5.2?

The catalog currently lists openai, openai-response, anthropic, gemini.

### How do I switch an existing project to glm-5.2?

Keep the MoleAPI API address and key, replace the model parameter, and check protocol-specific parameters.

### Where do the glm-5.2 details come from?

Capabilities and limitations are checked against B.AI and the other cited pages; pricing and protocols come from the MoleAPI console.
