Qwen4-Max-Preview: Claude Code Setup and November 25 Cutoff

Try Qwen4-Max-Preview through Token Plan with a dedicated key and the correct endpoint. Configure Claude Code, OpenCode, or Qwen Code; verify a repository file read; budget for thinking and answers; and move to a separate pay-as-you-go route before the preview retires. Includes current subscription prices, usage restrictions, and a Qwen3.8-Max fallback.

Contents
Qwen4-Max-Preview: Claude Code Setup and November 25 Cutoff

Use Qwen4-Max-Preview for a time-boxed, interactive coding trial, not an application backend. Connect through Token Plan with its dedicated key, then explicitly select qwen4-max-preview rather than relying on automatic model selection. Prepare a replacement before November 25, 2026, 24:00 UTC+8, when the documented preview period ends.

Availability, configuration, and prices below are current as of 2026-11-12.

What is available, and when does it stop?

Qwen4-Max-Preview is available through Token Plan Personal and Team, with no pay-as-you-go access. The preview runs from November 11, 2026, 10:00 through November 25, 2026, 24:00, both UTC+8. Alibaba says the model will remain unchanged during this period and retire afterward.

That cutoff means November 26 at 00:00 UTC+8, or November 25 at 16:00 UTC. It does not establish a release date for a replacement model.

The model has a 1M-token context window and a maximum output of 393,216 tokens. Thinking and the final answer share that output allowance. It accepts text, images, and video, and supports function calling and structured output.

Alibaba documents compatibility with Chat Completions, Responses, and Anthropic Messages. This does not mean every client exposes every model capability. Treat comparisons with Qwen3.8-Max as tasks to test, not established performance rankings.

A matching model name on Token Plan and Qwen Chat does not establish identical serving settings or tool behavior. Compare results within the same client, with the same tools, prompts, and output budget.

What does Token Plan cost, and what use is allowed?

Budget for a subscription, not a Qwen4 price per million tokens. The Personal Edition overview lists these monthly prices for new subscriptions, excluding introductory offers:

Personal planMonthly list price, USDMonthly allowance
Lite$620,000 Credits
Essential$1045,000 Credits
Standard$1880,000 Credits
Pro$43200,000 Credits

Credits are the subscription’s billing unit, not a fixed number of tokens. Check actual consumption after your trial task rather than converting this table into an assumed API token price.

The Personal FAQ says calls stop when the applicable quota is exhausted; there is no automatic pay-as-you-go overflow. Additional usage bundles and subscription renewal are separate decisions.

Personal Edition currently does not support unsubscription. Do not assume the preview’s retirement cancels your subscription or creates a refund entitlement. Review renewal settings before buying solely for this trial.

Both editions restrict access to interactive coding and agent tools. Automated scripts, application backends, and non-interactive batch jobs are outside the documented scope. The Team Edition policy makes the same interactive-use boundary explicit.

An agent making tool calls during your interactive session is different from a scheduled evaluation script. Use the examples below interactively; do not turn the Token Plan key into a general-purpose backend credential.

Get the dedicated key before configuring a client

Use a Token Plan key with a Token Plan endpoint. A standard Model Studio key or Coding Plan key is not a substitute.

For Personal Edition, subscribe and generate the key on My Subscription in the Token Plan console. Follow the Personal quick start.

For Team Edition, an administrator must assign your account a seat before generating its key. The Team quick start places this step under Member Management.

The following examples assume an installed client and Bash on macOS or Linux. Open a fresh terminal. Run this command, paste your key, and press Enter:

read -rs TOKEN_PLAN_API_KEY && export TOKEN_PLAN_API_KEY

The command does not echo the key. Start your chosen client from this terminal so it receives the exported variable.

Configure Claude Code and verify a real file read

Map the Opus slot to Qwen4-Max-Preview, then select that slot explicitly. Alibaba’s Claude Code configuration uses the following Token Plan mappings.

Run these commands from a repository containing README.md:

unset ANTHROPIC_API_KEY
export ANTHROPIC_AUTH_TOKEN="$TOKEN_PLAN_API_KEY"
export ANTHROPIC_BASE_URL="https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic"
export ANTHROPIC_MODEL="auto"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="qwen3.6-flash"
export ANTHROPIC_DEFAULT_SONNET_MODEL="qwen3.8-flash"
export ANTHROPIC_DEFAULT_OPUS_MODEL="qwen4-max-preview"
export CLAUDE_CODE_SUBAGENT_MODEL="auto"
export CLAUDE_CODE_MAX_CONTEXT_TOKENS="983616"
claude --model opus

