---
title: "GLM 5.3"
description: "Open-weights text model from Z.ai with a 1M context window. Above the registry median on intelligence and strong on coding benchmarks, though priced above the median."
canonical: https://pydantic.dev/models/list/glm-5.3/
---

# GLM 5.3

> Open-weights text model from Z.ai with a 1M context window. Above the registry median on intelligence and strong on coding benchmarks, though priced above the median.
>
> Markdown copy of https://pydantic.dev/models/list/glm-5.3/. Index for agents: https://pydantic.dev/models/llms.txt

**Agents: use the API for model information.** It answers a question in one request, where the pages need several.

- Choose a model for an agent: `POST https://pydantic.dev/models/api/select` with a JSON body such as `{"description": "what the agent does"}`. It returns up to five ranked models with reasons. Format: https://pydantic.dev/models/select.md
- Search models by name: `GET https://pydantic.dev/models/api/search?query=<text>`
- List, filter and sort models: `GET https://pydantic.dev/models/api/models`, for example `?weights=open&max_price=2&sort=efficiency`
- One model in full: `GET https://pydantic.dev/models/api/models/<slug>`
- Any other question about the models: `GET https://pydantic.dev/models/api/ask?query=<question>`

Add `intent=<intent>&stack=<stack>&harness=<harness>` to the query string of all but the single model. An `OPTIONS` request to any endpoint returns its schema. The same five are tools of the MCP server at `https://pydantic.dev/models/mcp`. More: https://pydantic.dev/models/usage.md

Use it with Pydantic AI as `gateway/doubleword:zai-org/GLM-5.3`.

## Spec sheet

- **Family:** Z.ai
- **Released:** 14 Aug 2026
- **Weights:** open
- **Context window:** 1,000,000 tokens
- **Largest response:** 131,072 tokens
- **Accepts:** text
- **Tool calling:** yes
- **Knowledge cutoff:** unknown
- **Intelligence index:** 65.2 (rank 28)
- **Scores updated:** 2026-11-30
- **Price:** $1.4 input, $4.4 output, $2.15 blended per 1M tokens
- **Index points per $:** 30.3 (rank 55)
- **Speed:** 86.5 tokens/sec (rank 55)
- **Popularity:** rank 7 of 194 by usage
- **Pydantic AI Gateway:** built in

## Benchmarks

### Pydantic AI benchmarks

