Qwen3.8 Max vs GLM 5.3 vs DeepSeek V4 Pro
Qwen3.8 Max vs GLM 5.3 vs DeepSeek V4 Pro by job: coding agents, tool calling and JSON, long context, and how each handles thinking and reasoning_content.
By OceanToken Team

Editor's note: Spec sheets make these three look interchangeable: about a million tokens of context, tools, JSON mode, reasoning on by default. They are not interchangeable in an agent loop. What breaks a port is how each one wants its reasoning handled, and what decides a pick is the job. We would not rank them overall. We would route by task and keep a test that tells you when to move.
Short answer: For Qwen3.8 Max vs GLM 5.3 vs DeepSeek V4 Pro, route by job. Start long-horizon coding agents on GLM 5.3, tool-calling backends on DeepSeek V4 Pro, and anything with screenshots or video on Qwen3.8 Max, the only one of the three that takes image and video input. All three reason by default, so budget for it.
On OceanToken all three run on one key at the same OpenAI-compatible base URL, so trying the other two is a change of model id, not a new account with each lab. The facts below come from each id's API reference on docs.oceantoken.ai and from the publishers' own docs, read on November 22, 2026. Price is a separate question with its own pages: see the current rate on /qwen-api, /glm-api and /deepseek-api. We have not run a three-way bake-off for this article, so the quality questions end in a test you can run on your own tasks.
01 · Qwen3.8 Max vs GLM 5.3 vs DeepSeek V4 Pro: where they differ
The head-to-head spec pages already exist for each pair: Qwen3.8 Max vs GLM 5.3, GLM 5.3 vs DeepSeek V4 Pro and Qwen3.8 Max vs DeepSeek V4 Pro. Rather than copy them, here are only the rows that change a decision:
| Row that matters | qwen/qwen3.8-max-0902 |
z-ai/glm-5.3 |
deepseek/deepseek-v4-pro |
|---|---|---|---|
| Input | Text, image, video | Text only | Text only |
| Context window (our reference) | 983,616 | 1,048,576 | 1,048,576 |
| Max output (our reference) | 131,072 | 943,718 (the publisher says 128K) | 384,000 |
| Can thinking be switched off? | Yes on Alibaba's API; our reference says it always reasons | No, per Z.ai | Yes on DeepSeek's API; not dependable on ours |
| Reasoning history in tool loops | Optional (preserve_thinking on Alibaba's API) |
Not documented on Z.ai's thinking page | Required: missing it returns a 400 |
One thing the table does not show: the feature lists are the same. All three references list tools, tool_choice, parallel_tool_calls, json_object and json_schema, all three return reasoning_content next to content, and all three put reasoning_effort among parameters that "may be served without them". So the choice is rarely about whether a feature exists. It is about input type, output length and how strict each model is with reasoning across turns.
02 · Which Chinese LLM for coding agents
For a coding agent that reads files, runs tests and edits across a repo, start on GLM 5.3 and keep DeepSeek V4 Pro as the second candidate. Our reasoning is about fit, not a leaderboard. Z.ai describes GLM-5.3 as its flagship for complex software engineering, agent tasks and long-horizon work, so we pick it for repo-wide edits. Move to DeepSeek V4 Pro if your agent writes long files: Z.ai lists 128K output for GLM-5.3, against 384,000 for V4 Pro on our endpoint. DeepSeek V4 Pro is the close alternative: it has the same context window on our endpoint and the most explicit rules for reasoning in tool loops, which makes failures easy to diagnose.
Qwen3.8 Max is the pick when the agent has to look at something. A coding agent that reproduces a UI bug from a screenshot, or reads a screen recording of a failing flow, needs image or video input, and of these three only Qwen3.8 Max lists both. It also has a first-party data point: OceanToken's guide to running coding agents lists qwen/qwen3.8-max-0902 among the models that completed a coding task with Codex's own tools in its test on October 19, 2026. That is one task in one harness, so treat it as "known to work", not "best".

| Job | Start with | Why | Second choice |
|---|---|---|---|
| Long-horizon coding agent, repo-wide edits | z-ai/glm-5.3 |
Publisher positions it for agentic coding; always reasons | deepseek/deepseek-v4-pro |
| Agent that reads screenshots or video | qwen/qwen3.8-max-0902 |
Only one with image and video input | none of the other two |
| Tool-calling backend, strict JSON | deepseek/deepseek-v4-pro |
Well-documented reasoning rules for tool loops | z-ai/glm-5.3 |
| Long-document Q&A, text only | Any; start with deepseek/deepseek-v4-pro |
Full million-token window, large output | z-ai/glm-5.3 |
| Very long generated output | deepseek/deepseek-v4-pro |
384,000 listed; GLM's publisher figure is lower | qwen/qwen3.8-max-0902 |
| Bilingual Chinese and English output | Test all three | No documented difference; review blind | n/a |
When would we ignore this table? When your harness already passes its evals on one of them. A working prompt on a model you know beats a theoretical fit on a model you do not, and switching costs a full regression run.
03 · Tool calling and JSON: Qwen, GLM and DeepSeek compared
The request shape for tools is identical across the three on our endpoint: an OpenAI-style tools array, tool_choice set to auto, none, required or a named function, and parallel_tool_calls: false when you want one call per turn. JSON works the same way too, with response_format set to json_object or to a json_schema you supply. If you have a tool-calling loop written for one, it will run on the others without changes to the request.
The differences show up in what you send back after the first turn. DeepSeek is the strictest and the best documented. Its thinking-mode guide says that when a request carries tools, the reasoning_content of earlier turns must be passed back, including within a turn when the model makes several sub-requests, and that if your code does not pass it back correctly the API returns a 400 error. It also notes that tool_choice: "none" turns tool calling off even when tools are provided, which is the right way to force a final text answer.
Alibaba's docs describe a softer rule for Qwen3.8 Max. Reasoning from earlier turns is only read when preserve_thinking is on, and turning it on adds that reasoning to your input token count. Z.ai's thinking page for GLM-5.3 does not say whether reasoning must be returned in tool loops. Given those three positions, the safe habit is the same for all of them: append the assistant message exactly as returned, with reasoning_content and tool_calls, then your tool messages with matching ids. That satisfies DeepSeek's rule and does no harm on the others.
For single-model walkthroughs with full code, see our GLM tool calling tutorial and Qwen tool calling in Python. Both loops carry over to DeepSeek V4 Pro if you keep the full assistant message.
04 · Thinking mode: three publishers, three rules
All three models return their reasoning in choices[0].message.reasoning_content, count it in usage.completion_tokens_details.reasoning_tokens, and count it toward max_tokens. That last point is where most surprises start. A cap that was fine for a model that does not reason can be spent entirely on thinking, and the reply comes back with empty content and finish_reason: "length".
The publishers then diverge. Z.ai says GLM-5.3 uses forced thinking: thinking.type accepts only enabled, a request with disabled returns an error, and reasoning_effort takes low, high or max, with max as the default. DeepSeek turns thinking on by default, lets you pass thinking: {"type": "disabled"} through extra_body, and maps effort levels onto low, high and max. Alibaba describes Qwen3.8 Max as hybrid, with thinking on by default and an enable_thinking switch on its own API.
On our endpoint, the API references are more conservative than the publishers. Each one lists reasoning_effort only among parameters that may be ignored, Qwen's and GLM's say the model always reasons, and none of them lists enable_thinking or thinking as a parameter. The practical reading: assume all three think on every request, size max_tokens with room for reasoning, and treat any effort setting as something to verify by watching reasoning_tokens before you build a cost plan around it.
| Question | Qwen3.8 Max | GLM 5.3 | DeepSeek V4 Pro |
|---|---|---|---|
| Reasons by default? | Yes | Yes, always | Yes |
| Off switch on the publisher's API | enable_thinking: false |
None | thinking: {"type": "disabled"} |
| Effort values on the publisher's API | Not listed for this model on Alibaba's deep-thinking page | low, high, max |
low, high, max |
| Effort on our endpoint | May be ignored; measure it | May be ignored; measure it | May be ignored; measure it |
| Sampling settings in thinking mode | Check per request | Check per request | temperature and penalties have no effect |
05 · Long context: which of the three to load up
For long-context work, DeepSeek V4 Pro gives you slightly more room on both ends: 1,048,576 tokens of context against Qwen3.8 Max's 983,616 on our endpoint, and 384,000 tokens of output against 131,072. For reading a large codebase or a stack of contracts and answering questions, that gap rarely matters, because the answer is short. It matters when you ask for long output, such as a full migration plan or a rewritten module set, where Qwen's lower output cap can cut the answer off.
Qwen3.8 Max wins the long-context case when the long input is not text. A long screen recording, a folder of design screenshots, or a PDF rendered as page images can go to Qwen in one request, while DeepSeek V4 Pro and GLM 5.3 need you to convert everything to text first. That conversion step loses layout and visual detail that often matters in bug reports.
GLM 5.3 sits between them with a full million-token window, but plan its output around Z.ai's own figure of 128K tokens rather than the 943,718 our reference lists. When two official sources disagree on a limit, build to the lower one and test the higher one before relying on it.
A word on long prompts and cost. Long-context requests repeat large prefixes, and our API reference says GPT, DeepSeek, Qwen and GLM models cache a repeated prompt start on their own, with hits reported in usage.prompt_tokens_details.cached_tokens. Keep the long document at the start of the prompt and the question at the end, and the second question about the same document costs less to send.
06 · One request, three model ids
Because the request shape is shared, a fair comparison is a loop over model ids. This sends the same tool-calling task to all three and logs what you need to compare them:
import os, time
from openai import OpenAI
client = OpenAI(base_url="https://api.oceantoken.ai/v1",
api_key=os.environ["OCEANTOKEN_API_KEY"])
MODELS = ["qwen/qwen3.8-max-0902", "z-ai/glm-5.3", "deepseek/deepseek-v4-pro"]
tools = [{"type": "function", "function": {
"name": "read_file",
"description": "Read a file from the repository",
"parameters": {"type": "object",
"properties": {"path": {"type": "string"}},
"required": ["path"]}}}]
for model in MODELS:
t0 = time.time()
r = client.chat.completions.create(
model=model,
messages=[{"role": "user", "content": "Find why tests/test_refund.py fails. Start by reading it."}],
tools=tools,
max_tokens=16000,
)
m, u = r.choices[0].message, r.usage
reasoning = getattr(u.completion_tokens_details, "reasoning_tokens", None)
print(model, r.choices[0].finish_reason, bool(m.tool_calls),
u.completion_tokens, reasoning, round(time.time() - t0, 1))
Three parameters deserve a note:
| Parameter | What to set | Why |
|---|---|---|
max_tokens |
Generous, such as 16,000 for agent turns | Reasoning counts toward it on all three |
temperature |
Leave unset when comparing | DeepSeek ignores it in thinking mode, so setting it skews a comparison |
tool_choice |
auto for normal turns, none to force a final answer |
Same meaning on all three references |
07 · Pitfalls when you switch between them
| Situation | What happens | What to do |
|---|---|---|
Tool loop drops reasoning_content on DeepSeek V4 Pro |
DeepSeek returns a 400 error | Append the assistant message as returned |
Code sends thinking: {"type": "disabled"} to GLM 5.3 |
Z.ai returns an error | Remove it; GLM 5.3 always thinks |
| Screenshot sent to GLM 5.3 or DeepSeek V4 Pro | Neither lists image input in its API reference, so the image cannot be used | Route image jobs to Qwen3.8 Max |
Low max_tokens on any of the three |
Thinking uses the cap; empty content |
Raise the cap and watch reasoning_tokens |
| Long output from GLM 5.3 planned at 943,718 | Publisher lists 128K | Plan for the lower figure |
| Model id without the publisher prefix | Our docs list "Unknown model" for this | Use deepseek/deepseek-v4-pro, not deepseek-v4-pro |
Most of these are one-line fixes once you know them. The first one is the expensive one, because it tends to appear only on the second or third turn of an agent loop, after a demo has already passed.
How to test this on your workload
We have not run these three side by side for this article, and you should not trust anyone's general ranking for your repo. This setup gives you an answer in an afternoon:

- Pick 10 real tasks with automatic checks, such as a failing unit test to fix or a JSON extraction with a schema to validate against.
- Run every task three times on each model id with the same prompt, tools and
max_tokens, and notemperature. - For agent tasks, record whether the run made the expected tool calls, whether it finished, and how many turns it took.
- Log
usage.completion_tokens,reasoning_tokensandprompt_tokens_details.cached_tokensfor every request. - Record time to first token with streaming on, since reasoning can delay the first visible output.
- For one task, send
reasoning_effort: "low"and comparereasoning_tokenswith the default to see whether the setting has any effect on our endpoint. - Check each run's charge in the console's Logs, then compute cost per passed task with each model's current rate.
| What you see | What to do |
|---|---|
| One model passes clearly more tasks | Make it the default for that job |
| Pass rates are close | Prefer the one with fewer output tokens per passed task |
| DeepSeek runs fail on turn two | Check that your loop keeps reasoning_content |
A model returns empty content |
Raise max_tokens before judging its quality |
Our take: Do not pick one Chinese flagship for everything. Route coding agents to GLM 5.3, tool-calling backends to DeepSeek V4 Pro and anything visual to Qwen3.8 Max, and write your agent loop to keep the full assistant message so the routing can change without code changes. Rerun the same test when any of the three ships a new version, and let the results move your defaults.
Running it on OceanToken
All three ids answer at the base URL https://api.oceantoken.ai/v1 on POST /v1/chat/completions, and each reference also lists /v1/responses and /v1/messages, so OpenAI-shaped or Anthropic-shaped code can call them as it is. One API key and one prepaid balance cover all three plus the other model families in the catalog, with no subscription and no platform fee, and moving a job from GLM 5.3 to DeepSeek V4 Pro is a change of the model string.
Two details help with exactly the testing this article recommends. Each API key can carry its own credit limit, so a bake-off key cannot draw more than you set, and every request appears in the console's Logs with its cost and cached tokens. For price, see the current rate on /qwen-api, /glm-api and /deepseek-api.
FAQ
Which is best for coding: Qwen3.8 Max, GLM 5.3 or DeepSeek V4 Pro? There is no general winner. Start coding agents on GLM 5.3, try DeepSeek V4 Pro second, and use Qwen3.8 Max when the agent needs screenshots or video, then confirm with your own tasks.
Do all three support tool calling and JSON mode? Yes. Each API reference on our endpoint lists tools, tool_choice, parallel_tool_calls, json_object and json_schema.
Can I turn off thinking? Not on GLM 5.3, per Z.ai. DeepSeek and Alibaba offer an off switch on their own APIs, but our references list neither switch, so assume all three reason and budget for it.
Which has the longest context? GLM 5.3 and DeepSeek V4 Pro list 1,048,576 tokens on our endpoint and Qwen3.8 Max lists 983,616. For long output, DeepSeek V4 Pro lists the most dependable room.
Do I need different code for each model? Not for the request. Keep the full assistant message in history so DeepSeek's reasoning rule is met, and remove any thinking: disabled you send to GLM 5.3.
Sources
- OceanToken docs: Qwen3.8 Max spec (JSON) (checked 2026-11-22)
- OceanToken docs: GLM 5.3 spec (JSON) (checked 2026-11-22)
- OceanToken docs: DeepSeek V4 Pro spec (JSON) (checked 2026-11-22)
- OceanToken docs: Run your coding agent on OceanToken (checked 2026-11-22)
- DeepSeek API docs: Thinking mode (checked 2026-11-22)
- Z.ai docs: GLM-5.3 (checked 2026-11-22)
- Z.ai docs: Thinking (checked 2026-11-22)
- Alibaba Cloud Model Studio: Deep thinking (checked 2026-11-22)
Get your OceanToken API key
- Create an OceanToken account and an API key.
- Copy the snippet below, paste your key, and run it.
- Check the current rate on /glm-api.
curl https://api.oceantoken.ai/v1/chat/completions \
-H "Authorization: Bearer $OCEANTOKEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "z-ai/glm-5.3", "messages": [{"role": "user", "content": "Plan the steps to fix a failing unit test, in five bullets."}], "max_tokens": 16000}'
More from the blog
Wan 3.0 Prime vs Veo 3.1: Image to Video
Wan 3.0 Prime vs Veo 3.1 image to video on one API: first and last frame fields, reference image limits, lengths, shapes and which model fits each shot type.
GTE-Large vs BGE-M3 for Multilingual RAG
GTE-Large vs BGE-M3 for RAG: English-only and 512 tokens vs 100+ languages and 8K input, what /v1/embeddings returns, and how chunking changes.
Kimi K3 vs Kimi K3.1 Pro: Which to Use
Kimi K3 vs Kimi K3.1 Pro by job: which takes tools, JSON and video on our API, how thinking and reasoning_content work, and what to change when you migrate.