GLM 4.6
GLM 4.6 is Z.ai's coding-focused model released September 30, 2025, with enhanced performance on both benchmarks and real-world programming tasks. It features an expanded context window of 204.8K tokens for handling large codebases and complex agent workflows.
import { streamText } from 'ai'
const result = streamText({ model: 'zai/glm-4.6', prompt: 'Why is the sky blue?'})Frequently Asked Questions
What makes GLM 4.6 different from GLM-4.5?
GLM 4.6 is specifically optimized for coding tasks with an expanded context window of 204.8K tokens and targeted improvements in programming benchmark and real-world coding performance. GLM-4.5 is the general-purpose model.
What is the context window for GLM 4.6?
204.8K tokens, designed to handle large codebases, long specification documents, and multi-file analysis in a single request.
Can GLM 4.6 handle multi-file code analysis?
Yes. The expanded context window lets you include multiple files in a single request, enabling the model to understand cross-file dependencies, imports, and architectural patterns.
How do I authenticate with GLM 4.6 through AI Gateway?
AI Gateway provides a unified API key. Configure it in your environment and specify the model identifier. No separate Z.ai account is required, though BYOK is supported.
How does GLM 4.6 compare to GLM-4.7 for coding?
GLM 4.6 introduced the coding-focused improvements in the GLM lineup. GLM-4.7 adds further gains in tool usage, multi-step reasoning, and frontend development, per Z.ai's release notes.
Is GLM 4.6 suitable for non-coding tasks?
GLM 4.6 retains general language capability but is optimized for code. For conversational, reasoning, or general-purpose tasks, GLM-4.5 or GLM-5 may be more appropriate.
What is the pricing for GLM 4.6?
Pricing appears on this page and updates as providers adjust their rates. AI Gateway routes traffic through the configured provider.