Z.ai
Z.ai's flagship for the hard engineering work — reasoning kept across every turn and tool call.
200K tokens
Context
32,768 tokens
Max output
Balanced
Speed
Three prompts, three unedited answers, generated on September 2, 2026 through NinjaChat. Click the prompt to copy it and run it yourself.
Write a Python function that merges overlapping intervals, plus three short tests. Keep the whole answer under 40 lines of code.
def merge_intervals(intervals):
if not intervals:
return []
intervals.sort(key=lambda x: x[0])
merged = [intervals[0]]
for start, end in intervals[1:]:
last_end = merged[-1][1]
if start <= last_end:
merged[-1][1] = max(last_end, end)
else:
merged.append([start, end])
return merged
# Three short tests
assert merge_intervals([[1,3],[2,6],[8,10],[15,18]]) == [[1,6],[8,10],[15,18]]
assert merge_intervals([[1,4],[4,5]]) == [[1,5]]
assert merge_intervals([[1,2],[3,4]]) == [[1,2],[3,4]]
print("All tests passed")
Read: We ran the same 3 prompts on 12 AI models — Unedited answers, latency and price for every model, measured through the NinjaChat API in September 2026.
Served by Fireworks as glm-5.2. Answers vary run to run; these are one take each, not the best of several.
Architecture reviews and migration plans with edge cases.
Reasoning before every tool call, kept across the whole job.
Multi-file changes that stay consistent from start to finish.
Clean JSON and tables when the answer feeds a pipeline.
Tuned to this model — click any line to copy.
GLM 5.2 is Z.ai's flagship in the GLM 5 line, released in June 2026, and the model the lab points at serious software engineering: large refactors, tool-heavy agent loops, and the systems-design questions where a long, consistent chain of reasoning matters more than a quick reply. On NinjaChat it is included in every plan, next to Claude, GPT-5.6 and Gemini.
The GLM family's signature carries through: the model reasons before each response and each tool call, keeps that reasoning across turns so a long session stays coherent, and lets you dial the depth per turn. In 5.2 that machinery sits on a stronger base, so it holds up on the kind of multi-file, multi-step task that made earlier GLMs drift.
Where GLM 4.7 is the fast everyday coder, 5.2 is the one you escalate to: an architecture review, a migration plan with edge cases, a bug that spans services. It handles about 200K tokens of context on NinjaChat's rail, enough for a sizeable codebase in one thread, and it returns structured output cleanly when you ask for JSON.
If you have been looking for the current GLM to chat with, this is the top of the line here, with 4.7 a click away when you want speed instead.
From zero to your first result in under a minute.
01
Create a NinjaChat account and choose a plan
02
Open chat and pick GLM 5.2 from the model list
03
Give it the whole problem: files, constraints, the goal
04
Keep the task in one thread; it carries its reasoning across turns
05
Drop to GLM 4.7 for quick iterations
Where it wins, and where it doesn't.
More depth on systems design and long reasoning
4.7 is faster and cheaper for everyday coding
The newer flagship with stronger agentic behavior
GLM 5 remains available for tuned prompts
Strong tool-use behavior at lower cost
Sonnet 5 has more polish on writing and a wider ecosystem
The same subscription covers the image studio and video generation.



One subscription covers every model on NinjaChat, GLM 5.2 included.