跳到正文Skip to content
Agent J Beta
菜单Menu
中文EN
登录Sign in

搜索文档和页面Search docs and pages

文档Docs

用阿里云百炼 Token PlanUse an Alibaba Cloud Bailian Token Plan

在中国大陆用阿里云百炼 Token Plan(千问)驱动 Agent J:key 贴进手机密钥卡、马上核对,用 OpenCode 或阿里自家的 Qwen Code,默认千问 3.8 Max 能看截图;买之前先看清数据条款。Run Agent J in mainland China on an Alibaba Cloud Bailian Token Plan (Qwen): paste the key into the phone key card and it is checked at once, use OpenCode or Alibaba's own Qwen Code; the default Qwen 3.8 Max reads screenshots. Read the data terms before you buy.

阿里云百炼是阿里云的模型平台。Token Plan 个人版是它给编程工具用的包月套餐,以千问为主,也带智谱 GLM 和 DeepSeek 的模型。

还没决定用哪家?先看按你用的模型选。安装、配对手机这些每家都一样的事,看安装和手机上怎么用。

适合谁

  • 在中国大陆,已经是百炼用户:直接用。
  • 想用阿里自家的 Qwen Code,或者希望贴完 key 马上知道对不对:选它。
  • 还什么都没买、只想要一个最省事的:我们首推火山方舟。
  • 在香港或海外:阿里国际站只有 Coding Plan Pro、每天限量,Agent J 也还没有它的一键配置。海外建议用 Kimi。

开通与套餐

  1. 用实名认证过的阿里云账号,打开百炼订阅页 https://bailian.console.aliyun.com/cn-beijing/subscription/overview 。
  2. 订阅 Token Plan 个人版。分 Lite、Essential、Standard、Pro 四档,按 Credits 计量,每月额度分别是 11,500、25,500、45,000、180,000。只跑一个 Agent,选 Lite 或 Essential 就够;想同时跑 3 到 4 个,从 Standard 起。

价格以订阅页为准,四档的月价见百炼订阅页;agentj provider bailian 也会打印我们 2026-10-15 核对到的价格。官方说明见Token Plan 个人版快速开始。

买之前先看清这几条条款:

  • 只能由你本人在编程工具里交互使用,不能拿去跑自动化脚本、当应用后端或批量调用,否则套餐或 key 可能被停用。
  • 订阅期间,你给模型的输入和模型的输出会被阿里云用来改进模型。 涉及隐私的资料要慎重。
  • 只限订阅人本人用,不能分享。

拿 key

  1. 在百炼控制台新建一把套餐专属 API Key。
  2. 先别复制给任何人。 等手机上弹出密钥卡再贴。

把 key 交给 Agent J

跟电脑上的 Agent 说一句:帮我接上阿里百炼 Token Plan。它会这样做:

  1. 运行下面这条,把百炼写进 OpenCode 的设置。你原来的设置一项都不动。
agentj provider bailian
  1. 运行它打印出来的那条密钥卡命令。手机上会弹出密钥卡,名称是 BAILIAN_TOKEN_PLAN_API_KEY,你只把 key 贴进卡里。贴完 Agent J 马上用百炼只读的模型列表核对一次,不花 Credits。
  2. 重启后台服务,再切到千问 3.8 Max:
agentj service restart
agentj agent switch opencode --model bailian-token-plan-personal/qwen3.8-max

密钥卡怎么用,见手机上录入密钥。

能用的 AI 编程工具

两个都能用,同一把 key:

  • OpenCode(默认):上面那几步就是。没装 OpenCode 的,见装好 AI 命令行工具。
  • Qwen Code(阿里自家的 qwen,Apache-2.0 开源):要 0.25 或更新,安装要 Node.js 20 以上,见千问 Qwen Code。它的免费登录 2026-04-15 已经停了,key 就是它的登录:用上面那张 BAILIAN_TOKEN_PLAN_API_KEY 密钥卡。然后切过去:
