GLM 5
GLM 5 is Z.ai's GLM-5 generation model released February 12, 2026, featuring multiple thinking modes, enhanced long-range planning and memory, and improved handling of complex multi-step agent tasks. It supports agentic coding and structured data extraction workflows.
import { streamText } from 'ai'
const result = streamText({ model: 'zai/glm-5', prompt: 'Why is the sky blue?'})Frequently Asked Questions
What are the multiple thinking modes in GLM 5?
GLM 5 supports different thinking modes that optimize for different task profiles, from quick direct responses to deep deliberation with extended chain-of-thought reasoning. This lets you control the accuracy-latency tradeoff per request.
How does GLM 5 compare to GLM-4.7?
GLM 5 adds multiple thinking modes, improved long-range planning and memory, and expanded agentic features compared with GLM-4.7. GLM-4.7 can still fit coding and frontend tasks when you want lower cost.
What makes GLM 5 good at document extraction?
Z.ai cites structured extraction from contracts, financial reports, and other complex documents. Improved planning and reasoning help with multi-section files, cross-references, and complex formatting.
What is the context window for GLM 5?
202.8K tokens.
How do I authenticate with GLM 5 through AI Gateway?
AI Gateway provides a unified API key. No separate Z.ai account is needed. Use the model identifier to route requests. BYOK is also supported for direct provider access.
Is GLM 5 suitable for autonomous coding?
Yes. GLM 5 handles agentic coding where it autonomously plans, writes, tests, and iterates on code. The improved long-range planning helps maintain coherence across complex, multi-file coding tasks.
What is the pricing for GLM 5?
Rates are listed on this page. They reflect the providers routing through AI Gateway and shift when providers update their pricing.