---
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-frontend-v2-927501783998.us-east4.run.app/models/z-ai/z-ai-glm-5.2.md
canonical: https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/z-ai/z-ai-glm-5.2.md
type: product
component: Playground/LLM/Index
generated_at: 2026-06-29T23:03:50.637614Z
---

Z.ai: GLM 5.2
---

 [LLMs.txt](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/z-ai-glm-5.2/llms.txt) [.md](https://modelslab-frontend-v2-927501783998.us-east4.run.app/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 $0.94 / 1M tokens

Output $3.00 / 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-frontend-v2-927501783998.us-east4.run.app/models?feature=llmaster)

[#### open\_router/Qwen: Qwen3 235B A22B Thinking 2507

qwen-qwen3-235b-a22b-thinking-2507

From $0.10/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/qwen-qwen3-235b-a22b-thinking-2507)

[#### open\_router/OpenAI: GPT-4 Turbo

openai-gpt-4-turbo

From $20.00/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/openai-gpt-4-turbo)

[#### open\_router/Meta: Llama 3.3 70B Instruct

meta-llama-llama-3.3-70b-instruct

From $0.21/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/meta-llama-llama-3.3-70b-instruct)

[#### open\_router/Mistral: Ministral 3 8B 2512

mistralai-ministral-8b-2512

From $0.15/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/mistralai-ministral-8b-2512)

[#### alibaba\_cloud/Qwen: Qwen3.5 397B A17B

qwen-qwen3.5-397b-a17b

From $2.10/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/alibaba_cloud/qwen-qwen3.5-397b-a17b)

[#### open\_router/Anthropic: Claude Opus 4.5

anthropic-claude-opus-4.5

From $15.00/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/anthropic-claude-opus-4.5)

[#### google/Gemini 2.5 Pro

gemini-2.5-pro

From $5.63/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/google/gemini-2.5-pro)

[#### open\_router/Qwen: Qwen Plus 0728

qwen-qwen-plus-2025-07-28

From $0.52/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/qwen-qwen-plus-2025-07-28)

[#### open\_router/MiniMax: MiniMax M2.1

minimax-minimax-m2.1

From $0.62/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/minimax-minimax-m2.1)

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

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

From $1.00/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/nousresearch-hermes-3-llama-3.1-405b)

[#### open\_router/MoonshotAI: Kimi K2.5

moonshotai-kimi-k2.5

From $1.20/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/moonshotai-kimi-k2.5)

[#### open\_router/Poolside: Laguna XS.2 (free)

poolside-laguna-xs.2-free

Free](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/poolside-laguna-xs.2-free)

[#### open\_router/Qwen: Qwen3.5-122B-A10B

qwen-qwen3.5-122b-a10b

From $1.17/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/qwen-qwen3.5-122b-a10b)

[#### open\_router/Anthropic: Claude Opus 4.7

anthropic-claude-opus-4.7

From $15.00/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/anthropic-claude-opus-4.7)

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

minimax-minimax-01

From $0.65/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/minimax-minimax-01)

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

deepseek-deepseek-v3.2

From $0.29/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/deepseek-deepseek-v3.2)

[#### qwen/Qwen2-VL (72B) Instruct

Qwen-Qwen2-VL-72B-Instruct

From $1.20/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/qwen/Qwen-Qwen2-VL-72B-Instruct)

[#### open\_router/Qwen: Qwen3.6 35B A3B

qwen-qwen3.6-35b-a3b

From $0.57/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/qwen-qwen3.6-35b-a3b)

Open Source Alternatives
---

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

 [View all open source models](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models?feature=llm&provider=open-source-models)

[MU

Popular](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/modelslab/uncensored-chat)[ModelsLab](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/modelslab)

 [Modelslab: Uncensored Chat

Open Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/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$1.97 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-frontend-v2-927501783998.us-east4.run.app/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 $1.970000 per million tokens. Pay only for what you use with no minimum commitments. [View pricing plans](https://modelslab-frontend-v2-927501783998.us-east4.run.app/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-frontend-v2-927501783998.us-east4.run.app/models?feature=llmaster) [More from Z Ai](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router) [View Pricing](https://modelslab-frontend-v2-927501783998.us-east4.run.app/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 $1.970000 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-30*