agentj agent switch qwen

Agent J 只在内存里把 key 交给 Qwen Code,不往你的 Qwen 设置里写东西;你自己配过 Qwen Code 的,以你的设置为准。Qwen Code 只支持独立会话,每个权限请求都发到你手机上。更多见换成 Qwen Code。

模型与看图

用途模型能看截图
默认qwen3.8-max能(实测)
省额度qwen3.8-flash能(实测)
也能看图qwen3.7-plus、qwen3.6-flash能
不要当默认qwen3.7-max不能(实测)
纯文本glm-5.3、deepseek-v4-pro不能

OpenCode 里模型写成 bailian-token-plan-personal/<模型>。“实测”指 2026-10-16 我们在电脑上发一张软件截图,让模型读出弹窗标题、错误码、按钮上的字和表格里的金额,OpenCode 和 Qwen Code 都全部读对。用 Qwen Code 时,手机上发 /model 会列出套餐里的模型,能看图的名字后面带着标记。

用纯文本模型时,手机截图、浏览器自动化看到的页面,模型都读不到。换回 qwen3.8-max 就行。

常见坑

  • 密钥卡核对没通过:key 没复制完整,或者贴的不是套餐专属 key。回控制台重新完整复制一次,再弹一次密钥卡。
  • 选了 qwen3.7-max 以后截图看不到:它是纯文本模型,换回 qwen3.8-max。
  • 手上是老的 Coding Plan(key 以 sk-sp- 开头):也能用,让 Agent 运行 agentj provider bailian --plan coding-plan。它没有 Max 模型,key 也没法事先核对。
  • 定时任务、客服 bot:条款只允许你本人交互使用。没人看着的活要用按量付费的 key,Agent J 不会把 Token Plan 的 key 交给它们。

切回原来的工具

随时跟 Agent 说“切回 Claude Code”(或 Codex),它会先检查、能用才切。也可以自己在电脑上运行:

agentj agent switch claude

想原样换回上一次切走前的那个:

agentj agent switch --undo

切换的细节见换 AI 编程工具。

技术细节:地址和名字
  • OpenCode 里的服务商名是 bailian-token-plan-personal。
  • 只读核对用的模型列表:https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/models;Qwen Code 用的 OpenAI 兼容地址:https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1。
  • key 的环境变量名:BAILIAN_TOKEN_PLAN_API_KEY;老的 Coding Plan 是 BAILIAN_CODING_PLAN_API_KEY。

Alibaba Cloud Bailian (Model Studio) is Alibaba Cloud's model platform. Its Token Plan, personal edition, is a monthly plan for coding tools: mostly Qwen, plus models from Zhipu GLM and DeepSeek.

Not sure which vendor to pick? Start at Choose by your model. Installing and pairing your phone are the same for every vendor: see Install and Using it on your phone.

Who it is for

  • Mainland China and already a Bailian user: use it.
  • You want Alibaba's own Qwen Code, or want to know the moment you paste the key whether it works: pick this one.
  • Nothing bought yet and you just want the easiest start: we recommend Volcano Ark first.
  • Hong Kong or abroad: Alibaba's international site only sells a Coding Plan Pro with a daily allocation, and Agent J has no one-step setup for it yet. Abroad we suggest Kimi.

Sign up and pick a plan

  1. With an identity-verified Alibaba Cloud account, open the Bailian subscription page https://bailian.console.aliyun.com/cn-beijing/subscription/overview .
  2. Subscribe to Token Plan (personal). It has four tiers, Lite, Essential, Standard and Pro, metered in Credits: 11,500, 25,500, 45,000 and 180,000 Credits a month. For one Agent, Lite or Essential is enough; to run 3 to 4 Agents at once, start at Standard.

The subscription page is authoritative for prices: it lists the monthly price of all four plans, and agentj provider bailian prints the prices we checked on 2026-10-15. Official guide: Token Plan personal quick start.