For Claude Code, the base URL ends in /apps/anthropic. Do not append /v1.

The --model opus argument selects the mapped main model. This follows Claude Code’s documented model-selection and alias rules.

The remaining mappings still permit other models for helper work. In particular, CLAUDE_CODE_SUBAGENT_MODEL="auto" does not pin every subagent to Qwen4-Max-Preview. Do not describe an entire mixed-model session as a Qwen4-only benchmark.

Enter this prompt interactively:

Read README.md using the file tool. Quote its first heading and summarize the project in two sentences. Do not modify files.

Check for a visible file-read operation and a heading that matches the actual file. Then check Token Plan usage for the same period. A generic greeting proves less than a completed tool round trip.

Next, try one bounded change with a known acceptance test. Record the selected model, effort setting, elapsed time, test result, and Credits consumed.

If Claude Code still appears to use another provider, follow the active-route verification procedure before judging the model.

Fix long output without confusing it with context length

Set a larger output budget when a long response is truncated. Alibaba specifically recommends CLAUDE_CODE_MAX_OUTPUT_TOKENS=64000 for this model.

Exit the client, then restart it from the same Bash terminal:

export CLAUDE_CODE_MAX_OUTPUT_TOKENS=64000
claude --model opus

This is separate from CLAUDE_CODE_MAX_CONTEXT_TOKENS="983616". Neither setting promises a 393,216-token answer. The model ceiling, client configuration, and actual request budget are different limits.

Use OpenCode or Qwen Code instead

Use the configuration for your actual client; their base URLs are not interchangeable. Back up existing configuration and preserve unrelated settings when adding either example.

OpenCode: retain the adapter’s trailing /v1

Use Alibaba’s Anthropic adapter configuration in ~/.config/opencode/opencode.json.

This example uses the vendor’s V1-style provider schema. OpenCode V2’s migration documentation says supported V1 configuration remains accepted. Do not mix native V2 field names into this individual provider object.

{
  "$schema": "https://opencode.ai/config.json",
  "model": "bailian-token-plan/qwen4-max-preview",
  "provider": {
    "bailian-token-plan": {
      "npm": "@ai-sdk/anthropic",
      "options": {
        "baseURL": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic/v1",
        "apiKey": "{env:TOKEN_PLAN_API_KEY}"
      },
      "models": {
        "qwen4-max-preview": {
          "name": "Qwen4-Max-Preview",
          "modalities": {
            "input": ["text", "image"],
            "output": ["text"]
          },
          "limit": {
            "context": 1000000,
            "output": 131072
          }
        }
      }
    }
  }
}

The trailing /v1 is intentional for this adapter, as shown in Alibaba’s OpenCode guide. Do not copy Claude Code’s shorter base URL into this configuration.

The 131072 output value comes from Alibaba’s OpenCode model entry. It is client configuration, not a revision of the model’s published 393,216-token maximum.

OpenCode’s environment substitution reads the exported key through {env:TOKEN_PLAN_API_KEY}. Run opencode, use /models to confirm the selected provider and model, then repeat the file-read prompt.

Qwen Code: set the combined output budget explicitly

Use the OpenAI-compatible Token Plan endpoint in ~/.qwen/settings.json.

Alibaba’s Qwen Code guide documents a default output limit of 32768 for this model. The example below chooses 64000 and medium effort for an initial coding trial; these are explicit choices, not model defaults.

{
  "$version": 4,
  "modelProviders": {
    "openai": [
      {
        "id": "qwen4-max-preview",
        "name": "Qwen4-Max-Preview",
        "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
        "envKey": "TOKEN_PLAN_API_KEY",
        "generationConfig": {
          "samplingParams": {
            "max_tokens": 64000,
            "reasoning_effort": "medium"
          },
          "extra_body": {
            "preserve_thinking": true
          }
        }
      }
    ]
  },
  "security": {
    "auth": {
      "selectedType": "openai"
    }
  },
  "model": {
    "name": "qwen4-max-preview"
  }
}

The envKey field names an environment variable; it does not contain the secret. Qwen Code’s provider reference documents this credential mechanism and the generation settings.

