GLM-5 API
Call GLM-5 from Z.AI through Deftrouter's OpenAI-compatible endpoint: one key, the OpenAI SDK you already use, and usage tracked per key. Access is by request.
General GLM flagship for coding, analysis, and tool-heavy engineering workflows.
Specifications
| Provider | Z.AI |
|---|---|
| Model ID | glm-5 |
| Context window | 204,800 tokens |
| Maximum output | 131,072 tokens |
| Input types | text |
| Reasoning | Yes |
| Tool calling | Yes |
| Open weights | Yes |
| Released | February 12, 2026 |
GLM-5 API pricing
These are Z.AI's list prices as of November 30, 2026, in US dollars per 1 million tokens. Deftrouter confirms its own price by email when you request access.
For example, a request with 10,000 input tokens and 1,000 output tokens costs about $0.0132 at list price.
Call GLM-5 with the OpenAI SDK
Point the OpenAI SDK at Deftrouter and set the model ID. The rest of your code stays the same.
from openai import OpenAI
client = OpenAI(
base_url="https://api.deftrouter.com/v1",
api_key="YOUR_DEFTROUTER_KEY",
)
# Your Deftrouter key, sent to one endpoint for every model.
reply = client.chat.completions.create(
model="glm-5",
messages=[{"role": "user", "content": "Hello"}],
) Request GLM-5 API access
Access is by request for now. Leave your email and the models you need, and we will email you when your key is ready.
GLM-5 API questions
How do I get GLM-5 API access?
Request it through Deftrouter: send the form on this page with your email, and we will email you when your key is ready. You then call GLM-5 with the OpenAI SDK by changing the base URL and the model ID.
How much does the GLM-5 API cost?
Z.AI lists GLM-5 at $1.00 per 1 million input tokens and $3.20 per 1 million output tokens as of November 30, 2026. Deftrouter confirms its own price by email when you request access.
What is the context window of GLM-5?
GLM-5 accepts up to 204,800 tokens of context and can return up to 131,072 tokens in a single response.
Does GLM-5 support tool calling and image input?
GLM-5 supports tool calling. It does not accept images as input.
More Z.AI models
| Model | Context window | Input | Output |
|---|---|---|---|
| GLM-5.3-FlashX | 1,000,000 | $0.37 | $1.25 |
| GLM-5.3-Flash | 1,000,000 | $0.15 | $0.50 |
| GLM-5.3 | 1,000,000 | $1.40 | $4.40 |
| GLM-5.2 | 1,000,000 | $1.40 | $4.40 |
| GLM-5.1 | 200,000 | $1.40 | $4.40 |
| GLM-5V-Turbo | 200,000 | $1.20 | $4.00 |
Model data from models.dev, retrieved November 30, 2026. Limits and prices are set by the provider and can change. models.dev · Z.AI