Alibaba sells two Token Plans, both with sk-sp- keys, and a key works only
on its own host. qwen-token-plan is the Qwen AI platform's
(token-plan.maas.qianwenaiapi.com), but its website and keys links pointed
at Bailian's console. Bailian's own plan
(token-plan.cn-beijing.maas.aliyuncs.com) had no preset.
What changed:
- presets: new bailian-token-plan (chat /compatible-mode/v1, Anthropic
/apps/anthropic, decide on /compatible-mode/v1/systemone, models from the
docs' list, shared with qwen-token-plan as alibabaPlanModels).
qwen-token-plan's links now point at the Qwen AI platform. New
qwen-decision for Qwen's pay-as-you-go decision model at
maas.qianwenaiapi.com/compatible-mode/v1/systemone. bailian-decision shows
the Bailian icon instead of Qwen's.
- decide: bailianDecides also matches the bare maas.qianwenaiapi.com host.
A chat preset that also decides on a Bailian/Qwen host (bailianApart)
lists decision-model-preview as its only decision model, so it is offered
for routing groups and never given to an agent as a chat model.
- gateway: dashScope() covers bailian-token-plan and maas.qianwenaiapi.com.
- CLI help, docs/reference.md and the import docs (en, zh, ja) name the new
preset.
Usage: neither plan's docs give a usage or quota API; the remaining quota
is only on the console (百炼控制台 Token Plan > 我的订阅, Qwen 工作台
token-plan/individual), which needs a browser session. So no usage card is
added. An exhausted plan's 429 insufficient_quota is already read as out of
credit.
Not tried against the real API: no Bailian or Qwen key was available. The
stand-in is an httptest server copying the docs' systemone curl (Bearer
sk-sp-, model decision-model-preview) and its error table (401 on a wrong
key, 422 on a bad body). qwen-decision sends "Authorization: Bearer <key>";
the Qwen doc's curl shows the bare key, which is untested.
Run:
- go test -tags nogui -count=1 ./... (temp HOME)
- TestBailianTokenPlan, TestQwenDecisionPreset and TestDashScopeHosts fail
with the old decide.go and gateway.go swapped in
- gofmt -l; GOOS=linux and GOOS=windows go vet -tags nogui on .
internal/provider, internal/gateway, internal/gui
- GUI: system-one, add-sheet, gateway-decide-info, routing-kind tests in
chromium and webkit (20 pass)