Run qwen from the terminal holding the exported key. Confirm the model with /model, then repeat the same file-read task.

Why can max_tokens truncate the final answer?

For Qwen4-Max-Preview, Chat Completions counts thinking and answer tokens against the same output budget. The API compatibility notice makes max_tokens equivalent to max_completion_tokens for this model.

An illustrative budget shows the consequence:

Combined output budget: 64,000 tokens
Assumed thinking usage: 48,000 tokens
Remaining answer allowance: at most 16,000 tokens

This is arithmetic, not a measured run. A limit previously sized only for the visible answer may now leave too little room.

Thinking is enabled by default. The supported reasoning_effort values are low, medium, and xhigh; the default is xhigh. Do not set reasoning_effort and thinking_budget together.

Start with medium for a bounded trial. Try low for simpler edits, or xhigh when a harder task justifies testing more reasoning. Change one setting at a time and compare completed work, not answer length alone.

Existing Qwen models retain their previous max_tokens behavior. Do not apply the preview’s rule retroactively to every Qwen integration.

Preserve reasoning history in Chat Completions

Keep historical reasoning in its designated field during multi-turn conversations. Qwen4-Max-Preview enables preserve_thinking by default.

Previous assistant reasoning belongs in reasoning_content. Do not append it to the assistant’s content field or turn it into a new user message.

This is a client-adapter responsibility, not a reason to paste hidden reasoning into the chat manually. When evaluating an integration, verify a follow-up turn and a tool round trip, not only the first response.

The Messages, Chat Completions, and Responses comparison explains why HTTP compatibility alone does not establish correct agent behavior.

Match each failure to its cause

For 401 InvalidApiKey: Invalid API-key provided., check the key’s billing plan, subscription status, and completeness first. Confirm the matching endpoint, restart the client, and repeat the file-read test.

For AccessDenied with HTTP 403 and code access_denied after model mapping, inspect Model Studio’s Model Gallery. Alibaba documents Upcoming deprecation status as one possible cause. Check permissions and plan eligibility too; not every 403 means retirement.

For truncated output, check the effective output budget and reasoning effort before changing authentication. Apply the Claude Code or Qwen Code setting above, then repeat the same task.

For quota exhaustion, use the subscription’s quota-management options. Increasing max_tokens does not restore Credits and may increase consumption on the next successful call.

Move to a separate paid route before the cutoff

Use qwen3.8-max as a pay-as-you-go fallback when you need continuity beyond the preview. Alibaba’s pay-as-you-go configuration instructions explicitly list this model and describe usage-based billing. Its model page separately publishes API pricing.

This is an access-path recommendation, not a claim that its coding quality matches Qwen4-Max-Preview.

Create a separate Model Studio API key in the Singapore region using the API-key instructions. Then replace the key, endpoint, main model, and helper mappings.

The following Bash example uses the documented shared Singapore endpoint. Alibaba’s base-URL reference also provides workspace-specific endpoints recommended for production.

read -rs DASHSCOPE_API_KEY && export DASHSCOPE_API_KEY
unset ANTHROPIC_API_KEY
export ANTHROPIC_AUTH_TOKEN="$DASHSCOPE_API_KEY"
export ANTHROPIC_BASE_URL="https://dashscope-intl.aliyuncs.com/apps/anthropic"
export ANTHROPIC_MODEL="qwen3.8-max"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="qwen3.8-max"
export ANTHROPIC_DEFAULT_SONNET_MODEL="qwen3.8-max"
export ANTHROPIC_DEFAULT_OPUS_MODEL="qwen3.8-max"
export CLAUDE_CODE_SUBAGENT_MODEL="qwen3.8-max"
claude --model qwen3.8-max

This deliberately maps every listed slot to the replacement model. Retune helper models later after checking their availability and costs.

Start a new conversation, repeat the file-read task, and verify usage on the paid route. Changing only the model while retaining Token Plan credentials does not move billing to pay-as-you-go.

For an alternative OpenAI-compatible paid route, BetterToken lists qwen3.8-max as of 2026-11-12. Its base URL is https://www.bettertoken.ai/v1; use your own BetterToken key and the documented OpenCode integration. This is separate paid API access, not access to the Qwen4 preview; check current prices before switching.

Ready to optimize your LLM workflow?

Join thousands of developers building faster, smarter, and more cost-effective AI applications with BetterToken.

Get Started for Free