# GLM 4.5

Z.AI's full-scale GLM-4.5 model unifying reasoning, coding, and agentic capabilities with configurable thinking in a context window of 128K tokens.

- **Model ID:** `zai/glm-4.5`
- **Type:** chat
- **Providers:** zai
- **Context window:** 128,000
- **Maximum output tokens:** 96,000
- **Pricing:** $0.6/1M input tokens, $2.2/1M output tokens
- **Canonical page:** https://vercel.com/ai-gateway/models/glm-4.5

## Supported parameters

Detailed capability metadata has not been reported for this model.

## Example

```ts
import { streamText } from 'ai'

const result = streamText({
  model: 'zai/glm-4.5',
  prompt: 'Why is the sky blue?'
})
```

## About

GLM 4.5 was released July 28, 2025 as Z.AI's full-scale large language model designed to unify reasoning, coding, and agentic capabilities. It represents the full-scale offering in the GLM-4.5 generation, targeting workloads where broad competence across analytical and generative tasks matters more than narrow specialization.

The model supports configurable thinking, letting you enable or disable chain-of-thought reasoning depending on the task. This flexibility is useful in agentic pipelines where some steps benefit from deliberation and others need fast, direct responses. GLM 4.5 operates within a context window of 128K tokens, handling long documents, extended conversations, and multi-file code analysis in a single pass.

Z.AI positions GLM 4.5 alongside other widely used closed-source models. For teams evaluating alternatives across providers, it offers a distinct cost-performance point. Through AI Gateway, you access GLM 4.5 with a unified API, automatic retries, and provider routing without managing separate accounts.

## What to consider

GLM 4.5 supports a context window of 128K tokens and up to 96K tokens per request. For reasoning-heavy tasks with thinking enabled, budget extra output tokens for chain-of-thought traces that precede the final answer.

Test both thinking-enabled and thinking-disabled modes. Thinking mode improves accuracy on complex reasoning but increases latency and token usage. Disable it for straightforward generation tasks.

When using AI Gateway, configure fallback providers to maintain availability. GLM 4.5 is available through Z.AI.

## When to use

### Best For

- **General-purpose reasoning and coding** where unified capability across math, logic, and code generation reduces the need for task-specific models
- **Agentic workflows** that require multi-step planning, tool use, and configurable thinking within a single model
- **Long-document analysis** leveraging the context window of 128K tokens for contracts, research papers, or large codebases
- **Production deployments** where built-in observability and automatic retries through AI Gateway reduce operational overhead
- **Cost-conscious teams** comparing listed rates ($0.6 input, $2.2 output per million tokens)

### Consider Alternatives When

- You need a lightweight, lower-cost option for high-volume simple tasks. GLM-4.5-Air offers reduced latency and cost for less demanding workloads
- Vision or multimodal input is required. GLM-4.5V adds image understanding on top of the GLM-4.5 foundation
- Your workload is primarily code generation. GLM-4.6 and later models include targeted coding improvements
- You want more reasoning depth and planning than GLM-4.5 offers. GLM-5 introduces multiple thinking modes and improved long-range planning

## Best for

- **General-purpose reasoning and coding:** Unified capability across math, logic, and code generation reduces the need for task-specific models
- **Agentic workflows:** Multi-step planning, tool use, and configurable thinking run within a single model
- **Long-document analysis:** The context window of 128K tokens fits contracts, research papers, or large codebases
- **Production deployments:** Built-in observability and automatic retries through AI Gateway reduce operational overhead
- **Cost-conscious teams:** Compare listed rates against alternative providers when evaluating total spend

## Consider alternatives

- **Lightweight high-volume alternative:** GLM-4.5-Air offers reduced latency and cost for less demanding workloads
- **Vision or multimodal input:** GLM-4.5V adds image understanding on top of the GLM-4.5 foundation
- **Code generation focus:** GLM-4.6 and later models include targeted coding improvements
- **Deeper reasoning and planning:** GLM-5 introduces multiple thinking modes and improved long-range planning

## Frequently asked questions

### What is the difference between GLM 4.5 and GLM-4.5-Air?

GLM 4.5 is the full-scale model optimized for maximum capability across reasoning, coding, and agentic tasks. GLM-4.5-Air is a lighter variant designed for lower latency and cost on less demanding workloads.

### Does GLM 4.5 support configurable thinking?

Yes. You can enable or disable chain-of-thought reasoning per request. Thinking mode improves accuracy on complex tasks but increases output length and latency.

### What is the context window for GLM 4.5?

128K tokens, supporting long documents, extended conversations, and multi-file code analysis in a single request.

### How much does GLM 4.5 cost through AI Gateway?

Pricing appears on this page and updates as providers adjust their rates. AI Gateway routes traffic through the configured provider.

### How do I authenticate with GLM 4.5 through AI Gateway?

AI Gateway provides a unified API key. You don't need a separate Z.AI account. Configure your API key in your environment, then use the model identifier to route requests. BYOK is also supported if you have a direct provider account.

### Can I use GLM 4.5 for agentic applications with tool use?

Yes. GLM 4.5 supports agentic workflows with multi-step planning and tool use. The configurable thinking mode lets you control reasoning depth per step in your pipeline.

### What providers serve GLM 4.5 through AI Gateway?

GLM 4.5 is available through Z.AI. AI Gateway handles intelligent routing and automatic retries across configured providers.

## Links

- [Model page](https://vercel.com/ai-gateway/models/glm-4.5)
- [AI Gateway documentation](https://vercel.com/docs/ai-gateway)
- [Provider model documentation](https://z.ai/blog/glm-4.5)
- [Provider pricing](https://docs.z.ai/guides/overview/pricing)
