Home/All articles/qwen-cloud-claude-code-week
The HK AI Stack

My Claude Code quota died. I finished the week on Qwen Cloud — and it cost me exactly this much

Augustin Chan/2026-08-30/16 min read/Qwen CloudClaude CodeToken PlanQwen3.8-MaxAI CostsHong Kong

My Claude Code quota died on a Tuesday. Mid-afternoon, mid-week, mid-job.

I was running an extraction over Jiao's Forest of Changes — also known as the Jiaoshi Yilin (焦氏易林), a Han-dynasty divination text with 4,096 cells of classical Chinese that my coding agent was pulling into structured data. It had days of work left. The quota had none.

If you build with AI in Hong Kong, you already live with the wall. The big US services block us, so we plan around it. We keep alternatives warm. What made this Tuesday different was not the wall. It was where it landed: my own daily driver, in the middle of a job only it knew the state of.

So I did the thing I had been meaning to try. I pointed Claude Code at Qwen Cloud and let it finish the week. The console kept receipts. This is what that week cost, measured to the token.

The swap takes one settings file

Qwen Cloud (Alibaba Cloud's Model Studio, Singapore region) sells a Token Plan for exactly this. You get a dedicated API key and an Anthropic-compatible base URL. Anything that speaks the Anthropic protocol can hang off it — Claude Code, Cursor, Qwen Code, Codex, Qoder, OpenClaw.

I keep one settings file per backend and symlink the active one to ~/.claude/settings.json:

  • -settings.json.claude — the normal week
  • -settings.json.deepseek — my separate DeepSeek plan
  • -settings.json.qwen — the week in question

The swap is a symlink change and a restart. The config that carried the heavy day looked like this, key cut:

KeyValue
ANTHROPIC_BASE_URLhttps://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic
ANTHROPIC_AUTH_TOKENsk-sp-****
ANTHROPIC_MODELqwen3.8-max
ANTHROPIC_DEFAULT_SONNET_MODELqwen3.8-max
ANTHROPIC_DEFAULT_OPUS_MODELqwen3.8-max
ANTHROPIC_DEFAULT_HAIKU_MODELqwen3.6-flash
CLAUDE_CODE_SUBAGENT_MODELqwen3.7-max
CLAUDE_CODE_MAX_CONTEXT_TOKENS983616

Hold the second-to-last row. It decides half the bill.

Credits are not tokens

The Token Plan does not bill tokens. It bills credits, deducted per call:

credits = (input × coef_in + cached input × coef_cache + output × coef_out) / 10,000

Tool calls like web search bill on top, separately. The coefficients are per model, and they are published only in the console — not in the docs. The one worked example in public is qwen3.6-plus: roughly 5,000 fresh input tokens per credit, 25,000 cached tokens per credit, 830 output tokens per credit. Cached input is cheap, but it is not free. That clause does a lot of work later.

The personal plans, with the limited-time price in brackets:

PlanPrice/moCredits per 7-day windowConcurrent agents
Lite$8 ($6)2,5001–2
Standard$25 ($18)10,0003–4
Pro$80 ($68)40,0006–8
Credit Pack$15 each20,000, not window-limitedup to 5 packs

Three rules give the scheme its teeth:

  • -The 7-day window starts at your first call, not at purchase.
  • -Hit the limit and the service pauses. No soft degradation. The full 7 days have to elapse.
  • -Unused credits do not roll over.

There is a Reset Usage Limit control, and a night rate: qwen3.8-max costs half between 22:00 and 08:00 HKT. Night-owl workflows are subsidized. Mine, as it turned out, were not.

The night of the 403

Before the plan caught, I spent one evening on plain pay-as-you-go. The request log from that night reads like a heart-rate monitor. One agentic session on qwen3.8-max, five minutes, input tokens climbing every single turn:

42k → 44k → 68k → 70k → 72k → 75k → 87k → 91k → 97k → 101k → 103k → 106k

That is about 1.28 million input tokens in five minutes. Every turn, the agent re-read the whole conversation so far. At list prices, that burst cost roughly $2.65 — and it ended the only way it could:

HTTP 403 — AllocationQuota.FreeTierOnly

The wall, caught live. That error is the moment I bought the Token Plan.

One day, two horses

The next day, the plan carried the real workload. I pulled the per-day numbers from the console afterwards. Here is the whole month of my Token Plan usage, in tokens:

DayTokens
Aug 20355,973,942
Aug 27692,314
Aug 30 (partial day)~8,500,000

One day ate the week. The Token Plan throttles per rolling 7-day window, not per calendar month — the monthly chart just lines the windows up. That spike is a single working day burning its whole window's allowance: 356 million tokens. Then I split Aug 20 by model, and it got interesting:

ModelTokensCache-hitOutputShare
qwen3.8-max183.6M94.3%794k51.5%
qwen3.7-max172.5M68.7%1.88M48.4%
qwen3.6-flash34.6k18.2k0.01%

Two max-tier horses ran in parallel all day, almost exactly even. The shapes tell you who did what. qwen3.8-max was the reader — 94% cache-hits, short outputs, and all 621,000 image tokens, which were scanned pages feeding the extraction. qwen3.7-max was the writer — 2.4× the output, fresh context on every spawn, only 68.7% cache-hits.

Why were they running side by side? Look at the config again:

CLAUDE_CODE_SUBAGENT_MODEL — qwen3.7-max

The main loop ran 3.8-max. Every subagent Claude Code spawned ran 3.7-max. I had set that env var once, early, and never thought about it again. It quietly decided almost half of the day's bill. On list prices, 3.7-max is even dearer per token than 3.8-max — the model you park in the subagent slot is not a footnote. It is a cost decision.

The bill

Now convert the day to credits. Alibaba does not publish the qwen3.8 coefficients, so use the public qwen3.6-plus rates as a proxy and call it an order of magnitude:

  • -3.8-max: ~10,100 credits (mostly the 172M cached tokens — 6,900 credits for cache alone)
  • -3.7-max: ~17,600 credits
  • -flash: pocket change

One working day ≈ 27,700 credits. The Standard plan gives you 10,000 for the whole week. That day was worth 2.8 Standard weeks. Pro's 40,000 survives roughly a day and a half of it.

This is the sequence I lived: Standard's 10,000 died mid-week, as the arithmetic says it must. I upgraded to Pro. I still bought the $15 credit pack — 20,000 credits, exempt from the window — and by 30 August it was down to 8,841.89. The meter does not negotiate.

The fix that crossed back

The lesson went back into my Claude setup, not just forward into Qwen.

Flat quotas hide the same thing credits expose: re-reading context is the real cost. My heavy sessions ran to the ~1M ceiling and re-sent everything every turn, exactly like the 403 night. So I set an auto-compact window:

CLAUDE_CODE_AUTO_COMPACT_WINDOW = 400000

At 400k, the session compacts its own history before the re-reads get expensive. The effect, measured one week later: a full week of heavy Claude Code work — the same kind of work that used to kill a quota by Tuesday — reached Sunday morning at 97% used. Three percent left, hours before the reset. Tight, but alive. Before the fix, mid-week death was the routine.

One more confession. When I built the fresh settings.json.qwen this week, I left the auto-compact window out of it. The lesson lived in my Claude config and nowhere else. I caught it before it mattered. If you keep configs per backend, audit all of them. Discipline does not transfer by itself.

Where 400k came from, and what the tail costs

400,000 was not a round number I liked the look of, and it was not a guess. It was sized to one specific job.

I run a verification pipeline over the Jiaoshi Yilin, a Western Han text that pairs every I-Ching hexagram with every other — 4,096 verses, surviving here as a hand-copied Siku Quanshu manuscript. The work is done by readers: one subagent per leaf, eight to a round, two rounds to a cycle. Sixteen readers, each looking at scanned crops of a page. I had Claude Code, on Opus, measure what those rounds actually consume. The heaviest single reader came in at 288k. I set the window to 400k to clear that with margin, and the next cycle ran its sixteen readers with the window holding.

The margin matters more there than it does in coding, for one reason: a summary cannot carry an image. If a reader's context compacts mid-round it loses the crops it was reading and keeps only its own prose about them. What comes back is fluent, confident, and no longer looking at anything. In that pipeline a compaction is not a saving — it is a corrupted read that has to be caught and run again.

So the number is real, and it is real for that job specifically. Ordinary coding has no sixteen readers holding images open. For coding I now run 300k — and that gap costs far more than the 100k makes it look.

In an agentic loop with no compaction, every turn re-sends the whole conversation. If each round trip adds d tokens of new material — your prompt, the reply, the tool output — then the turn sitting at context C reads C tokens, and a session that climbs from empty to a ceiling C has read about:

C² ÷ 2d

Per turn, cost grows in a straight line. Cumulatively, it grows with the square. That gap is why the end of a long session feels nothing like the start.

Calibrate it on the 403 night above. That burst climbed 42k → 106k, about 5.3k of new material per round trip. The formula predicts ~1.06 million input tokens. The meter said ~1.28 million. Close enough to trust the shape.

Now run that same session against different ceilings:

Context ceilingInput tokens readShare of the 1M run
200k3.8M4%
300k8.5M9%
400k15.1M16%
600k34.0M36%
1M94.3M100%

Cutting the ceiling from 1M to 400k is not a 60% saving. It is 84%. Going to 300k saves 91%. And the last step — my OCR number down to my coding number, 400k to 300k — is not the 25% it looks like either. It takes another 44% off what was left.

The tail is where the money hides:

  • -The last 10% of a 1M window — 900k to 1M — costs 19% of the whole session.
  • -The last 30% costs 51%. The final third of the window is more expensive than the first two thirds put together.
  • -The last 100k costs twice what the entire first 300k cost.

And the headline: five minutes of unguarded agent work, allowed to run to a 1M ceiling, reads about 94 million input tokens. My record day was 356 million. That is four bursts.

A context window is not a tank you fill. It is a toll you pay again on every turn that follows.

Cursor defaults you to 300k

I did not arrive at that idea on my own. I got it from Cursor, and not on purpose.

Open the model picker, select Claude Opus 5, and read the card it shows you:

Claude Opus 5 — Anthropic's large model class, great for difficult tasks. 300k context window. Version: high effort

Cursor's model picker. The card for Claude Opus 5 reads "300k context window" — no million claimed.
Cursor's model picker. The card for Claude Opus 5 reads "300k context window" — no million claimed.

Not a million. And in that model's own options panel there is a Context setting with exactly two values, 300K and 1M. 300K is the one with the tick beside it.

The same model's options panel. Context offers exactly two values, 300K and 1M, and 300K is the one ticked.
The same model's options panel. Context offers exactly two values, 300K and 1M, and 300K is the one ticked.

Which settles the question I would otherwise have had to argue. The ceiling is a setting. Two values, one menu, one click. Nobody has to be persuaded that it is easy to change, because Cursor ships the switch.

It was not always stated this plainly. Through the spring, Cursor's forum carried reports against Opus 4.6 and 4.7 where the model picker read @ 1M while the session capped at 300k anyway and auto-summarised on arrival — one posted panel shows Opus 4.7 @ 1M above a meter reading ~174.7K / 300K Tokens, with a line item for Summarized conversation already accruing. In May 2026 a Cursor staff member replied that the real cap was about 300k despite the UI showing 1M, and called it "a bug on our side." No timeline was given. What has happened since is that the number stopped being a claim and became a control.

So the label is honest now and the switch is real: pick 1M and you get 1M. Which leaves the more interesting question — who pays for it?

I had an answer ready, and it was wrong. I assumed Cursor buys those tokens from Anthropic and resells them inside a flat plan price, so every token above the ceiling was theirs to eat, and a 300k default cost them 9% of what a 1M default would. That was true of an earlier Cursor — the one that sold a fixed number of requests a month, where a request was a request no matter how much context rode along behind it. It is not true now. Cursor bills per token against a monthly usage pool at each provider's published API rates — and on Teams and Enterprise plans adds a Cursor Token Rate of $0.25 per million on top for third-party models. Past your included usage, the tokens are yours. You buy them.

Nor is there a long-context cliff to hide behind. Anthropic's pricing page is explicit that Claude 4.6 and later include the full 1M window at standard pricing — a 900k-token request bills at the same per-token rate as a 9k one. Cursor's own model docs say it too: up to 1M at the same per-token rates. No surcharge, no tier, no premium.

So the incentive does not point where I thought it did. Past the included pool, someone who switches to 1M and fills it is not costing Cursor money — they are buying more tokens at cost, and on a team plan handing Cursor twenty-five cents per million on top. What survives is smaller and duller and probably true: inside the included pool Cursor is the one buying, so a lower default makes a plan go further, which is also exactly what the user wants. The interests point the same way. There is no other side of the counter to read this from.

300k is the right number. Cursor users are sitting in the cheap 9% of that curve whether they chose it or not, and my own meter — bought, paid for, read every morning — says they are better off there. The default is better than the option. Whatever the accounting was, it landed on the correct answer, so I copied it. Outside the OCR pipeline my coding sessions now sit at 300k too — the same number reached from the opposite end. They made it the default. I got there by reading a bill.

Look at that forum panel again. Before you have typed a word, this is what is already loaded:

ComponentTokens
Conversation109.2K
Tools27.0K
Summarized conversation15.0K
Rules8.2K
MCP5.4K
System prompt5.3K
Skills3.0K
Subagents1.4K

Fifty thousand tokens of scaffolding — tools, rules, MCP, skills, the system prompt — before the first line of real work. Every one of them re-read on every turn, and priced at the square.

What I run now

The table at the top is the config I went in with — naive in the two ways the bill later exposed: no compaction guard, and a max-tier model parked in the subagent slot. Two things changed since: a week of meter readings, and a new cheap model, qwen3.8-flash. Here is what settings.json.qwen carries today, key cut:

KeyValue
ANTHROPIC_BASE_URLhttps://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic
ANTHROPIC_AUTH_TOKENsk-sp-****
ANTHROPIC_MODELqwen3.8-max
ANTHROPIC_DEFAULT_SONNET_MODELqwen3.8-max
ANTHROPIC_DEFAULT_OPUS_MODELqwen3.8-max
ANTHROPIC_DEFAULT_HAIKU_MODELqwen3.8-flash
CLAUDE_CODE_SUBAGENT_MODELqwen3.8-flash
CLAUDE_CODE_MAX_CONTEXT_TOKENS983616
CLAUDE_CODE_AUTO_COMPACT_WINDOW300000

Three rows moved, and each move is one line of the bill, applied:

  • -The subagent slot came down from qwen3.7-max to qwen3.8-flash. The meter showed what that slot cost: 48% of the spike day, at max-tier rates. The new flash release gave it a cheaper model. Subagents run flash now; the main loop does the writing.
  • -CLAUDE_CODE_AUTO_COMPACT_WINDOW is in the file. 300000 — the confession above, caught, and set to the coding number rather than the 400k the OCR cycles need.
  • -The haiku slot moved to qwen3.8-flash. Background calls track the current cheap model.

If you're going in

Seven moves, each with a number behind it:

  • -Set an auto-compact window before your first session. CLAUDE_CODE_AUTO_COMPACT_WINDOW at 300k for ordinary coding. Size it up only if you have wide subagent fan-out that must survive a whole round, the way my OCR cycles do at 400k. This is the biggest lever: my unguarded day was 356 million tokens, and a compacted week of the same work fit inside one flat quota. The plan punishes re-reads. Compaction is how you stop re-reading.
  • -Never run an unguarded context ceiling. CLAUDE_CODE_MAX_CONTEXT_TOKENS near 1M with no compaction means the ceiling is your cost ceiling. Pair the two, or lower the ceiling.
  • -Choose the subagent model like a cost decision. My subagent lane took about half the day's tokens, at a lower cache-hit rate, with 2.4× the output. Read-only scouts: the cheap model. Generation that ships: the good one. Never leave it on whatever you set months ago.
  • -Buy for your worst week, not your average day. Standard's 10,000 credits is real money for chat and light coding with one or two agents. Sustained agentic work — my day estimated at ~27,700 credits — means Pro, or Standard with packs standing by.
  • -Use credit packs as the bridge, not the base. They are exempt from the 7-day window, which is exactly the shape of a spike day.
  • -Shift what you can to the night rate. qwen3.8-max is half price between 22:00 and 08:00 HKT.
  • -Watch your own meter for a week before trusting any rate table — including the ones above. The coefficients are not published. Your workload is the only honest baseline.

One more thing: the older request-counted Coding Plan decouples cost from context length entirely. For long-context agentic work that is its whole argument — and it is why credits felt brutal until compaction tamed the re-reads.

What the meter teaches

Qwen Cloud is not a charity and the Token Plan is not magic money. It is a meter. That turns out to be its best feature.

A flat weekly quota tells you when you are out. A credit meter tells you what eats. Cached re-reads. Unguarded context ceilings. A subagent slot pointed at the wrong model. Every one of those is fixable, and you cannot fix what a flat quota hides from you.

Who is this for? If you are an HK developer, the access story is enough — it runs Claude Code against models you are actually allowed to use, with proper receipts for the finance team. If you are anywhere else, go in with eyes open: do not guess coefficients. Watch the meter for a week and calibrate to your own workload. Compact early. Guard the context ceiling. And choose your subagent model like you are paying per token.

Because you are.


Augustin Chan is co-host of the Hong Kong AI Podcast. The numbers in this article are taken from his own console: Token Plan usage API responses and request logs, captured 2026-08-30. Proxy credit rates are from Alibaba's published qwen3.6-plus example; treat estimates as order-of-magnitude.

Stay in the loop

Get notified when we publish new articles and episodes. No spam, just signal.

Something out of date or wrong? AI moves fast and we want to get it right. Let us know at contact@hongkongaipodcast.com