# GLM-5.2 > GLM-5.2 is a Z.ai reasoning model for long-horizon agent workflows and project-level software engineering. ## Key facts - Model author: Z.ai - Input: $1.0885 per 1M tokens (starting price) - Output: $3.8095 per 1M tokens (starting price) - Cached input: $0.2476 per 1M tokens - Context window: 1,000,000 tokens - Maximum output: 128,000 tokens - Input modalities: text - Output modalities: text - Capabilities: reasoning, structured_output, tools - Released: 2026-06-16 - Model IDs: `baidu/glm-5.2`, `jd/glm-5.2`, `z-ai/glm-5.2` - Model page: https://www.realrelay.ai/model/z-ai/glm-5.2 ## Overview GLM-5.2 is a large-scale reasoning model from Z.ai for long-horizon agent workflows and project-level software engineering. Z.ai highlights a stable 1M-token context for long tasks and coding that covers work from generation to delivery. Reasoning, tool calling and structured output are available for agents that work through a task step by step. GLM-5.2 has a 1M-token context window and can generate up to 128K output tokens. It accepts text input and returns text output. It was released on June 16, 2026. Its weights are openly available. ## Capabilities GLM-5.2 supports reasoning, structured output and tool calling. Z.ai highlights a stable long context for long-horizon tasks as a documented strength. ## Pricing GLM-5.2 starts from $1.0885 per 1M input tokens and from $3.8095 per 1M output tokens. Cache reads start from $0.2476 per 1M tokens. These are starting prices and the rate can vary. GLM-5.2 is available through RealRelay's OpenAI-compatible API. ## Use cases Use GLM-5.2 for project-level software engineering, where a whole repository, its issues and its test output fit in a single 1M-token context and the model carries work from generation through delivery. It also suits long-horizon agent workflows that combine reasoning with tool calls and structured output over many steps, with the long context keeping earlier results available to the model. ## Call it OpenAI-compatible chat completions: ```bash curl https://www.realrelay.ai/v1/chat/completions \ -H "Authorization: Bearer $REALRELAY_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "z-ai/glm-5.2", "messages": [{"role": "user", "content": "Hello"}]}' ``` ## FAQ ### What is GLM-5.2? GLM-5.2 is a Z.ai reasoning model for long-horizon agent workflows and project-level software engineering. ### How much does GLM-5.2 cost? GLM-5.2 starts from $1.0885 per 1M input tokens and from $3.8095 per 1M output tokens, with cache reads from $0.2476 per 1M tokens. ### What is the context window of GLM-5.2? GLM-5.2 has a 1M-token context window and can generate up to 128K output tokens. ### What inputs and outputs does GLM-5.2 support? GLM-5.2 accepts text input and returns text output. ### Does GLM-5.2 support tool calling? Yes. GLM-5.2 supports tool calling, along with reasoning and structured output. ### When was GLM-5.2 released? GLM-5.2 was released on June 16, 2026. ### How do I call GLM-5.2 via the API? Send requests to RealRelay's OpenAI-compatible API and use the model ID z-ai/glm-5.2.