# GLM-5.1 > GLM-5.1 is a Z.ai model with major gains in coding, built to work on long-horizon tasks independently. ## Key facts - Model author: Z.ai - Input: $0.8163 per 1M tokens (starting tier) - Output: $3.2653 per 1M tokens (starting tier) - Cached input: $0.1769 per 1M tokens - Context window: 200,000 tokens - Maximum output: 128,000 tokens - Input modalities: text - Output modalities: text - Capabilities: reasoning, structured_output, tools - Released: 2026-04-07 - Model IDs: `baidu/glm-5.1`, `jd/glm-5.1`, `z-ai/glm-5.1` - Model page: https://www.realrelay.ai/model/z-ai/glm-5.1 ## Overview GLM-5.1 is a text model from Z.ai that delivers a major leap in coding capability, with particularly significant gains on long-horizon tasks. Z.ai says it can work independently and continuously on a single task for hours, rather than in short, minute-level interactions. It supports reasoning, structured output and tool calling. GLM-5.1 has a 200K-token context window and can generate up to 128K output tokens. It accepts text input and returns text output. It was released on April 7, 2026. ## Capabilities GLM-5.1 supports reasoning, structured output and tool calling. Z.ai lists coding proficiency and independent work on one task over long periods as its main strengths. ## Pricing GLM-5.1 starts from $0.8163 per 1M input tokens and from $3.2653 per 1M output tokens. Cache reads start from $0.1769 per 1M tokens. The prices shown are the starting tier. GLM-5.1 is available through RealRelay's OpenAI-compatible API. ## Use cases Use GLM-5.1 for long-running coding agents that take a task, work through it independently for hours and keep calling tools until the code is written, tested and fixed. It also suits other long-horizon jobs that need steady progress without frequent human prompts, such as multi-stage refactors, with a 200K-token context window to keep the history in view. ## 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.1", "messages": [{"role": "user", "content": "Hello"}]}' ``` ## FAQ ### What is GLM-5.1? GLM-5.1 is a Z.ai model with major gains in coding, built to work on long-horizon tasks independently. ### How much does GLM-5.1 cost? GLM-5.1 starts from $0.8163 per 1M input tokens and from $3.2653 per 1M output tokens, with cache reads from $0.1769 per 1M tokens. ### What is the context window of GLM-5.1? GLM-5.1 has a 200K-token context window and can generate up to 128K output tokens. ### What inputs and outputs does GLM-5.1 support? GLM-5.1 accepts text input and returns text output. ### Does GLM-5.1 support tool calling? Yes. GLM-5.1 supports tool calling, along with reasoning and structured output. ### When was GLM-5.1 released? GLM-5.1 was released on April 7, 2026. ### How do I call GLM-5.1 via the API? Send requests to RealRelay's OpenAI-compatible API and use the model ID z-ai/glm-5.1.