Skip to main content
GLM-5.3 is Z.ai’s flagship mixture-of-experts (MoE) model, built for long-horizon coding and agentic work. It holds project-scale context across many steps and completes multi-stage tasks end to end. Thinking is on by default, so responses carry both a reasoning trace and a final answer. Two variants are available on serverless inference, both with a 1M-token context window, streaming, function calling, and structured outputs: GLM-5.3 is Together’s recommended pick for coding agents. GLM-5.3 Flash is the recommended pick for function calling and other high-volume calls. The examples below use zai-org/GLM-5.3. Swap in zai-org/GLM-5.3-Flash when cost and latency matter more than maximum depth.

Call GLM-5.3

The reasoning trace arrives on reasoning_content and the final answer arrives on content. Stream the response and handle both channels, and skip chunks where choices is empty, since Together emits a final usage-only chunk. GLM-5.3 emits the trace under reasoning_content, while some other Together models use the newer reasoning alias. Reading both keys makes one handler work across models.

Set the reasoning effort

reasoning_effort accepts "low", "medium", "high", and "max". Use "low" for short, high-volume calls and "max" for the hardest planning, architecture, and multi-step agentic problems. At "max", set max_tokens generously, since the trace and the answer share the same completion budget. Thinking cannot be disabled entirely on GLM-5.3. reasoning_effort="low" cuts the trace to a few tokens, which is the closest equivalent for trivial turns. The levels are coarse dials rather than a strictly monotonic scale, so measure token counts on your own prompts before you tune. Invalid effort strings are accepted silently instead of returning an error, so validate the value in your own code.
For broader guidance on reasoning controls and prompting, see Reasoning.

Preserve thinking across turns

For coding agents and other agentic workflows, enable preserved thinking so the model retains its reasoning from previous turns. Set "clear_thinking": false in chat_template_kwargs to keep reasoning content in context across turns, which improves reasoning continuity and cache hit rates.
Python
When using preserved thinking, return the model’s reasoning_content blocks exactly as generated. Reordering or editing them degrades performance and hurts cache hit rates.

Call tools

GLM-5.3 supports tool calling with reasoning interleaved between each step. Define tools in the standard OpenAI-compatible schema and pass them via tools. To stream tool calls, set stream=True. The model emits tool call parameters incrementally, so concatenate the arguments fragments from each delta to rebuild the full call. Together does not use a separate tool_stream parameter.
For the full tool-calling loop, including how to return tool results to the model, see Function calling.

Constrain the output to a schema

GLM-5.3 supports structured outputs. Pass a JSON schema through response_format to constrain the response to a fixed shape. Parse content only, never reasoning_content.
For schema design guidance, see Structured outputs.

Usage tips

Next steps

Reasoning

Control reasoning depth and handle reasoning output across models.

Function calling

Build tool-calling loops against any function-calling model.

Recommended models

See Together’s current picks for every use case.

Serverless models

Browse every model, context length, and price on serverless inference.