Grok 4.7 vs Qwen3.8 Max
As of November 23, 2026, Grok 4.7 and Qwen3.8 Max cost the same: $2.00 per 1M input tokens and $6.00 per 1M output tokens. Qwen3.8 Max has the larger context window: 992K tokens versus 500K.
Grok 4.7 vs Qwen3.8 Max side by side
| Grok 4.7 | Qwen3.8 Max | |
|---|---|---|
| Input, per 1M tokens | $2.00 | $2.00 |
| Output, per 1M tokens | $6.00 | $6.00 |
| Cache read, per 1M tokens | $0.50 | $0.25 |
| Cache write, per 1M tokens | – | – |
| Context window | 500,000 tokens | 991,808 tokens |
| Max output | 500,000 tokens | 131,072 tokens |
| Image input | Yes | Yes |
| Tool calling | Yes | Yes |
| Structured output (JSON) | Yes | Yes |
| Prompt caching | Yes | Yes |
| Reasoning | Yes | Yes |
| Providers on LiteLLM | 11 | 12 |
| Price shown is from | xAI | Alibaba Cloud Model Studio |
| Added to LiteLLM | September 21, 2026 | August 7, 2026 |
Cheapest provider for each
- Grok 4.7: xAI at $2.00 input and $6.00 output per 1M tokens (
xai/grok-4.7) - Qwen3.8 Max: DeepInfra at $1.65 input and $4.951 output per 1M tokens (
deepinfra/Qwen/Qwen3.8-Max)
Benchmark scores
| Benchmark | Grok 4.7 | Qwen3.8 Max |
|---|---|---|
| Coding and agents | ||
| FrontierSWE | 29.5% (xhigh) | 15.8% (xhigh) |
| APEX-Agents | 70.0% | 63.3% |
| Reasoning and knowledge | ||
| GPQA Diamond | 92.7% (xhigh) | 92.7% (xhigh) |
| SimpleQA Verified | 56.0% (xhigh) | 45.8% (xhigh) |
| Math | ||
| FrontierMath (tiers 1-3) | 53.0% (xhigh) | 74.7% (xhigh) |
| FrontierMath (tier 4) | 17.1% (xhigh) | 46.3% (xhigh) |
| OTIS Mock AIME 2024-2025 | 98.1% (xhigh) | 99.4% (xhigh) |
When to pick which
Pick Grok 4.7 for
- Returns up to 500,000 tokens per response, vs 131,072.
Pick Qwen3.8 Max for
- Larger context window: 991,808 vs 500,000 tokens.
From differences in the data above only; where the data is equal, no reason is given.
Call Grok 4.7 or Qwen3.8 Max with LiteLLM
Both use the OpenAI format through LiteLLM, so switching is a model name change. Set each provider's API key in the environment first.
from litellm import completion
messages = [{"role": "user", "content": "Hello!"}]
# Grok 4.7
response = completion(model="xai/grok-4.7", messages=messages)
# Qwen3.8 Max
response = completion(model="dashscope/qwen3.8-max", messages=messages)
# Grok 4.7, falling back to Qwen3.8 Max if the call fails
response = completion(model="xai/grok-4.7", messages=messages, fallbacks=["dashscope/qwen3.8-max"])FAQ
Which is cheaper, Grok 4.7 or Qwen3.8 Max?
They cost the same: $2.00 per 1M input tokens and $6.00 per 1M output tokens, as of November 23, 2026.
Which has the larger context window, Grok 4.7 or Qwen3.8 Max?
Qwen3.8 Max has the larger context window: 991,808 tokens, versus 500,000 for Grok 4.7.
Can I switch from Grok 4.7 to Qwen3.8 Max without changing my code?
Yes. Through LiteLLM both use the OpenAI format, so switching means changing the model name from "xai/grok-4.7" to "dashscope/qwen3.8-max", or pointing a LiteLLM gateway model alias at the other model. You can also use one as a fallback for the other.