---
title: Z.ai: GLM 5.2 API | Text Generation | ModelsLab
description: Build with Z.ai: GLM 5.2 API by Z Ai. Text generation, chat, code, and reasoning. Pay-per-use. Free tier.
url: https://modelslab.com/models/z-ai/z-ai-glm-5.2.md
canonical: https://modelslab.com/models/z-ai/z-ai-glm-5.2.md
type: product
component: Playground/LLM/Index
generated_at: 2026-06-19T22:06:48.921508Z
---

Z.ai: GLM 5.2
---

 [LLMs.txt](https://modelslab.com/models/open_router/z-ai-glm-5.2/llms.txt) [.md](https://modelslab.com/models/z-ai/z-ai-glm-5.2.md)

Z.ai: GLM 5.2
---

Choose a prompt below to get started or type your own message

 Explain quantum computing in simple terms

 Write a Python function to sort a list

 Create a marketing email for a SaaS product

 Compare REST vs GraphQL APIs

Send

### Z.ai: GLM 5.2

z-ai z-ai-glm-5.2

Copy model ID

PricingInput $1.20 / 1M tokens

Output $4.10 / 1M tokens

API EndpointsOpenAI Compatible

`https://modelslab.com/api/v7/llm/chat/completions`Endpoint

Anthropic Compatible

`https://modelslab.com/api/v7/llm/v1/messages`Messages

`https://modelslab.com/api/v7/llm/v1/messages/count_tokens`Count Tokens

`https://modelslab.com/api/v7/llm/v1/models`Models

Use with Claude Code

cURL Example

ParametersSystem MessageYou are a helpful AI assistant specialized in providing accurate and detailed responses.

Temperature0.7

Max Tokens1000

Top P0.9

Frequency Penalty0

Presence Penalty0

Model Info

Support

Related Models
---

Discover similar models you might be interested in

 [View all LLM Models](https://modelslab.com/models?feature=llmaster)

[#### open\_router/Qwen: Qwen3 Max Thinking

qwen-qwen3-max-thinking

From $2.34/M tokens](https://modelslab.com/models/open_router/qwen-qwen3-max-thinking)

[#### open\_router/Qwen: Qwen3 VL 32B Instruct

qwen-qwen3-vl-32b-instruct

From $0.26/M tokens](https://modelslab.com/models/open_router/qwen-qwen3-vl-32b-instruct)

[#### open\_router/Qwen: Qwen3 VL 8B Thinking

qwen-qwen3-vl-8b-thinking

From $0.74/M tokens](https://modelslab.com/models/open_router/qwen-qwen3-vl-8b-thinking)

[#### open\_router/MiniMax: MiniMax-01

minimax-minimax-01

From $0.65/M tokens](https://modelslab.com/models/open_router/minimax-minimax-01)

[#### open\_router/Qwen: Qwen3 14B

qwen-qwen3-14b

From $0.17/M tokens](https://modelslab.com/models/open_router/qwen-qwen3-14b)

[#### google\_deepmind/Gemma 3N E4B Instruct

google-gemma-3n-E4B-it

From $0.09/M tokens](https://modelslab.com/models/google_deepmind/google-gemma-3n-E4B-it)

[#### open\_router/Z.ai: GLM 4.6V

z-ai-glm-4.6v

From $0.60/M tokens](https://modelslab.com/models/open_router/z-ai-glm-4.6v)

[#### open\_router/DeepSeek: DeepSeek V3.2 Exp

deepseek-deepseek-v3.2-exp

From $0.34/M tokens](https://modelslab.com/models/open_router/deepseek-deepseek-v3.2-exp)

[#### open\_router/Qwen: Qwen2.5 7B Instruct

qwen-qwen-2.5-7b-instruct

From $0.07/M tokens](https://modelslab.com/models/open_router/qwen-qwen-2.5-7b-instruct)

[#### arcee\_ai/Arcee AI Spotlight

arcee\_ai-arcee-spotlight

From $0.22/M tokens](https://modelslab.com/models/arcee_ai/arcee_ai-arcee-spotlight)

[#### open\_router/Nous: Hermes 3 405B Instruct

nousresearch-hermes-3-llama-3.1-405b

From $1.00/M tokens](https://modelslab.com/models/open_router/nousresearch-hermes-3-llama-3.1-405b)

[#### scb10x/Typhoon 2 70B Instruct

scb10x-scb10x-llama3-1-typhoon2-70b-instruct

From $1.06/M tokens](https://modelslab.com/models/scb10x/scb10x-scb10x-llama3-1-typhoon2-70b-instruct)

[#### open\_router/Qwen: Qwen3.5-Flash

qwen-qwen3.5-flash-02-23

From $0.16/M tokens](https://modelslab.com/models/open_router/qwen-qwen3.5-flash-02-23)

[#### open\_router/AI21: Jamba Large 1.7

ai21-jamba-large-1.7

From $5.00/M tokens](https://modelslab.com/models/open_router/ai21-jamba-large-1.7)

[#### open\_router/Amazon: Nova Lite 1.0

amazon-nova-lite-v1

From $0.15/M tokens](https://modelslab.com/models/open_router/amazon-nova-lite-v1)

[#### together\_ai/GLM 5.1 FP4

zai-org-GLM-5.1

From $2.90/M tokens](https://modelslab.com/models/together_ai/zai-org-GLM-5.1)

[#### together\_ai/Qwen3 235B A22B Instruct 2507 FP8 Throughput

Qwen-Qwen3-235B-A22B-Instruct-2507-tput

From $0.40/M tokens](https://modelslab.com/models/together_ai/Qwen-Qwen3-235B-A22B-Instruct-2507-tput)

[#### together\_ai/EssentialAI Rnj-1 Instruct

essentialai-rnj-1-instruct

From $0.15/M tokens](https://modelslab.com/models/together_ai/essentialai-rnj-1-instruct)

Open Source Alternatives
---

Explore open-source models that offer similar capabilities with full transparency and flexibility

 [View all open source models](https://modelslab.com/models?feature=llm&provider=open-source-models)

[MU

Popular](https://modelslab.com/models/modelslab/uncensored-chat)[ModelsLab](https://modelslab.com/models/modelslab)

 [Modelslab: Uncensored Chat

Open Source Model](https://modelslab.com/models/modelslab/uncensored-chat)

About Z.Ai: GLM 5.2
---

GLM 5.2 is a large-scale reasoning model from Z.ai. It supports text input and output with a 1M-token context window, and is suited for long-horizon agent workflows, project-level software engineering,...

### Technical Specifications

Model IDz-ai-glm-5.2

CategoryLLM Models

TaskText Generation

Price$2.65 per million tokens

AddedJune 16, 2026

### Key Features

- Chat completion and multi-turn conversation API
- Streaming response with token-by-token output
- Function calling and tool use support
- System prompts and role-based messaging
- JSON mode and structured output

### Quick Start

Integrate Z.Ai: GLM 5.2 into your application with a single API call. Get your API key from the [pricing page](https://modelslab.com/pricing) to get started.

PythonJavaScriptcURLPHP

```
<code>import requests
import json

url = "https://modelslab.com/api/v7/llm/chat/completions"

headers = {
    "Content-Type": "application/json"
}

data = {
        "model_id": "z-ai-glm-5.2",
        "messages": [
            {
                "role": "user",
                "content": "Hello!"
            }
        ],
        "max_tokens": 1000,
        "key": "YOUR_API_KEY"
    }

try:
    response = requests.post(url, headers=headers, json=data)
    response.raise_for_status()  # Raises an HTTPError for bad responses (4XX or 5XX)
    result = response.json()
    print("API Response:")
    print(json.dumps(result, indent=2))
except requests.exceptions.HTTPError as http_err:
    print(f"HTTP error occurred: {http_err} - {response.text}")
except Exception as err:
    print(f"Other error occurred: {err}")</code>
```

### Pricing

Z.Ai: GLM 5.2 API costs $2.650000 per million tokens. Pay only for what you use with no minimum commitments. [View pricing plans](https://modelslab.com/pricing)

### Use Cases

- AI chatbots and virtual assistants
- Code generation and developer tools
- Content writing and copywriting automation
- Data analysis, summarization, and extraction

[Browse LLM Models](https://modelslab.com/models?feature=llmaster) [More from Z Ai](https://modelslab.com/models/open_router) [View Pricing](https://modelslab.com/pricing)

Z.Ai: GLM 5.2 FAQ
---

### What is Z.Ai: GLM 5.2?

GLM 5.2 is a large-scale reasoning model from Z.ai. It supports text input and output with a 1M-token context window, and is suited for long-horizon agent workflows, project-level software engineering,...

### How do I use the Z.Ai: GLM 5.2 API?

You can integrate Z.Ai: GLM 5.2 into your application with a single API call. Sign up on ModelsLab to get your API key, then use the model ID "z-ai-glm-5.2" in your API requests. We provide SDKs for Python, JavaScript, and cURL examples in the API documentation.

### How much does Z.Ai: GLM 5.2 cost?

Z.Ai: GLM 5.2 costs $2.650000 per million tokens. ModelsLab uses pay-per-use pricing with no minimum commitments. A free tier is available to get started.

### What is the Z.Ai: GLM 5.2 model ID?

The model ID for Z.Ai: GLM 5.2 is "z-ai-glm-5.2". Use this ID in your API requests to specify this model.

### Does Z.Ai: GLM 5.2 have a free tier?

Yes, ModelsLab offers a free tier that lets you try Z.Ai: GLM 5.2 and other AI models. Sign up to get free API credits and start building immediately.

---

*This markdown version is optimized for AI agents and LLMs.*

**Links:**
- [Website](https://modelslab.com)
- [API Documentation](https://docs.modelslab.com)
- [Blog](https://modelslab.com/blog)

---
*Generated by ModelsLab - 2026-06-20*