Skip to content
Z.AIChat

GLM-4

glm-4

GLM-4V-9B is the open-source multimodal model in Zhipu AI’s GLM-4 series. It supports high-resolution (1120×1120) bilingual Chinese–English dialogue across multiple turns, and performs strongly in perception, reasoning, OCR, and chart understanding. Across many multimodal benchmarks, it outperforms models such as GPT-4-turbo-2024-04-09, Gemini 1.0 Pro, Qwen-VL-Max, and Claude 3 Opus.

Context
128K tokens
Endpoint
Get API KeyCompare

Pricing

Input$0.21 / 1M
Output$0.21 / 1M
Cache Write (5m)$0.21 / 1M
Cache Write (1h)$0.21 / 1M
Cache Read$0.21 / 1M
Web Search$0 / 1M

Quick Start

Select an endpoint and copy a working example for this model.

Endpoint
python
from openai import OpenAI client = OpenAI(    api_key="YOUR_API_KEY",    base_url="https://api.apertis.ai/v1") response = client.chat.completions.create(    model="glm-4",    messages=[        {"role": "user", "content": "Hello!"}    ],    max_tokens=1024,    temperature=0.7) print(response.choices[0].message.content) # Optional: Enable context compression to reduce token usage# response = client.chat.completions.create(#     model="glm-4",#     messages=[{"role": "user", "content": "Hello!"}],#     extra_body={"compression": {"enabled": True, "model": "gpt-4.1-mini"}}# )

Supported Parameters

API docs
Common7 params
modelmessagesmax_tokenstemperaturetop_pstreamtools
Extended4 params
reasoning_effortstream_optionsthinkingextra_body

Cursor IDE Model IDs

Use these namespaced identifiers in Cursor IDE to avoid conflicts with built-in models.

glm-4

Compare with Other Models

See how this model compares to others from the same provider.

GLM 5.3 Flash

GLM-5.3-Flash is Z.AI's efficient native multimodal model, designed for coding and long-horizon agentic workflows. It combines strong multimodal capabilities with an architecture optimized for responsive, cost-efficient task execution. Built on a hybrid sparse and linear attention architecture, GLM-5.3-Flash maintains accurate long-context behavior while reducing computational overhead, making it well suited for coding agents, extended multi-step tasks, and scalable production workloads.

Context
1M
Input
$0.075/M
Output
$0.25/M

GLM 5.3

GLM-5.3 is Z.ai's large-scale reasoning model designed for complex software engineering and long-horizon agentic workflows. It supports text input and output with a 1M-token context window, enabling sustained reasoning across large codebases and extended multi-step tasks. Building on GLM-5.2, it delivers stronger coding performance while improving the balance between capability and token efficiency, making it well suited for autonomous coding agents, large-scale engineering workflows, and complex task execution.

Context
1M
Input
$1.40/M
Output
$4.40/M

GLM-4.7 (Thinking)

GLM-4.7 is Z.AI's newest flagship model, upgraded for stronger programming performance and more reliable multi-step reasoning. It handles complex agent tasks better while offering smoother conversations and improved UI/experience quality.

Context
202.8K
Input
$0.30/M
Output
$0.50/M

GLM 4.6 (Thinking)

GLM-4.6 improves on GLM-4.5 with a larger 200K context window, stronger coding performance (including better real-world agent tools like Claude Code and Cline), and clearer gains in reasoning with built-in tool use. It delivers more capable agent behavior, integrates better into agent frameworks, and produces more natural, readable writing — especially in role-playing scenarios.

Context
202.8K
Input
$0.40/M
Output
$1.50/M