GLM 5
Up to 10%GLM 5 is Z.
What is GLM 5?
GLM 5 is an open-source flagship large language model from Z.ai designed as a Mixture-of-Experts system with roughly 744–745 billion total parameters and a ~200K token context window. It is mainly used for complex software and systems engineering, long-horizon agentic workflows, and production-grade coding assistance. It is also applied to advanced multi-step reasoning, planning, and creative or analytical text generation across general-purpose chat and knowledge-intensive tasks. GLM 5 belongs to Z.ai’s GLM (General Language Model) family and succeeds earlier generations such as GLM-4.5 and GLM-4.7.
Providers
Different companies host the same model. OpenRouter routes your request to one of them based on the routing mode you pick — Balanced (price + speed), Nitro (fastest), or Exacto (highest tool-calling accuracy).
| Provider | Input | Output | Cache read /M | Latency | Throughput | Uptime |
|---|---|---|---|---|---|---|
| Canopywave | $0.90 | $3.10 | $0.20 | — | — | — |
| Embercloud | $0.60 | $2.20 | $0.20 | — | — | — |
| Novita | $1.00 | $3.20 | $0.20 | — | — | — |
| Z.ai | $1.00 | $3.20 | $0.20 | ~220ms | ~120 tps | ~99.9% |
Try this model
Test GLM 5 right here — free to start.
Suggestions for your first prompt
Code snippet
Call the model through the OpenAI-compatible API.
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://inference.example.com/v1"
)
response = client.chat.completions.create(
model="z-ai/glm-5",
messages=[
{
"role": "user",
"content": "Describe this image in one sentence."
}
],
)
print(response.to_json())
{
"model": "z-ai/glm-5",
"messages": [
{
"role": "user",
"content": "Describe this image in one sentence."
}
]
}
5 Core Capabilities
-
Advanced Chatting
Supports natural, context-aware conversations over long sessions, handling instructions, explanations, and multi-turn dialogue for diverse applications.
-
Long-Context Reasoning
Performs multi-step, long-horizon reasoning over large context windows, enabling complex analysis, planning, and problem decomposition tasks.
-
High-Level Coding
Generates and edits code, builds full-stack applications, and solves software engineering tasks with strong benchmark performance.
-
Multilingual Abilities
Understands and generates text in multiple languages, enabling cross-lingual question answering, content creation, and global applications.
-
Multimodal Processing
Processes and reasons over both text and visual inputs via related GLM variants, supporting integrated multimodal workflows.
6 Most Valuable Use Cases
- Code Generation Assistance
- Multilingual Content Creation
- Customer Support Chatbots
- Document Summarization
- Legal Text Analysis
- Regulation Change Monitoring
Why Build on LLM.API?
One unified API. Every major model. Built-in reliability, cost control, and observability.
-
Unified AI Routing
Define routing rules once, then dynamically steer traffic across providers and models via a single endpoint—no client changes, just smarter utilization.
One endpoint, every model -
Cost-Aware Execution
Balance price and performance automatically with per-request policies that pick the cheapest model meeting your latency and quality constraints.
Spend less, ship more -
Resilient Fallbacks
Automatically retry requests on backup models or providers when failures or timeouts occur, so your apps stay responsive even when vendors don’t.
No single point of failure -
Full-Stack Observability
Get centralized logs, traces, and metrics across every provider to debug latency spikes, monitor spend, and tune prompts in one place.
See every token, everywhere -
Task-Level Abstractions
Describe tasks like “chat”, “embed”, or “moderate” and let LLM.API pick and orchestrate the right models and tools behind the scenes.
Think tasks, not models -
High-Throughput Batch
Submit massive batches through a unified API with built-in concurrency control, retries, and cost tracking for offline jobs and backfills.
Millions of calls, one pipeline
When to Use — When NOT to Use
Use it if...
- You need a capable general-purpose LLM from a major Chinese model provider.
- You need solid performance on Chinese and English tasks like chat or Q&A.
- Your use case involves typical enterprise workloads such as summarization, extraction, and rewriting.
- Your use case involves integrating with the Zhipu or Z.ai ecosystem and tooling.
- You need a modern foundation model likely optimized for cost-effective large-scale deployments.
- Your use case involves experimenting with frontier Chinese models for research or benchmarking comparisons.
Avoid if...
- You need guaranteed best-in-class reasoning performance compared to top proprietary Western frontier models.
- Your workload requires tightly validated support for niche languages beyond Chinese and English.
- You need detailed, battle-tested documentation and community examples in English-only developer ecosystems.
- Your workload requires strong assurances about US or EU data residency and compliance.
- You need seamless integration with specific US cloud-native AI services or proprietary tooling.
- Your workload requires extensively audited safety profiles and third-party red-teaming in Western markets.
Frequently Asked Questions
-
What is GLM 5?
GLM 5 is a large language model from Z.ai accessible via LLM.API for general-purpose text generation and understanding tasks.
-
What is the context window of GLM 5?
GLM 5 supports a context window of up to 32,000 tokens for each request, including input and output tokens.
-
Which modalities does GLM 5 support?
GLM 5 currently supports text-only input and output when accessed through LLM.API.
-
How is GLM 5 priced on LLM.API?
GLM 5 usage on LLM.API is billed per input and output token, with exact rates shown in your LLM.API pricing dashboard.
-
How fast is GLM 5 in terms of latency?
GLM 5 typically returns first tokens within a few hundred milliseconds, depending on prompt size, load, and your LLM.API region.
-
How do I call GLM 5 via LLM.API?
Specify provider "zai" and model "glm-5" in your LLM.API request, then send a standard chat or completion payload.
-
What is GLM 5 best suited for?
GLM 5 is best for cost-efficient code assistance, general chat, and tool-using agents that need a balanced capability-to-price ratio.
-
How does GLM 5 compare to similar models?
Compared to similar mid-tier models, GLM 5 targets lower cost while maintaining competitive reasoning and coding quality for most production workloads.
-
Does GLM 5 support function calling or tools via LLM.API?
Yes, GLM 5 supports structured tool or function calling when you define tools in your LLM.API request schema.
-
What are the main limitations of GLM 5?
GLM 5 can hallucinate facts, struggle with very long multi-step reasoning, and should not be used without human review for safety-critical decisions.
COMPARE
Competitive Models
-
GLM 5 Turbo
GLM 5 Turbo is a fast, agent‑oriented large language model from Z.ai, optimized for low‑latency inference and long, tool‑using workflows. It is a speed‑tuned variant of the GLM‑5 series designed to handle extended chains of reasoning and actions in real-world applications.
-
GLM 4.7
GLM 4.7 is Z.ai’s flagship large language model, optimized for strong coding performance and stable multi-step reasoning. It is notable for its very large context window and open-source availability under Apache 2.0.
-
GLM 5.1
GLM 5.1 is Z.ai’s flagship open-weight Mixture-of-Experts large language model optimized for long-horizon agentic coding and software engineering tasks. It is notable for its very large context window, strong SWE-Bench Pro performance, and open-source MIT licensing.
Get one key to every model
Swap your API key. Keep your code.