---
title: "GLM-5.2 API pricing"
canonical: "https://router.xark.io/models/glm-5-2"
description: "GLM-5.2 at $0.82/M, 42% below the official rate. MIT licensed, OpenAI-compatible."
section: "models"
updated: "2026-09-02"
source: "https://router.xark.io/models/glm-5-2.md"
---

# GLM-5.2 API pricing

GLM-5.2 costs $0.82 per million input tokens and $2.55 per million output tokens, against an official rate of $1.40 and $4.40 — 42% below official pricing. It is a Z.ai model under the MIT licence, with a 200K context window, callable through an OpenAI-compatible endpoint with the model id `z-ai/glm-5.2`. On an agent or chat workload that resends a fixed prompt prefix, where that prefix is billed at the cached rate of $0.16 per million, the saving reaches 68%.

**Availability:** callable today at `z-ai/glm-5.2`. 7 of the 24 catalogued models are callable today; the rest are catalogued at their intended rate but not served.

## At a glance

| Field | Value |
| --- | --- |
| Model id | `z-ai/glm-5.2` |
| Publisher | Z.ai |
| Modality | text |
| Licence | MIT — [what it permits](https://router.xark.io/licences/mit.md) |
| Capacity | 200K tokens |
| Released | Jun 30, 2026 |
| Unit | per 1M tokens |
| Saving vs official | 42% |
| Callable today | Yes |

## Pricing

| Line item | Applies to | Our rate | Official rate | Saving |
| --- | --- | --- | --- | --- |
| Input tokens | All requests | $0.82/M | $1.40/M | 41% off |
| Output tokens | All requests | $2.55/M | $4.40/M | 42% off |
| Cache read | Prefix already cached | $0.16/M | $0.28/M | 43% off |

## Other providers carrying this model

| Provider | Input | Output |
| --- | --- | --- |
| AI Token Router | $0.82/M | $2.55/M |
| OpenRouter | $1.36/M | $4.27/M |
| DeepInfra | $0.95/M | $3.10/M |
| Together AI | $1.30/M | $4.10/M |
| Publisher (official) | $1.40/M | $4.40/M |

## What it is

The strongest all-rounder in the catalog for the money. Genuinely competitive with closed frontier models on coding and tool use, under a plain MIT license.

## Good for

- General-purpose production workloads
- Structured output and function calling at scale
- Bilingual EN/ZH applications

## Calling it

### Python

```python
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://router.xark.io/api/v1"   # ← the only line that changes
)

response = client.chat.completions.create(
    model="z-ai/glm-5.2",
    messages=[{"role": "user", "content": "Hello"}]
)
```

### Node.js

```javascript
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.ROUTER_API_KEY,
  baseURL: "https://router.xark.io/api/v1"   // ← the only line that changes
});

const response = await client.chat.completions.create({
  model: "z-ai/glm-5.2",
  messages: [{ role: "user", content: "Hello" }]
});
```

### cURL

```bash
curl https://router.xark.io/api/v1/chat/completions \
  -H "Authorization: Bearer $ROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "z-ai/glm-5.2",
    "messages": [{"role": "user", "content": "Hello"}]
  }'
```

## Questions

### What does GLM-5.2 cost on AI Token Router, and what is the official rate?

Input is $0.82/M here against $1.40/M official, and output is $2.55/M against $4.40/M official — $0.58/M off every million input tokens and $1.85/M off every million output tokens. The headline 42% blends the two, weighted three to one towards output, because real workloads write far more than they read and a flat average of the two percentages would overstate what you actually save. Both figures are printed side by side on this page: the official rate is the only benchmark that makes ours mean anything.

### Can I call GLM-5.2 right now?

Yes. A request naming `z-ai/glm-5.2` reaches a live upstream today and is billed at the rates above. 7 of the 24 models in this catalogue are callable right now; the rest are listed at their intended price and marked unavailable on their own pages, so you find that out here rather than from an error at call time.

### Does GLM-5.2 support prompt caching, and what does a cached token cost?

Yes. A repeated prefix — a fixed system prompt, a tool schema, a document you keep querying — is served from the model's KV cache and billed at $0.16/M instead of the standard $0.82/M, which is 80% below the input rate. Z.ai's own cached rate is $0.28/M, so the discount applies on top of a rate that is already below official. Nothing has to be set on the request; the prefix is matched automatically. On an agent loop, where most of every request is unchanged from the last one, this is usually the largest single line on the bill.

### How do I call GLM-5.2 from my code?

Point an OpenAI SDK at `https://router.xark.io/api/v1` and pass `model="z-ai/glm-5.2"` — the chat completions endpoint is `https://router.xark.io/api/v1/chat/completions`. Request shape, streaming frames, the usage block and the error envelope all match what your OpenAI client already handles, so the base URL and the model id are the only two lines that change. The bare name `glm-5.2` and the URL slug `glm-5-2` resolve to the same model. An integration written before the ids were namespaced therefore keeps working.

### How large is GLM-5.2's context window?

200K — 204,800 tokens in a single request, shared between everything you send and everything the model generates back. For comparison, the widest context in this catalogue is Llama 4 Maverick at 1M. Context is billed like any other input: filling the window costs the input rate on every token in it, every turn, which is why the cached-input rate matters more than the window size on a workload that resends the same prefix.

### What licence is GLM-5.2 under, and can I use it commercially?

GLM-5.2 is published by Z.ai under the MIT licence. MIT is a standard permissive licence: commercial use, modification and redistribution are all allowed, and the only obligation is to keep the copyright and licence notice with the software. It sets no user threshold, no field-of-use restriction and no separate acceptable-use policy, so there is nothing in it that limits what you build commercially on top of the output.

### How does GLM-5.2 pricing here compare with other providers carrying it?

Of the 3 other providers we track carrying GLM-5.2, the lowest is DeepInfra at $0.95/M input and $3.10/M output, against our $0.82/M input and $2.55/M output. That is where the rates stood when we last reconciled them, and it can change without notice — we are not claiming to be the cheapest source for this model, only that our rate sits below Z.ai's official $1.40/M. If you find one of these figures stale, tell us and we will correct it.

### What is GLM-5.2 actually good at?

The strongest all-rounder in the catalog for the money. Genuinely competitive with closed frontier models on coding and tool use, under a plain MIT license. In practice that points at general-purpose production workloads, structured output and function calling at scale and bilingual EN/ZH applications. The specifics that actually decide a fit — the rate, the licence and what it will and will not serve today — are all on this page rather than behind a sales conversation.

## Related models

| Model | Our rate | Callable | Document |
| --- | --- | --- | --- |
| Kimi K2.6 | $0.55/M | Yes | [read](https://router.xark.io/models/kimi-k2-6.md) |
| Kimi K3 | $1.85/M | Yes | [read](https://router.xark.io/models/kimi-k3.md) |
| GLM-5.2 Air | $0.17/M | No | [read](https://router.xark.io/models/glm-5-2-air.md) |
| DeepSeek V4 Pro | $0.28/M | Yes | [read](https://router.xark.io/models/deepseek-v4-pro.md) |
| DeepSeek V4 Flash | $0.090/M | Yes | [read](https://router.xark.io/models/deepseek-v4-flash.md) |
| Qwen3 Max Instruct | $0.49/M | No | [read](https://router.xark.io/models/qwen3-max-instruct.md) |
| Qwen3 235B A22B | $0.13/M | No | [read](https://router.xark.io/models/qwen3-235b-a22b.md) |
| MiniMax M2 | $0.19/M | No | [read](https://router.xark.io/models/minimax-m2.md) |
| Llama 4 Maverick | $0.14/M | No | [read](https://router.xark.io/models/llama-4-maverick.md) |
| Mistral Large 3 | $1.20/M | No | [read](https://router.xark.io/models/mistral-large-3.md) |
| GPT-OSS 120B | $0.090/M | No | [read](https://router.xark.io/models/gpt-oss-120b.md) |