---
title: "Alibaba's Qwen3.7-Max Slashes Input Costs 90% With Automatic Prompt Caching"
subtitle: "Qwen3.7-Max now caches repeated prompt prefixes automatically, cutting input costs by up to 90% with zero code changes — and offers explicit control for power users who need guaranteed hits."
url: "https://alphasignal.ai/news/alibaba-s-qwen3-7-max-slashes-input-costs-90-with-automatic-prompt-caching"
author: "AlphaSignal Newsroom"
author_url: "https://alphasignal.ai/editorial-team"
company: "Qwen"
company_url: "https://alphasignal.ai/company/alibaba_qwen"
published: "2026-05-25T15:26:13.000Z"
updated: "2026-06-16T21:02:28.366Z"
type: "News"
topics:
  - "Api"
  - "Llms"
subtopics:
  - "Long Context"
upvotes: 1416
read_time: "5 min"
source_url: "https://www.alibabacloud.com/help/en/model-studio/explicit-cache-best-practice"
comments: 0
---

# Alibaba's Qwen3.7-Max Slashes Input Costs 90% With Automatic Prompt Caching

> Qwen3.7-Max now caches repeated prompt prefixes automatically, cutting input costs by up to 90% with zero code changes — and offers explicit control for power users who need guaranteed hits.