Our own benchmarks, each about 10 tasks run once with tool calling and once in code mode (https://pydantic.dev/models/codemode.md). Not part of the intelligence index. Cost is the mean cost of one task. For the combined score, code mode is compared over the four benchmarks run in both modes.

| Benchmark                                                                                      | Tool calling | Code mode | Change | Cost per task | Cost per task, code mode | Rank     | Runs                                                          |
| ---------------------------------------------------------------------------------------------- | ------------ | --------- | ------ | ------------- | ------------------------ | -------- | ------------------------------------------------------------- |
| [Pydantic AI Combined](https://pydantic.dev/models/benchmarks/pydantic_ai.md)                  | 56.5%        | 75.9%     | +16.2  | $0.65         | $1.10                    | 35 of 44 | https://pydantic.dev/models/list/glm-5.3/pydantic_ai.md       |
| [Pydantic AI - Billing ops](https://pydantic.dev/models/benchmarks/billing_ops.md)             | 80%          | 100%      | +20    | $1.12         | $0.093                   | 18 of 44 | https://pydantic.dev/models/list/glm-5.3/billing_ops.md       |
| [Pydantic AI - Customer support](https://pydantic.dev/models/benchmarks/customer_support.md)   | 40%          | 50%       | +10    | $0.066        | $0.097                   | 22 of 44 | https://pydantic.dev/models/list/glm-5.3/customer_support.md  |
| [Pydantic AI - SQL data analysis](https://pydantic.dev/models/benchmarks/sql_data_analysis.md) | 50%          | 70%       | +20    | $1.29         | $1.42                    | 25 of 44 | https://pydantic.dev/models/list/glm-5.3/sql_data_analysis.md |
| [Pydantic AI - Research & deck](https://pydantic.dev/models/benchmarks/research_deck.md)       | 68.9%        | 83.7%     | +14.8  | $1.29         | $2.78                    | 30 of 44 | https://pydantic.dev/models/list/glm-5.3/research_deck.md     |
| [Pydantic AI - Structured output](https://pydantic.dev/models/benchmarks/structured_output.md) | 50%          | –         | –      | $0.080        | –                        | 39 of 44 | https://pydantic.dev/models/list/glm-5.3/structured_output.md |
| [Pydantic AI - LLM Judge](https://pydantic.dev/models/benchmarks/llm_judge.md)                 | 50%          | –         | –      | $0.031        | –                        | 32 of 44 | https://pydantic.dev/models/list/glm-5.3/llm_judge.md         |
| [Pydantic AI - Cyber Willing](https://pydantic.dev/models/benchmarks/cyber_willing.md)         | 91.7%        | –         | –      | $0.085        | –                        | 11 of 32 | https://pydantic.dev/models/list/glm-5.3/cyber_willing.md     |

### Other benchmarks


| Benchmark                | Score  | Rank among models tested | What it measures                                                                                 | Source                                    |
| ------------------------ | ------ | ------------------------ | ------------------------------------------------------------------------------------------------ | ----------------------------------------- |
| Intelligence index       | 65.2   | 28                       | Our composite of the benchmarks below, 0-100                                                     | Pydantic, from the sources credited below |
| GPQA Diamond             | 90.9%  | 32                       | Graduate-level science questions, multiple choice                                                | Epoch AI (CC BY 4.0)                      |
| OTIS Mock AIME           | 91.1%  | 53                       | Competition mathematics problems with exact answers                                              | Epoch AI (CC BY 4.0)                      |
| FrontierMath             | 68.8%  | 33                       | Original research-level mathematics problems, tiers 1 to 3                                       | Epoch AI (CC BY 4.0)                      |
| SimpleQA Verified        | 41%    | 46                       | Short factual questions answered from memory, without search                                     | Epoch AI (CC BY 4.0)                      |
| SciCode                  | 59%    | 13                       | Scientific programming problems written by researchers                                           | SciCode, via Epoch AI (CC BY 4.0)         |
| APEX-Agents              | 56.6%  | 24                       | Long professional tasks (banking, consulting, law) passed on the first attempt                   | Mercor, via Epoch AI (CC BY 4.0)          |
| LMArena text             | 1474.6 | 24                       | Rating from blind human votes between pairs of chat responses                                    | LMArena (CC BY 4.0)                       |
| FrontierMath Tier 4      | 29.3%  | 36                       | Research-level mathematics problems, the hardest tier, with checkable answers                    | Epoch AI (CC BY 4.0)                      |
| Chess Puzzles            | 37%    | 42                       | Find the single best move in a chess position                                                    | Epoch AI (CC BY 4.0)                      |
| Mystery Game Puzzles     | 33%    | 29                       | Best-move puzzles in an undisclosed well-known game                                              | Epoch AI (CC BY 4.0)                      |
| SimpleBench              | 66.2%  | 30                       | Six-option trick questions that test common sense                                                | SimpleBench, via Epoch AI (CC BY 4.0)     |
| ALE-Bench                | 1317.4 | 36                       | Hard optimisation contest problems, as a rating against human contestants                        | Sakana AI, via Epoch AI (CC BY 4.0)       |
| Epoch Capabilities Index | 157    | 34                       | Epoch AI's own composite across about 40 benchmarks; shown for comparison, not part of our index | Epoch AI (CC BY 4.0)                      |

## Providers and prices

US dollars per million tokens.

| Provider              | Gateway  | Pydantic AI string                   | Input | Cached input | Output |
| --------------------- | -------- | ------------------------------------ | ----- | ------------ | ------ |
| Z.ai                  | BYOK     | `zai:GLM-5.3`                        | $1.4  | $0.26        | $4.4   |
| Doubleword            | built in | `gateway/doubleword:zai-org/GLM-5.3` | $1.4  | $0.28        | $4.4   |
| AWS Bedrock           | built in | `gateway/bedrock:global.zai.glm-5.3` | $1.68 | $0.31        | $5.28  |
| Zhipu AI              | BYOK     | –                                    | $1.1  | $0.28        | $3.86  |
| Baseten               | BYOK     | –                                    | $1.4  | $0.14        | $4.4   |
| Cloudflare Workers AI | BYOK     | –                                    | $1.4  | $0.26        | $4.4   |
| Novita                | BYOK     | –                                    | $1.4  | $0.26        | $4.4   |
| OpenRouter            | BYOK     | `openrouter:z-ai/glm-5.3`            | $1.4  | $0.26        | $4.4   |
| Perplexity            | BYOK     | –                                    | $1.4  | $0.26        | $4.4   |
| Together AI           | BYOK     | `together:zai-org/GLM-5.3`           | $1.4  | $0.26        | $4.4   |

## Use GLM 5.3 with Pydantic AI

### hello.py

Ask GLM 5.3 a question with a Pydantic AI agent and print the answer. Run it with uv run hello.py.

```python
# /// script
# dependencies = ["pydantic-ai"]
# ///
import os

from pydantic_ai import Agent

os.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'

agent = Agent('gateway/doubleword:zai-org/GLM-5.3', instructions='Be concise, reply with one sentence.')

result = agent.run_sync('Where does "hello world" come from?')
print(result.output)
```

### structured_output.py

Get validated, typed output from GLM 5.3 by giving the agent a Pydantic model. Run it with uv run structured_output.py.

```python
# /// script
# dependencies = ["pydantic-ai"]
# ///
import os

from pydantic import BaseModel
from pydantic_ai import Agent

os.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'


class CityLocation(BaseModel):
    city: str
    country: str


agent = Agent('gateway/doubleword:zai-org/GLM-5.3', output_type=CityLocation)

result = agent.run_sync('Where were the olympics held in 2012?')
print(result.output)
#> city='London' country='United Kingdom'
```

### tools.py

Give GLM 5.3 two tools to call, one of which reads the agent's dependencies. Run it with uv run tools.py.

```python
# /// script
# dependencies = ["pydantic-ai"]
# ///
import os
import random

from pydantic_ai import Agent, RunContext

os.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'

agent = Agent(
    'gateway/doubleword:zai-org/GLM-5.3',
    deps_type=str,
    instructions="You're a dice game, roll the die and see if it matches the user's guess.",
)


@agent.tool_plain
def roll_dice() -> str:
    """Roll a six-sided die and return the result."""
    return str(random.randint(1, 6))


@agent.tool
def get_player_name(ctx: RunContext[str]) -> str:
    """Get the player's name."""
    return ctx.deps


result = agent.run_sync('My guess is 4', deps='Anne')
print(result.output)
```

### streaming.py

Stream GLM 5.3's reply to the terminal as it is generated. Run it with uv run streaming.py.

```python
# /// script
# dependencies = ["pydantic-ai"]
# ///
import asyncio
import os

from pydantic_ai import Agent

os.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'

agent = Agent('gateway/doubleword:zai-org/GLM-5.3')


async def main():
    async with agent.run_stream('Explain prompt caching in three bullet points.') as response:
        async for text in response.stream_text(delta=True):
            print(text, end='', flush=True)


asyncio.run(main())
```

### pax.sh

Code with GLM 5.3 in your terminal using Pax, the Pydantic AI coding agent. On macOS, open a new terminal after installing, so pax isn't the system's archiver.

```sh
# uv tool install pydantic-ai-pax
export PYDANTIC_AI_GATEWAY_API_KEY='...'

pax -m 'gateway/doubleword:zai-org/GLM-5.3'
```

### codex.sh

Run OpenAI's Codex CLI on GLM 5.3 through Pydantic AI Gateway.

```sh
# npm install -g @openai/codex
export PYDANTIC_AI_GATEWAY_API_KEY='...'

codex --model 'zai-org/GLM-5.3' \
  -c model_provider='gateway' \
  -c model_providers.gateway.name='Pydantic AI Gateway' \
  -c model_providers.gateway.base_url='https://gateway.pydantic.dev/proxy/doubleword/v1' \
  -c model_providers.gateway.env_key='PYDANTIC_AI_GATEWAY_API_KEY'
```

### ai_sdk.ts

Call GLM 5.3 from TypeScript with the Vercel AI SDK, through Pydantic AI Gateway.

```ts
// npm install ai @ai-sdk/openai-compatible
import { createOpenAICompatible } from '@ai-sdk/openai-compatible'
import { generateText } from 'ai'

process.env.PYDANTIC_AI_GATEWAY_API_KEY = '...'

const doubleword = createOpenAICompatible({
  baseURL: 'https://gateway.pydantic.dev/proxy/doubleword',
  apiKey: process.env.PYDANTIC_AI_GATEWAY_API_KEY,
})

const { text } = await generateText({
  model: doubleword('zai-org/GLM-5.3'),
  system: 'Be concise, reply with one sentence.',
  prompt: 'Where does "hello world" come from?',
})
console.log(text)
```

## About GLM 5.3

GLM 5.3 costs $1.4 per million input tokens and $4.4 per million output tokens, has a 1M token context window and scores 65.2 on our intelligence index, #28 of 101.

GLM 5.3 is an open-weights text model from Z.ai, released in August 2026. Its intelligence index of 67.5 sits above the registry median of 59.5, ranking 33rd of 114. Its strongest results are on SciCode, where it ranks 13th of 96, and WebDev Arena, where it ranks 17th of 85. Math results are mixed: FrontierMath is above the median, but OTIS Mock AIME is below it.

Pricing is the main drawback. At a blended $2.15 per million tokens it costs about twice the registry median and ranks 128th of 194 on price. Its efficiency rank of 63rd of 194 reflects that trade-off. Factual recall on SimpleQA Verified is also below the median.

The model accepts text input only and supports tool calling, reasoning mode and structured output. It is served by ten providers, and its 1M context and 131k output limit suit long agent sessions.

**Strengths**

- SciCode 59.0%, 13th of 96, well above the 50.2% median
- WebDev Arena rating 1614.5, 17th of 85, above the median
- Intelligence index 67.5, 33rd of 114, above the median
- Served by ten providers, including Z.ai and AWS Bedrock

**Weaknesses**

- Blended price $2.15 per million tokens, about twice the median
- OTIS Mock AIME 91.1%, 56th of 95, below the 94.2% median
- SimpleQA Verified 41.0%, 48th of 76, below the median

**Best for:** Coding and agent work where open weights and a large context window matter more than per-token price.

## How it did on the Pydantic AI benchmarks

Written by an LLM from reviews of every run.

#### Overall
Across five benchmarks the model scored between 50% and 100%, and code mode scored higher wherever both modes were run (Billing ops 100% vs 80%, Research & deck 84% vs 69%, SQL data analysis 70% vs 50%). Its arithmetic and handling of domain rules were usually correct. Its main failure was losing or dropping content at the point of action: truncated or missing tool arguments, overriding its own correct objections, and running out of requests on long tasks. It cannot take image input, so image-dependent tasks ran blind.

#### Strengths
- In Billing ops it read existing allocations before writing and passed all 4 write tasks, catching a same-day part-payment that its first plan would have misallocated.
- In Structured output it read £000 scaling, bracket signs, tax credits and group/parent splits correctly in every reviewed conversation, and re-added subtotals before answering.
- In SQL data analysis it handled past-midnight service days, `+k` repeat names and distance-based interpolation correctly, and verified legs against raw calls.
- In LLM Judge every key-point verdict quoted specific evidence such as invoice numbers, amounts and dates, and every run returned a valid `final_result` in one request.
- In Research & deck both runs reconciled database figures such as restated revenue and TTM growth by query or script, and both final notes stated what could not be verified.

#### Weaknesses
- In Structured output all 5 failures were final `accounts` calls that left out balance-sheet or staff-cost fields the model had just listed in its own text, and no run tried to recover.
- In LLM Judge all 5 failures were cases where it raised the correct objection and then answered yes anyway, most often on `no_contradiction` checks.
- In Billing ops tool-calling mode, paginated calls were recorded without their filters and repeated up to eight times, and it missed anomalies that were present in bulk results it had read.
- In SQL data analysis it ran out of requests in 3 cases and failed both multi-stop tour cases in both modes.
- In Research & deck tools mode it stated terms from a contract it never read, and it reasoned about the grader instead of the material in several Structured output and LLM Judge runs.

#### Tool calling compared with code mode
- In Billing ops code mode passed every large audit and cost $0.93 against $11.23, because records stayed in sandbox variables instead of being read in context, and the dropped-argument problem did not appear.
- In SQL data analysis code mode read the full DATA.md with `pathlib`, which turned three tool-mode failures caused by truncated transfer rules into passes, but costs were similar or higher and it lost one case it passed in tool mode.
- In Research & deck only code mode passed: it wrote a pure-Python JPEG decoder to inspect photos, at 2.4 times the requests and 2.2 times the cost, despite sandbox friction such as missing `struct` and time-outs.
- In Billing ops tool calling was slightly leaner on small tasks (2 to 6 requests against 3 to 11), while Structured output and LLM Judge ran tool calling only, so they offer no comparison.

Prices come from [genai-prices](https://github.com/pydantic/genai-prices), in US dollars per million tokens. Benchmark scores come from Epoch AI and LMArena (CC BY 4.0), Browser Use, and our own Pydantic AI benchmarks (CC BY 4.0); the index and its sources are described at https://pydantic.dev/models/methodology.md. Data built 2026-11-30. This model from the API: `https://pydantic.dev/models/api/models/glm-5.3`. Compare it with others: `https://pydantic.dev/models/api/models?slug=glm-5.3,<other slug>`
