Models

GLM 5.2 vs GPT-5-Codex

Compare GLM 5.2 from Z.AI and GPT-5-Codex from OpenAI on key metrics including benchmarks, price, context length, and other model features. Access both models and hundreds of others through the AIHubMix API.

Z.AIGLM 5.2OpenAIGPT-5-Codex
36% off
Z.AI logo
GLM 5.2
Z.AI · text → text

GLM-5.2 is Z.ai’s flagship model for the era of long-horizon tasks. With a truly usable 1M-token context window, it can handle project-level engineering context, execute long-running tasks more reliably, follow engineering standards more consistently, and complete the full development workflow from requirements to multi-platform deployment in a single task.

Input$1.1268$0.7212 /M
Output$3.9438$2.524 /M
Cache read$0.2817$0.1803 /M
OpenAI logo
GPT-5-Codex
OpenAI · text, image → text

GPT-5-Codex is a version of GPT-5 optimized for autonomous coding tasks in Codex or similar environments. It is only available in the Responses API, and the underlying model snapshots will be updated regularly. https://docs.aihubmix.com/en/api/Responses-API You can also use it in codex-cll; see https://docs.aihubmix.com/en/api/Codex-CLI for using codex-cll through Aihubmix.

Input$1.25 /M
Output$10 /M
Cache read$0.125 /M

Pricing & Specifications

Prices are per million tokens. Time to First Token and throughput are rolling averages measured on AIHubMix.

GLM 5.2
GPT-5-Codex
Input /M
$1.1268$0.721236%
$1.25
Output /M
$3.9438$2.52436%
$10
Cache read /M
$0.2817$0.180336%
$0.125
Context length
1,000,000
400,000
Max output
128,000
128,000
Time to First Token
0.6 s
6.2 s
Throughput
35.9 tok/s
64.3 tok/s
Modalities
text
textimage
Supported Parameters
thinkingtoolsfunction callingstructured outputs
thinkingtoolsfunction callingstructured outputs
API Formats
chat_completions · claude_api
Released
June 16, 2026
-

Promotional prices show the discounted rate; see each model page for promotion windows.

Activity Past 30 Days

Daily traffic served through AIHubMix — how demand for each model is trending.

glm-5.2gpt-5-codex

Tokens / day

-

Requests / day

-

Performance Past 3 Days

Measured on real AIHubMix traffic, hourly buckets. Gaps mean no traffic in that hour.

glm-5.2gpt-5-codex

Throughput (tok/s)

-

TTFT (s)

-

Uptime (%)

-

Cost calculator

Estimate your monthly bill for the same workload on each model.

GLM 5.2
$127$81.13 /mo
GPT-5-Codex
$225 /mo

Monthly = daily × 30. Discounted rates applied where a promotion is active.

FAQ

Which is cheaper: GLM 5.2, GPT-5-Codex?

GLM 5.2: $2.524/M output tokens; GPT-5-Codex: $10/M. Use the cost calculator above to estimate your own workload.

Which responds faster?

GLM 5.2: 0.6s time to first token measured on AIHubMix; see the live performance charts above for how each model behaves across the day.

How large is each context window?

GLM 5.2 accepts 1,000,000 and GPT-5-Codex accepts 400,000 input tokens. Maximum output per request is 128,000 tokens on GLM 5.2 and 128,000 tokens on GPT-5-Codex.

Which one generates tokens faster?

GPT-5-Codex at 64.3 tok/s and GLM 5.2 at 35.9 tok/s, measured as output throughput on AIHubMix — a separate metric from time to first token.

What inputs and capabilities does each model support?

GLM 5.2 accepts text input and supports thinking, tool calling, function calling and structured outputs; GPT-5-Codex accepts text and image input and supports thinking, tool calling, function calling and structured outputs.

Can I call GLM 5.2 and GPT-5-Codex with the same API key?

Yes. AIHubMix serves every model on this page behind one OpenAI-compatible endpoint, so switching between them is a one-line change to the model field — no second account, key or SDK.

Popular comparisons

Related model match-ups readers also look at.