Every time you call a large language model with a long system prompt or a big reference document, the model re-reads every single token from scratch. That's wasteful and expensive, especially in agentic workflows where the same codebase context or product manual gets sent on every turn. Alibaba's Qwen team just fixed that for [Qwen3.7-Max](https://openrouter.ai/qwen/qwen3.7-max): implicit prompt caching is now live, and it requires zero setup on your end.

## What just landed

Alibaba's Qwen team announced that Qwen3.7-Max now supports implicit prompt caching, automatically enabled with no configuration required. For developers already using Qwen3.7-Max for coding tasks, the cost savings activate immediately without a single code change.

Two caching modes are now available on the model:

- **Implicit caching** -- fully automatic. The system detects repeated content prefixes across requests and reuses the cached computation. No API changes needed.
- **Explicit caching** -- you manually mark what to cache by adding `"cache_control": {"type": "ephemeral"}` to your messages array. You get deterministic, guaranteed cache hits in exchange for a small amount of setup work.

## The cost math

Qwen3.7-Max supports prompt caching at $0.25 per million tokens -- a 90% discount on the standard $2.50 input rate. For workloads that reuse long system prompts or reference documents across turns, that drops the effective input cost dramatically. On the explicit side, creating the cache incurs only a 25% surcharge over the standard input price, while each subsequent hit saves 90% -- meaning a single hit is enough to break even.

For repeated context, effective price after prompt caching is applied can be 60-80% cheaper than the list rate. The standard list price for Qwen3.7-Max is $2.50 per 1M input tokens and $7.50 per 1M output tokens. There is currently a promotional rate cutting that in half.

## How to use it

For implicit caching, you don't need to do anything. Just keep your static content (system prompt, reference docs, tool definitions) at the beginning of your messages array and put dynamic content at the end. The minimum cacheable block is 1,024 tokens.

For explicit caching, the pattern is straightforward. Here's the minimal setup using the OpenAI-compatible endpoint:

```
from openai import OpenAI
import os
client = OpenAI(
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    base_url="https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
)
messages = [
    {
        "role": "system",
        "content": [
            {
                "type": "text",
                "text": your_long_system_prompt,  # must exceed 1024 tokens
                "cache_control": {"type": "ephemeral"},  # mark this for caching
            }
        ],
    },
    {"role": "user", "content": user_question},
]
completion = client.chat.completions.create(
    model="qwen3.7-max",
    messages=messages,
    extra_body={"enable_thinking": False},
)
# Check cache behavior in the response
usage = completion.usage
print(f"Cache created: {usage.prompt_tokens_details.cache_creation_input_tokens}")
print(f"Cache hit: {usage.prompt_tokens_details.cached_tokens}")
```

A few constraints worth knowing upfront:

- Minimum cacheable size: **1,024 tokens**
- Maximum cache markers per request: **4**
- Cache TTL: **5 minutes**, auto-renewed on each hit
- Implicit and explicit caching are mutually exclusive per request -- if you include a `cache_control` marker, explicit mode takes over
- Content must be in array form (not a plain string) to support cache markers

## Where it actually pays off

Qwen3.7-Max is designed for agent-centric workloads, with particular strengths in coding, office and productivity tasks, and long-horizon autonomous execution. Those are exactly the workloads where caching matters most -- you're sending the same codebase context or product knowledge base on every single turn.

The three scenarios where this is most impactful:

1. **Multi-turn conversations** -- each turn hits the cache from the previous turn's conversation history. The longer the session, the more you save.
2. **Batch processing** -- fixed classification or extraction prompt sent against thousands of items. After the first request creates the cache, every subsequent call hits it. On 1,000 items, 999 of them get the 90% discount.
3. **Production agents with layered context** -- use up to 4 explicit cache markers to pin content at different stability levels: system persona (rarely changes), tool definitions (changes occasionally), knowledge base (changes per user/session), and conversation history (grows each turn).

## The reliability problem the community noticed

The announcement is well-timed, because Qwen's caching story has been a sore spot. The catch raised consistently in the community: Qwen's caching hits less reliably than competitors. One Reddit user ran the same code review task across four AI CLIs and found Qwen burned 23% of their $30 monthly quota on a single task -- the same task consumed under 1% of comparable $100 Claude and $100 OpenAI plans. The explicit diagnosis: "They do not appear to cache as well as other model providers."

That's the real motivation behind offering both modes. Implicit caching is convenient but probabilistic -- the system decides what to cache based on usage patterns. Explicit caching is the answer for teams that need predictable bills. Explicit cache delivers 100% deterministic hits regardless of backend resource scheduling.

## How Qwen stacks up against the field

Prompt caching is now table stakes across the major providers, but the implementations differ meaningfully. Here's where things stand:

| Provider | Cache Type | Cache Read Discount | Min. Tokens | TTL |
| --- | --- | --- | --- | --- |
| Anthropic (Claude) | Explicit | 90% off | 1,024 | 5 min (refreshed on hit) |
| OpenAI (GPT-5.x) | Implicit | 50% off | 1,024 | ~5-10 min |
| DeepSeek | Implicit | ~87% off | 64 | Several hours |
| Qwen3.7-Max | Both | ~80-90% off | 1,024 | 5 min (explicit) |
| Google (Gemini) | Both | 90% off | 1,024-4,096 | Configurable |

Qwen is now one of the few providers offering both modes, giving teams flexibility to choose based on their workload. If you're a Claude Code user, Qwen3.7-Max natively supports the Anthropic API, meaning you can use it with Claude Code straight away -- and the [official docs](https://www.alibabacloud.com/help/en/model-studio/explicit-cache-best-practice) show exactly how to configure Claude Code, OpenCode, and OpenClaw to automatically leverage explicit caching against the Qwen backend.

One real caveat: Qwen3.7-Max is a reasoning model that thinks heavily before answering. In Artificial Analysis testing, the model generated about 97 million tokens to complete the Intelligence Index evaluation -- roughly 4x the 24 million-token average for other models on the benchmark. Caching slashes input costs, but output tokens from extended thinking are not cached and remain the dominant cost driver for complex reasoning tasks. For straightforward agentic tasks, you can disable thinking mode entirely with `"enable_thinking": False` to keep output costs predictable.

## Sources

- [X post by @alibaba_qwen](https://x.com/alibaba_qwen/status/2058932656797368619)
- [Explicit Cache Best Practices - Alibaba Cloud Model Studio](https://www.alibabacloud.com/help/en/model-studio/explicit-cache-best-practice)
- [Qwen3.7 Max - API Pricing & Benchmarks | OpenRouter](https://openrouter.ai/qwen/qwen3.7-max)
- [Implicit vs. Explicit Prompt Caching in 2026: Claude, Qwen3-Max, and DeepSeek Compared](https://ai-cost-estimator.com/blog/implicit-vs-explicit-prompt-caching-claude-qwen3-deepseek-2026)
- [Qwen pricing in 2026: every model, what you actually pay | eesel AI](https://www.eesel.ai/blog/qwen-pricing)
- [Qwen 3.7 Max and Plus: New Best Flagship Models From China? | AI Hub](https://overchat.ai/ai-hub/qwen-3-7-max)
