selan.ai

Guide · Other models in Claude Code

How do you run Qwen in Claude Code?

Point Claude Code at an endpoint that serves Qwen in Anthropic's API format, then name the model. Alibaba Cloud Model Studio publishes three such endpoints, one per way of paying, and OpenRouter is another. Through Selan, an owner connects the company's OpenRouter key once. Each developer then runs selan claude --model openrouter:qwen/qwen3.8-max-0902.

coding plan token plan per token claude

Why does Qwen work in Claude Code at all?

Claude Code sends every request in Anthropic's Messages format. It reaches another server when ANTHROPIC_BASE_URL is set to that server's address.

Alibaba Cloud Model Studio serves Qwen in that same format, at addresses ending in /apps/anthropic. OpenRouter answers in it too.

So Qwen needs no translation in the middle, unlike GPT. What it needs is the right endpoint, the key made for that endpoint, the model names and the window. How GPT differs is in running GPT in Claude Code.

How do you set up Qwen in Claude Code by hand?

Alibaba's guide puts these in the env block of ~/.claude/settings.json. For a Token Plan, it is:

  • https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic as the base URL, and your Token Plan API key as ANTHROPIC_AUTH_TOKEN
  • qwen3.8-max as the Opus model and qwen3.8-flash as the Sonnet model
  • qwen3.6-flash as the Haiku model
  • auto as the main model and the subagent model
  • CLAUDE_CODE_MAX_CONTEXT_TOKENS at 983616

Claude Code assumes a 200K window otherwise. Alibaba's other way to raise it is a [1m] suffix on a model name that supports a 1M window.

To skip Anthropic's own sign-in at startup, Alibaba sets hasCompletedOnboarding to true in ~/.claude.json. A change takes effect only in a new terminal window.

Every request in that session then goes to Alibaba. Claude models are out of reach until you change the file back.

That works for one person. On a team, it is one Alibaba key and one settings file per laptop. Why a key on every laptop is the expensive part is in keeping API keys off laptops.

Which Alibaba plan and key does Claude Code need?

Model Studio offers three ways to pay. Each has its own base URL and its own API key.

Way to payBase URL for Claude CodeModels in Alibaba's example
Coding Plan https://coding-intl.dashscope.aliyuncs.com/apps/anthropic, with a key starting sk-sp- qwen3.7-plus in every slot
Token Plan, Personal or Team https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic qwen3.8-max, qwen3.8-flash, qwen3.6-flash
Pay-as-you-go Your workspace's address, such as https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/apps/anthropic, with a key starting sk- qwen3.7-max, qwen3.6-flash

An Alibaba key opens only the endpoint it was made for.

A key sent to another plan's base URL is refused with 401 invalid_api_key.

A request sent with the general Model Studio key and base URL instead of the plan's is billed per token. Alibaba's fix is to delete the general key and keep only the plan's key.

Can a team share one Qwen Coding Plan?

No. Alibaba says a Coding Plan is for your use only and must not be shared. Sharing may lead to restrictions on the subscription.

The plan is also for interactive use in coding tools. Its key must not run automated scripts or application backends, so a CI job is out.

Pro costs $50 a month. It allows up to 6,000 requests per 5 hours, 45,000 a week and 90,000 a month, whichever runs out first. Slots are limited and restocked daily.

It serves only the exact models Alibaba lists. On 8 November 2026 those were qwen3.7-plus, qwen3.6-plus and qwen3.5-plus, beside Kimi, GLM and MiniMax models. Qwen3.8 was not on that list.

For a team that wants only Qwen, Alibaba's Token Plan Team Edition is the simpler answer. It has seats you assign and revoke, usage per member and SSO. Alibaba commits to not using the team's conversation data for model training.

How do you run Qwen in Claude Code through Selan?

Selan does not connect an Alibaba plan or key. It reaches Qwen through an OpenRouter key, which an owner connects once.

Qwen3.8 Max (0902) is the Qwen model Selan lists at OpenRouter. An owner switches it on under Settings → Models.

Developers install the selan CLI, sign in as themselves and name the model:

selan claude --model openrouter:qwen/qwen3.8-max-0902

The part before the first colon is the provider. Everything after it is that provider's own model id, passed through as it is. Another Qwen model OpenRouter serves works the same way, named by its OpenRouter id.

With --model, Selan tells Claude Code the model's real context window. Selan lists 1,000,000 tokens for Qwen3.8 Max, so a session compacts there and not at 200K. If an owner set a lower context limit for your company, it compacts at that instead.

It starts at xhigh effort. If an owner has set a lower Max effort for Qwen, it starts at the highest level left under that ceiling.

To skip the flag, an owner adds Qwen to Claude Code's picker under Settings → Model pickers. It then appears in /model beside the Claude models. The details are in Run any model.

What does a team get beyond the model?

  • One usage record. Qwen turns land beside Claude turns, per person and per repository. Usage per developer shows what an owner sees.
  • One spend limit. An OpenRouter turn is metered, so it counts against a member's limit. See spend limits.
  • No OpenRouter key on a laptop. The key stays on the gateway. A developer holds a Selan session you can revoke.
  • Codex on the same account. selan codex --model openrouter:qwen/qwen3.8-max-0902 uses the same route. See Codex.

A Qwen turn runs on the OpenRouter key and on no other account. If that key is out of credit, the request fails rather than moving elsewhere. All of this is on Providers and models. When OpenRouter alone is the simpler answer is in OpenRouter and Selan compared.

What should you check before switching a team to Qwen?

  • No Ollama route yet. Ollama's cloud model list had no Qwen model on 8 November 2026, so an Ollama Cloud plan does not reach Qwen today. Qwen runs on OpenRouter, per token.
  • Effort and spend. Qwen3.8 Max thinks before it answers, and Selan starts it at xhigh. On OpenRouter, the thinking is metered too.
  • Images. Selan lists Qwen3.8 Max as taking text, images and video.
  • The model must be switched on. A model your company cannot use is refused before Claude Code starts, not at the first request.
Good to know: Anthropic doesn't support routing Claude Code to non-Claude models through any gateway, Selan included. A Qwen session is the gateway's to answer for, not Anthropic's.

Start for free

Free for up to three seats, and the Free plan needs no card.

The short version

The manual setup, the three base URLs and the key errors are Alibaba Cloud Model Studio's Claude Code guide. The Coding Plan's price, limits, models and usage rules are its Coding Plan page. The Token Plan is its Token Plan guide and Team Edition FAQ. All were read on 8 November 2026, as was Ollama's cloud model list. Anthropic's position is its gateway docs, as read on 3 November 2026. What Selan does is its model list, its CLI and its providers, Codex and getting-started docs as they stood on 8 November 2026.