Plenty of developers like Claude Code itself (the terminal agent, the way it plans, edits and runs things) but balk at the bill once they use it every day. Claude Pro is $20 a month and Max starts at $100. Meanwhile the Chinese coding plans have got cheap and capable: Z.ai's GLM Coding Plan starts at $18, MiniMax's M Plan at $22, BytePlus's Coding Plan at $10 and StepFun's Step Plan at $6.99. Alibaba Cloud's Qwen Coding Plan Pro costs $50 and covers Qwen, GLM, Kimi and MiniMax models in one subscription.
The good news is you don't have to give up Claude Code to use them. Every vendor below runs an Anthropic-compatible endpoint and publishes its own Claude Code setup page. We went through each of those pages on October 8, 2026, and everything here (addresses, variable names, model IDs, rules) comes straight from them. Where a vendor leaves something out, we say so.
How it works
Claude Code speaks Anthropic's Messages format. Point it at a different server that speaks the same format and it will happily work with someone else's model. In practice you change three things:
- ANTHROPIC_BASE_URL — the vendor's plan endpoint instead of Anthropic's.
- The key — the plan's own key, usually in ANTHROPIC_AUTH_TOKEN. Kimi is the exception and uses ANTHROPIC_API_KEY.
- The model slots — Claude Code asks for Opus, Sonnet and Haiku (and sometimes Fable or a subagent model) by name. ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL, ANTHROPIC_DEFAULT_FABLE_MODEL and CLAUDE_CODE_SUBAGENT_MODEL map those requests to the vendor's model IDs. Leave one out and the background work that uses it, like titles, summaries or subagents, tends to fail quietly.
Most vendors tell you to put these in the env section of ~/.claude/settings.json (on Windows, .claude\settings.json in your user folder), written as JSON keys and string values, so the setting sticks no matter how you launch Claude Code. Exporting them in your shell works too, but only for that terminal session. One thing catches people out: according to Kimi's and StepFun's guides, a value in the settings file's env section beats the same variable exported in your shell.
Two habits save a lot of trouble. First, use the plan key with the plan address. Every vendor here has a separate pay-as-you-go endpoint and key, and mixing them up either fails or quietly bills your account balance instead of your subscription. Second, clear out old settings before you start. MiniMax and BytePlus both say to unset any ANTHROPIC_AUTH_TOKEN and ANTHROPIC_BASE_URL already in your shell (and remove them from .bashrc or .zshrc), because leftovers override the new config.
Several vendors (Alibaba Cloud, BytePlus, Kimi, and Zhipu's China site) also have you add "hasCompletedOnboarding": true to ~/.claude.json. That's a different file from settings.json; it skips Claude Code's first-run Anthropic login, which otherwise fails when you have no Anthropic account or live where Claude Code isn't offered.
GLM Coding Plan (Z.ai)
Create a key on the API Keys page of the Z.ai platform, then put these in the env section:
- ANTHROPIC_AUTH_TOKEN: your Z.ai API key
- ANTHROPIC_BASE_URL: https://api.z.ai/api/anthropic
- ANTHROPIC_DEFAULT_OPUS_MODEL: glm-5.3[1m]
- ANTHROPIC_DEFAULT_SONNET_MODEL: glm-5.3[1m]
- ANTHROPIC_DEFAULT_HAIKU_MODEL: glm-5.3-flash[1m]
- CLAUDE_CODE_AUTO_COMPACT_WINDOW: 1000000
- CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: 1
- API_TIMEOUT_MS: 3000000
The plan covers exactly two models, GLM-5.3 and GLM-5.3-Flash, on every tier. The [1m] suffix together with the compaction window turns on the 1M context; if Claude Code says a [1m] model doesn't exist, Z.ai's fix is to update Claude Code. One small inconsistency: the same Z.ai page lists GLM-5.3-Flash as the default for all three slots, while its manual example uses GLM-5.3 for Opus and Sonnet. Both models are in the plan, so either works.
If you'd rather not edit JSON, Z.ai's Coding Tool Helper (run with npx as @z_ai/coding-helper) does it for you. Mainland China accounts on Zhipu's bigmodel.cn site use https://open.bigmodel.cn/api/anthropic as the base URL, with a key from that site.
Z.ai's usage policy limits the plan to officially supported tools. Claude Code is one of them, but the subscription can't be shared, and repeated violations can get an account banned.
Qwen Coding Plan (Alibaba Cloud Model Studio)
On the Coding Plan page in Model Studio, copy the plan's own key. It starts with sk-sp-. Your general Model Studio key starts with sk- and bills pay-as-you-go, so don't use it here.
- ANTHROPIC_AUTH_TOKEN: your sk-sp- key
- ANTHROPIC_BASE_URL: https://coding-intl.dashscope.aliyuncs.com/apps/anthropic
- ANTHROPIC_MODEL: qwen3.7-plus
- ANTHROPIC_DEFAULT_HAIKU_MODEL: qwen3.7-plus
- ANTHROPIC_DEFAULT_SONNET_MODEL: qwen3.7-plus
- ANTHROPIC_DEFAULT_OPUS_MODEL: qwen3.7-plus
- CLAUDE_CODE_SUBAGENT_MODEL: qwen3.7-plus
Add "hasCompletedOnboarding": true to ~/.claude.json as well, then open a new terminal. Accounts on Alibaba Cloud's China site use https://coding.dashscope.aliyuncs.com/apps/anthropic instead.
Only these exact model IDs work, and they're case-sensitive: qwen3.7-plus, qwen3.6-plus, kimi-k2.5, glm-5 and MiniMax-M2.5 (the recommended set), plus qwen3.5-plus, qwen3-max-2026-01-23, qwen3-coder-next, qwen3-coder-plus and glm-4.7. Anything else returns an error.
This is the strictest plan of the six. Alibaba Cloud says it's for interactive use in coding tools only. Using the key for automated scripts, application backends or any non-interactive calls is a violation and can get your subscription suspended or the key revoked. The key is for you alone, and the plan can't be refunded. Quota counts model calls, not prompts: Alibaba says a simple task typically takes 5–10 calls and a complex one 10–30 or more. When you run out, requests simply fail; there's no automatic switch to pay-as-you-go. Alibaba's FAQ also says Claude Code's Agent Teams don't work on the plan.
MiniMax M Plan
Get your Subscription Key from Plan Details in the MiniMax console. It's separate from a standard API key and the two aren't interchangeable. Clear any old ANTHROPIC_AUTH_TOKEN and ANTHROPIC_BASE_URL from your shell first, then set:
- ANTHROPIC_BASE_URL: https://api.minimax.io/anthropic
- ANTHROPIC_AUTH_TOKEN: your Subscription Key
- CLAUDE_CODE_AUTO_COMPACT_WINDOW: 524288
- ANTHROPIC_MODEL: MiniMax-M3.1-Flash-Preview[1m]
- ANTHROPIC_DEFAULT_SONNET_MODEL: MiniMax-M3.1-Flash-Preview[1m]
- ANTHROPIC_DEFAULT_OPUS_MODEL: MiniMax-M3.1-Flash-Preview[1m]
- ANTHROPIC_DEFAULT_HAIKU_MODEL: MiniMax-M3.1-Flash-Preview[1m]
MiniMax also has a setup wizard that writes all of this for you (npx -y mmx-cli@latest agent setup, then pick Claude Code). To check it worked, run /status inside Claude Code and look for api.minimax.io/anthropic, then /model, which should show MiniMax-M3.1-Flash-Preview. That model always thinks and you can't switch it off. On MiniMax's China platform, the base URL is https://api.minimax.cn/anthropic instead (with a key from that platform).
Usage runs on a 5-hour window and a weekly window, shared across every tool you connect. With a Subscription Key your account balance is never touched; once you hit the limit, any credit packs you've bought are used next. MiniMax describes the plan as built for individual, interactive use and recommends pay-as-you-go for production.
Kimi Code (Kimi membership)
You need a Kimi membership with Kimi Code benefits, and the tier matters: the new Go plan has no coding quota at all. Create a key in the Kimi Code Console (it's shown only once). Kimi's guide starts by running a short script that skips the Anthropic login and wipes old ANTHROPIC entries from settings.json. You can do the same by hand: set "hasCompletedOnboarding": true in ~/.claude.json and delete any old endpoint, key and model entries. Then:
- ANTHROPIC_BASE_URL: https://api.kimi.ai/coding/ (outside China) or https://api.kimi.com/coding/ (China)
- ANTHROPIC_API_KEY: your Kimi Code key (note: API_KEY, not AUTH_TOKEN)
- ANTHROPIC_MODEL, ANTHROPIC_DEFAULT_FABLE_MODEL, ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL and CLAUDE_CODE_SUBAGENT_MODEL: k3-256k
- CLAUDE_CODE_EFFORT_LEVEL: high
- CLAUDE_CODE_AUTO_COMPACT_WINDOW: 262144
- CLAUDE_CODE_MAX_CONTEXT_TOKENS: 262144
Which models you get depends on your tier. Plus (Moderato on the legacy plans) gets k3, k3-256k and kimi-for-coding. Pro and above (Allegretto and above) add kimi-for-coding-highspeed and unlock the 1M version of k3: use k3[1m] in every model slot and set both window values to 1048576. Kimi says k3 at 1M uses about twice the quota of k3-256k. Legacy Andante members get kimi-for-coding only.
When Claude Code asks whether to use the API key, say yes. Don't be thrown if /status still shows a Claude model name; as long as the base URL reads api.kimi.ai/coding/, requests are going to Kimi. Kimi also warns that tampering with the client's User-Agent counts as a violation and can cost you your membership benefits.
BytePlus ModelArk Coding Plan
Create an API key in the ModelArk console. Clear old ANTHROPIC_AUTH_TOKEN and ANTHROPIC_BASE_URL values first, then set:
- ANTHROPIC_AUTH_TOKEN: your ModelArk API key
- ANTHROPIC_BASE_URL: https://ark.ap-southeast.bytepluses.com/api/coding
- ANTHROPIC_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_OPUS_MODEL and CLAUDE_CODE_SUBAGENT_MODEL: ark-code-latest, or a specific model name
- CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: 1
Then add "hasCompletedOnboarding": true to ~/.claude.json. Watch the address: BytePlus warns that the ordinary model endpoint ending in /api/v3 doesn't draw on your plan and bills you separately. The traffic setting matters more here than you'd expect. BytePlus says Claude Code's background telemetry otherwise goes through your base URL and eats plan quota.
With ark-code-latest you pick the model on the console's management page, and changes take 3–5 minutes to apply. With a specific name you switch in Claude Code itself (claude --model followed by the name, or /model during a session). The listed models are dola-seed-2.0-pro, dola-seed-2.0-lite, dola-seed-2.0-code, bytedance-seed-code, glm-5.3-flash, glm-5.2, glm-5.1, kimi-k2.5, gpt-oss-120b, deepseek-v4.1-flash, deepseek-v4-flash and deepseek-v4-pro. BytePlus suggests a small model for the Haiku slot. For 1M context on glm-5.2, deepseek-v4-flash or deepseek-v4-pro, add [1m] to the name and set CLAUDE_CODE_AUTO_COMPACT_WINDOW to 1000000. If Claude Code shows a login prompt because you'd signed in before, run /logout and start it again.
The plan's quota only works in supported coding tools and can't be used for API calls. BytePlus says using the plan key and URL elsewhere can be treated as abuse and lead to deactivation or account suspension. If you'd rather not edit files, BytePlus's ArkCLI Helper sets Claude Code up for you.
StepFun Step Plan
Create a key on the Step platform's API keys page. StepFun's setup is the leanest of the lot:
- ANTHROPIC_AUTH_TOKEN: your Step API key
- ANTHROPIC_BASE_URL: https://api.stepfun.ai/step_plan
- model: step-5-preview (this one goes at the top level of settings.json, not inside env)
Optionally, map ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL, ANTHROPIC_DEFAULT_FABLE_MODEL and CLAUDE_CODE_SUBAGENT_MODEL to step-5-preview as well. The other Step Plan model IDs are step-3.7-flash, step-3.5-flash-2603 and step-3.5-flash. Step 5 Preview has a 1M context window, but Claude Code may assume 200K. To fix that, set CLAUDE_CODE_MAX_CONTEXT_TOKENS and CLAUDE_CODE_AUTO_COMPACT_WINDOW to 1000000 (plain numbers, not 1M). Reasoning effort goes from low through medium to high; StepFun treats xhigh and max as high.
Don't add /v1 to the address. Claude Code appends /v1/messages itself, and plain https://api.stepfun.ai is the pay-as-you-go channel, which doesn't touch your plan. StepFun checked compatibility with Claude Code 2.1.209. Unlike the others, the Step Plan overview says the plan has no platform restrictions. Credits are issued monthly, with no 5-hour or request-rate windows.
Switching back to Claude
Claude Code's own docs explain why this needs care. ANTHROPIC_AUTH_TOKEN and ANTHROPIC_API_KEY both rank above your Claude subscription login, so as long as either is set, your Pro or Max plan is ignored. To go back:
- Remove the vendor entries from the env section: ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY, every model-slot variable, and extras like CLAUDE_CODE_AUTO_COMPACT_WINDOW, CLAUDE_CODE_MAX_CONTEXT_TOKENS, CLAUDE_CODE_EFFORT_LEVEL and API_TIMEOUT_MS. For StepFun, also remove the top-level model line.
- Check your shell profile and any project-level .claude/settings.json for leftovers.
- Remove ANTHROPIC_BASE_URL too, not just the key. Anthropic's docs say that with only the base URL set, Claude Code still sends requests there, just with your claude.ai login attached.
- If you set CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC, delete it rather than setting it to 0. Claude Code treats 0 as still on.
- Open a new terminal, start claude, run /login if asked, and check /status to see which credential is active.
If you switch often, don't keep editing the same file. Claude Code's --settings flag loads a settings file for a single session, so you can keep one file per vendor and leave your main settings on Claude. Alibaba Cloud, MiniMax and BytePlus also point to CC Switch, a community open-source app that swaps providers with a click.
Common errors
- 401, invalid key, authentication failed — usually a key that doesn't match the address: a general pay-as-you-go key on a plan URL or the other way round, a key copied with a stray space, or an expired subscription. On Kimi, check that the key is in ANTHROPIC_API_KEY. StepFun warns against leaving an old ANTHROPIC_AUTH_TOKEN in place while updating only ANTHROPIC_API_KEY.
- "Unable to connect to Anthropic services" mentioning api.anthropic.com — Claude Code is still trying to reach Anthropic. Either your settings didn't load, or "hasCompletedOnboarding" isn't set in ~/.claude.json. Open a new terminal and check /status.
- 404 with no body — the address has an extra path on the end. On Alibaba Cloud and StepFun, Claude Code wants the base without /v1.
- Model not supported or not found — a typo or wrong case in the model ID, a model your plan doesn't include, or an unmapped slot. If only background tasks or subagents fail, the Haiku, Fable or subagent slot is usually the one missing.
- Charges on your account balance despite the plan — you're on the pay-as-you-go route. On Z.ai this shows up as error 1113, Insufficient Balance. Check that the address contains the plan path (coding, api/anthropic, step_plan and so on) and that you're using the plan key.
- Quota errors — Alibaba returns "hour allocated quota exceeded" (or week, or month) when you hit a limit, and "concurrency allocated quota exceeded" at busy times. StepFun returns 402 quota_exceeded. Z.ai, MiniMax and Alibaba all tighten concurrency at peak hours.
- Changes don't take effect — leftover values in the settings file override your shell, and shell exports only last for that session. Fully quit Claude Code and start it again.
Things to know before you commit
The plan rules are real. Every one of these subscriptions is for one person using a coding tool interactively. Alibaba Cloud bans scripts and backends outright. Z.ai and BytePlus restrict use to supported tools. Kimi forbids spoofing the client. MiniMax steers production work to pay-as-you-go. StepFun is the only one that says it has no platform restrictions. Alibaba Cloud's and Z.ai's plans can't be refunded, so try the cheapest tier first.
Quotas drain faster than you'd think. Claude Code makes many model calls per task: reading files, running tools, checking results. A plan sized in requests or calls runs down far faster than a chat window would.
Some Claude Code features drop out. According to Anthropic's docs, pointing ANTHROPIC_BASE_URL anywhere other than Anthropic turns off Remote Control and, by default, MCP tool search. Claude Code's built-in web search is a server-side tool that Anthropic lists only for its own API and certain cloud platforms; none of these vendors' Claude Code guides promise it works, and Z.ai and MiniMax offer their own web search MCP instead. If the endpoint doesn't count tokens, /context shows estimates. Cloud sessions on the web always use your Claude subscription and ignore these variables. Setting CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC, which Z.ai and BytePlus recommend, also switches off Claude Code's auto-updates, so run claude update yourself now and then.
Mind your data. Alibaba Cloud's China-site page says inputs and outputs on the Coding Plan are used for service improvement and model optimization; the international page we read doesn't say this either way. Read the privacy terms of whichever plan you pick.
Names change fast. Several of these plans have been reworked this year: Alibaba Cloud stopped selling Lite, MiniMax replaced its Token Plan with the M Plan, Kimi introduced new membership tiers, and StepFun switched to credit-based billing. Everything here is as of October 8, 2026; if something stops working, check the vendor's Claude Code page first.
