# How to use QwenCloud Token Plan on AnyRouter

> Add your QwenCloud Token Plan key to AnyRouter, then run Qwen4 Max from Claude Code or from your own agent built on the Vercel AI SDK. No fee, and your plan stays the bill.

- Date: November 14, 2026
- Category: guides
- HTML: https://anyrouter.dev/blog/qwencloud-token-plan-byok

## What Token Plan is

[Token Plan](https://www.qwencloud.com/pricing/token-plan?region=ap-southeast-1) is QwenCloud's monthly plan for Qwen models. You pay QwenCloud one flat price instead of paying per token. Its API key starts with `sk-sp-`, and you buy the plan for Singapore.

You can add that key to AnyRouter as a bring-your-own-key (BYOK) key. AnyRouter adds no fee and charges no credits for the requests your key serves. This guide uses `qwen/qwen4-max`.

## Add your key

Copy your key from the **Token Plan** section of QwenCloud's [API Keys page](https://home.qwencloud.com/api-keys). Use the Token Plan key that starts with `sk-sp-`. A pay-as-you-go key does not work here.

**1. Open the key menu.** Go to the [Qwen4 Max page](https://anyrouter.dev/model/qwen/qwen4-max). In the **Upstreams** table, find **QwenCloud Token Plan**, open its **Key** menu and choose **Add your key (BYOK)**.

![The Key menu on the QwenCloud Token Plan row of the Qwen4 Max upstreams table, open on Add your key (BYOK), with an arrow pointing at it.](https://cdn.anyrouter.dev/screenshots/qwencloud-token-plan-add-key-menu-2026-11.jpg)

**2. Paste the key and add it.** AnyRouter checks the key right away. A good key shows **Key works** and the models it can call. Click **Add key**. The key then shows as **Active** and **Verified**. AnyRouter shows only a masked form of it, and you can switch it off or delete it at any time. You can also add it later from the [BYOK page](https://anyrouter.dev/dashboard/byok).

![The QwenCloud Token Plan keys dialog with one masked key marked Active and Verified, a note that these keys cannot be shared so the pool is not available for them, and a Manage all keys in dashboard link.](https://cdn.anyrouter.dev/screenshots/qwencloud-token-plan-keys-dialog-2026-11.jpg)

**3. Know how requests are routed.** Your key answers first, and QwenCloud bills it to your plan. If none of your keys can answer, the donated pool answers from your AnyRouter credits. Token Plan keys cannot be shared, so your key is never added to that pool.

## Option A: a coding agent

Use this when you work in Claude Code every day. The first command installs the AnyRouter CLI. The second starts Claude Code on AnyRouter with `qwen/qwen4-max` as the model for the session. The first run signs you in.

```bash
curl -fsSL https://anyrouter.dev/cli.sh | bash
anyr claude --model qwen/qwen4-max
```

Once Claude Code opens, send a message. It answers as the model you picked.

```text
Claude Code v2.1.325
qwen/qwen4-max with low effort · API Usage Billing
~/my-app
❯ Hello, what model are you?
● I’m the AI assistant in this session, currently running as Qwen4-Max (qwen/qwen4-max).
✻ Worked for 9s · done 10:36 PM
```

_A real Claude Code session on qwen/qwen4-max_

`anyr codex`, `anyr opencode` and `anyr grok` take the same `--model` flag. The full set of options is in the [Claude Code guide](https://anyrouter.dev/docs/guides/claude-code) and the [QwenCloud Token Plan docs](https://anyrouter.dev/docs/features/byok-providers/qwencloud-token-plan).

## Option B: your own agent with the Vercel AI SDK

Use this when you build an agent yourself. It uses the [Vercel AI SDK](https://ai-sdk.dev), not the OpenAI SDK. Install the AnyRouter provider next to it.

```bash
npm install @anyr/ai-sdk-provider ai
```

Then call the model by its AnyRouter id.

```ts
import { createAnyRouter } from "@anyr/ai-sdk-provider"
import { generateText } from "ai"

const anyrouter = createAnyRouter()

const { text } = await generateText({
  model: anyrouter("qwen/qwen4-max"),
  prompt: "Say hi in 3 words.",
})
console.log(text)
```

_agent.ts_

`createAnyRouter()` reads your AnyRouter key from the `ANYROUTER_API_KEY` environment variable. That is your AnyRouter key from the [dashboard](https://anyrouter.dev/dashboard/keys), not the Token Plan key. AnyRouter adds the Token Plan key on the way out.

## See it in your logs

Open the [request logs](https://anyrouter.dev/dashboard/logs). Your request appears within a second or two with its model, tokens and cost.

![The AnyRouter request log with four successful requests for qwen/qwen4-max.](https://cdn.anyrouter.dev/screenshots/qwencloud-token-plan-request-log-2026-11.jpg)

## Limits

QwenCloud allows Token Plan only for interactive use in coding and agent tools, by the person who bought it. Do not use it for automation scripts, application backends or batch calls, and do not share the key.

So Option B is for your own interactive agent and for development work on your own machine. It is not a way to run a product backend. Use a pay-as-you-go key for that.

For the same reason, a Token Plan key can never be donated to the shared pool, and the pool is never used for it. AnyRouter does not offer it.

Qwen4 Max is a preview. QwenCloud has said the preview ends on November 25, 2026. After that date, pick another Qwen model from the [QwenCloud Token Plan docs](https://anyrouter.dev/docs/features/byok-providers/qwencloud-token-plan).
