Skip to navigation

GLM-5.3

View as Markdown

GLM-5.3 is a large-scale reasoning model built for complex software engineering and long-horizon agent tasks. It supports text input and output with a 1,048,576-token context window.

At a glance

Model IDglm5.3
Best forComplex software engineering and long-horizon agent tasks
Context window1,048,576 tokens
Input → outputText → text
Reasoninglow, high, or max (default when omitted). See Reasoning
Tool callingSupported, including parallel_tool_calls: false
APIsPOST /v2/chat/completions and POST /v2/responses
Pricing₹126 input · ₹20 cached input · ₹390 output per 1M tokens; reasoning is billed as output (Pricing)

Key capabilities

Software engineering

Reason across large repositories, implementation plans, and multi-step coding tasks.

Long-horizon agents

Use tool calling and extended context for workflows that require many dependent steps.

Long context

Process up to 1,048,576 tokens across the prompt and generated output.

Streaming

Receive reasoning and final-answer deltas as server-sent events.

Moving from OpenRouter, Fireworks AI, or Together AI? The migration guides map model IDs and request fields to Sarvam.

Quickstart

from sarvamai import SarvamAI
client = SarvamAI(api_subscription_key="YOUR_SARVAM_API_KEY")
response = client.chat.completions_v2(
model="glm5.3",
messages=[
{
"role": "user",
"content": "Explain the difference between a B-tree and a B+ tree index.",
}
],
temperature=1,
top_p=0.95,
max_tokens=8000,
)
print(response.choices[0].message.content)

Supported parameters

model: "glm5.3" on Chat Completion V2 and Responses. Full request/response schemas live on those API reference pages; this table covers what’s actually accepted for this model.

ParameterChat Completion V2Responses
Streaming (stream)
Tool calling (tools, tool_choice)
parallel_tool_calls: false enforced
Structured output (response_format / text.format)
Log probabilities (logprobs, top_logprobs) 400 400
Multiple choices (n > 1) 400 400
Reasoning controlreasoning_effort: low, high, max (default)reasoning.effort: low or high only; literal "max" returns 400
Turn reasoning off always thinks always thinks

All 400s above are invalid_request_error for unsupported/invalid parameters.

Reasoning

GLM-5.3 has three reasoning modes, low, high, and max, but which values you can pass depends on the API:

RouteFieldAccepted values
Chat Completion V2reasoning_effort"low", "high", or "max"; omitting the field also gives max
Responsesreasoning.effort"low" or "high" only. To get max-level reasoning, omit the field, sending the literal string "max" returns 400

Read the reasoning trace from choices[].message.reasoning_content on chat, or from the reasoning item’s content[0].text in output on Responses. Its summary is empty unless you set reasoning.summary to "auto" or "detailed". Reasoning tokens are billed as output tokens either way, and count against max_tokens on chat (defaults to 2048 when omitted) or max_output_tokens on Responses (no default, omitting it means unbounded generation). At the default max effort, reasoning often uses several thousand tokens, so leave room for the answer.

Reasoning can’t be turned off, but at low effort GLM-5.3 often skips it on simple prompts: reasoning_tokens is 0 and Responses returns no reasoning item.

Response fields (chat)

FieldNotes
choices[].message.reasoning_contentReasoning trace; billed as completion tokens.
usage.completion_tokens_details.reasoning_tokensTokens spent on reasoning.

Full response shape: Chat Completion V2.

Known limitations

  • Output token budget. max_tokens on chat defaults to 2048 when omitted; max_output_tokens on Responses has no default and allows unbounded generation. Reasoning counts against whichever budget applies, so a small max_tokens on chat can leave little or no room for the actual answer.
  • Context-length checks are approximate, and more conservative for Latin-script text than for Indic scripts. Treat the model’s own limit as authoritative.

Parameter errors (n, logprobs, stop, and similar) are documented on Chat Completion V2.

Limits and errors

AreaLimit or conditionAPI responseRecommended action
ContextPrompt tokens plus max_tokens exceed 1,048,576400 invalid_request_errorShorten the prompt or reduce max_tokens.
Outputmax_tokens exceeds 1,048,576400 invalid_request_errorSet max_tokens within the context window.
ModalityRequest includes image input400 invalid_request_errorSend text input only.
ParametersMore than four stop sequences400 invalid_request_errorSend at most four stop strings.
Request bodyWrong JSON types (serde validation)400 invalid_request_errorMatch types in the API Reference; read error.message.
Request sizeRequest body exceeds 10 MiB (10,485,760 bytes)413 invalid_request_error, with the limit in the messageShorten the prompt.
AuthenticationAPI key is missing or invalid403 invalid_api_key_errorCheck the api-subscription-key header.
ModelModel ID is unknown or unavailable404 not_found_errorConfirm the ID with GET /v2/models.
QuotaNo credits remain402 insufficient_quota_errorAdd credits in the dashboard.
Rate limitRequest or concurrency limit is exceeded429 rate_limit_exceeded_errorBack off and retry.
AvailabilityModel remains overloaded after retries503 model_overloadedRetry later.