Skip to main content
All models

Z.ai GLM 5.2

OpenRouterOpenRouter docs

z-ai/glm-5.2

Run Z.ai GLM 5.2 in a hosted Python Task with structured output, extended thinking and file inputs.

Z.ai's GLM 5.2 via OpenRouter. A text-only reasoning model for long agent workflows and project-level software engineering, with a 1M token context window.

What Z.ai GLM 5.2 supports in qbash

  • Structured outputReplies as JSON that matches a schema you pass.
  • Extended thinkingReasons through a problem before it replies.
  • Reasoning effort2 levels, from high to xhigh.
  • Document inputReads PDF, TEXT, DOC, XLS, RTF and 7 more files.
  • Prompt cachingRepeated input is billed at the cached rate.

What is qbash?

qbash is where you build Tasks: Python programs that run a business process on managed infrastructure. Your code runs the steps and calls a model like Z.ai GLM 5.2 only at the ones that need judgment, with integrations, memory and files available in the same script.

A developer writes the Task once, and anyone on the team runs it from a form, on a schedule, from a webhook or from chat. Each Task is versioned and every run is logged.

Specifications

Context window
1.05Mtokens
Max output
131,072tokens
Temperature
0 to 1default 1

Structured output with Z.ai GLM 5.2 in a Python Task

qbash.ai.raw calls Z.ai GLM 5.2 from a Task. Pass a JSON Schema as output_schema and the reply comes back as a Python dict that matches it, ready to route to a connector.

main.py
ticket = qbash.inputs.get("ticket")

triage = qbash.ai.raw(
f"Summarize this support ticket and rate its urgency:\n\n{ticket}",
model="z-ai/glm-5.2",
output_schema={
"type": "object",
"properties": {
"summary": {"type": "string"},
"urgency": {"type": "string", "enum": ["low", "medium", "high"]},
},
"required": ["summary", "urgency"],
},
)

# triage is a dict, e.g. {"summary": "...", "urgency": "high"}
if triage["urgency"] == "high":
qbash.integrations.slack.create_message(
channel="#support",
text=triage["summary"],
)

qbash.output(triage)
Structured output in Tasks

Reasoning effort with Z.ai GLM 5.2

Set Effort to high and xhigh in the prompt's Settings. Higher effort spends more tokens on reasoning before the reply.

Turn on Thinking in the same Settings popover to have Z.ai GLM 5.2 reason through a problem before it replies.

Z.ai GLM 5.2 pricing

Input$1.40 per 1M tokens
Output$4.40 per 1M tokens
Cached input$0.26 per 1M tokens

Standard rates in USD.

Supported file formats

Documents

  • PDF
  • TEXT
  • DOC
  • XLS
  • RTF
  • DOCX
  • XLSX
  • PPTX
  • PPT
  • ODT
  • ODP
  • ODS

Automate Z.ai GLM 5.2 with qbash