Read these terms before you buy:

  • Only you, working interactively in a coding tool. No automation scripts, app back ends or batch calls, or the plan or key may be suspended.
  • While you subscribe, what you send the model and what it answers are used by Alibaba Cloud to improve its models. Be careful with private material.
  • For the subscriber only; no sharing.

Get the key

  1. In the Bailian console, create the plan's own API key.
  2. Do not copy it to anyone yet. Wait for the key card on your phone and paste it there.

Hand the key to Agent J

Tell the Agent on your computer: connect my Alibaba Bailian Token Plan. It will:

  1. Run this to add Bailian to OpenCode's settings. Nothing you already set is changed.
agentj provider bailian
  1. Run the key card command it prints. A key card named BAILIAN_TOKEN_PLAN_API_KEY opens on your phone; paste the key there and nowhere else. Agent J checks it right away against Bailian's read-only model list, without using Credits.
  2. Restart the background service, then switch to Qwen 3.8 Max:
agentj service restart
agentj agent switch opencode --model bailian-token-plan-personal/qwen3.8-max

How the key card works: Admin rights and API keys, from your phone.

AI coding tools

Both work with the same key:

  • OpenCode (the default): the steps above. OpenCode not installed yet? See Set up AI command-line tools.
  • Qwen Code (Alibaba's own qwen, Apache-2.0): version 0.25 or newer; installing it needs Node.js 20 or newer, see Qwen Code. Its free sign-in ended on 2026-04-15, so the key is its login: the same BAILIAN_TOKEN_PLAN_API_KEY key card. Then switch:
agentj agent switch qwen

Agent J hands the key to Qwen Code in memory only and writes nothing into your Qwen settings; if you set Qwen Code up yourself, your settings win. Qwen Code runs in independent sessions only, and every permission request goes to your phone. More: Switch to Qwen Code.

Models and screenshots

UseModelReads screenshots
Defaultqwen3.8-maxYes (tested)
Saves Creditsqwen3.8-flashYes (tested)
Also read imagesqwen3.7-plus, qwen3.6-flashYes
Not as the defaultqwen3.7-maxNo (tested)
Text onlyglm-5.3, deepseek-v4-proNo

In OpenCode, models are written bailian-token-plan-personal/<model>. Tested means: on 2026-10-16 we sent a software screenshot and asked for the dialog title, the error code, the button text and an amount in a table; in OpenCode and in Qwen Code it got all of them right. With Qwen Code, /model on your phone lists the plan's models and marks the ones that read images.

With a text-only model, a screenshot from your phone or a page the browser automation needs to look at never reaches the model. Switch back to qwen3.8-max.

Common problems

  • The key card check fails: the key was not copied whole, or it is not the plan's own key. Copy it again in full from the console and open the key card again.
  • Screenshots stopped working after picking qwen3.7-max: it is text only; switch back to qwen3.8-max.
  • You have the older Coding Plan (keys starting with sk-sp-): it works too; ask the Agent to run agentj provider bailian --plan coding-plan. It has no Max model, and its key cannot be checked in advance.
  • Scheduled tasks, support bots: the terms allow only you, working interactively. Unattended work needs a pay-as-you-go key; Agent J never hands the Token Plan key to them.

Switch back

Tell the Agent at any time: switch back to Claude Code (or Codex). It checks first and switches only if that works. Or run it on the computer yourself:

agentj agent switch claude

To go straight back to the tool you used before the last switch:

agentj agent switch --undo

Details: Switch AI coding tool.

Technical details: addresses and names
  • In OpenCode the provider is bailian-token-plan-personal.
  • Model list used for the read-only check: https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/models; the OpenAI-compatible address Qwen Code uses: https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1.
  • Key variable: BAILIAN_TOKEN_PLAN_API_KEY; the older Coding Plan uses BAILIAN_CODING_PLAN_API_KEY.

这一页的 Markdown 原文This page as Markdown: zh.md · en.md