Skip to navigation

GLM-5.3 Flash

View as Markdown

GLM-5.3 Flash is a faster sibling of GLM-5.3, served on Sarvam infrastructure as an open-weight model. It accepts text and images and has a 1,048,576-token context window.

At a glance

Model IDglm5.3-flash
Best forFast reasoning, agents, and image understanding
Context window1,048,576 tokens
Input → outputText + image → text
Reasoninglow, high (default when omitted), or max. See Reasoning
Tool callingSupported, including parallel_tool_calls: false
APIsPOST /v2/chat/completions and POST /v2/responses
Pricing₹13.5 / ₹2.5 cached / ₹45 per 1M tokens (input / cached input / output); reasoning is billed as output — see Pricing

Key capabilities

Long context

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

Image input

Send base64-encoded images alongside text.

Reasoning

Receive reasoning in reasoning_content separately from the final answer in content.

Tool calling

Use OpenAI-compatible tools and tool_choice for agentic workflows.

Structured output

Constrain answers with response_format JSON schemas.

Log probabilities

Request logprobs and top_logprobs, and n > 1 choices.

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-flash",
messages=[
{
"role": "user",
"content": "Write a Python function that checks whether a string is a palindrome.",
}
],
max_tokens=2000,
)
print(response.choices[0].message.content)

Supported parameters

model: "glm5.3-flash" 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) send top_logprobs with include: ["message.output_text.logprobs"]; logprobs: true returns 400
Multiple choices (n > 1)N/A — Responses has no n
Reasoning controlreasoning_effort: low, high (default), maxreasoning.effort: low or high (default); "max" returns 400
Turn reasoning off always thinks always thinks

On POST /v2/responses, logprobs is only populated when the request includes "include": ["message.output_text.logprobs"]. Without it, output[].content[].logprobs is always an empty array even if top_logprobs is set. Verified against the live API on 2026-10-22.

Reasoning

GLM-5.3 Flash reasons by default, at high effort. The two APIs accept different values:

RouteFieldAccepted values
Chat Completion V2reasoning_effort"low", "high", or "max"; omitting the field gives high
Responsesreasoning.effort"low" or "high" only; omitting the field gives high. The literal string "max" returns 400, so max effort is available on Chat Completion V2 only

Read the reasoning trace from choices[].message.reasoning_content on chat. On Responses, output starts with a reasoning item; read its content[0].text (summary is empty, unlike GLM-5.3). Reasoning tokens are billed as output tokens and count against max_tokens / max_output_tokens.

Image input

Send images as base64 data URIs in an image_url content part on chat, or an input_image part on Responses.

import base64
with open("chart.png", "rb") as f:
data_uri = "data:image/png;base64," + base64.b64encode(f.read()).decode()
response = client.chat.completions_v2(
model="glm5.3-flash",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Summarise this chart."},
{"type": "image_url", "image_url": {"url": data_uri}},
],
}
],
max_tokens=2000,
)

How it differs from GLM-5.3

glm5.3glm5.3-flash
Image inputNot supportedSupported
Log probabilitiesNot supported (400)Supported
Multiple choices (n > 1)Not supported (400)Supported
parallel_tool_calls: falseNot enforcedEnforced

Known limitations

  • Reasoning and the final answer share the max_tokens / max_output_tokens budget.
  • Set max_tokens explicitly. When it’s omitted, generation isn’t capped at a small default and long answers can run to tens of thousands of tokens.

Limits and errors

AreaLimit or conditionAPI responseRecommended action
Outputmax_tokens exceeds 1,048,576400 invalid_request_errorSet max_tokens within the context window.
Request sizeRequest body exceeds 10 MiB (10,485,760 bytes)413 invalid_request_error, with the limit in the messageReduce the request body; base64 images count toward the limit.
ReasoningReasoning consumes the full max_tokens budget200 with finish_reason: "length"Raise max_tokens or lower the reasoning effort.
AuthenticationAPI key is missing or invalid403 invalid_api_key_errorCheck the api-subscription-key header.
ModelModel ID is unknown or unavailable404 not_found_errorCheck the spelling; model IDs are case-sensitive.
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.