Files
magpie/docs
yetone fc615339f0 provider: Alibaba Cloud Token Plan quota read with the account's AccessKey; intl Token Plan preset (pppMathew on X, #2940)
Cause: a Token Plan sk-sp- key only authorizes inference. The plan's
usage sits on the Bailian console gateway, which wants a console token
(the key gets BailianGateway.Login.NotLogined) that Alibaba's own `bl` CLI
makes from the account's AccessKey through GenerateCLIAccessToken (ACS3
signed). magpie had no such path, so the usage card showed no quota.

Change:
- alibaba_usage.go: ACS3-HMAC-SHA256 signing, the console token (kept 20
  minutes per AccessKey and region, made again once on NotLogined), the
  personal plan's usage API, and per<N><Unit>Percentage/ResetTime read as
  5 hours / Weekly / Month windows. Hooked in as AccessKeyVendor "alibaba"
  (editor asks AccessKey ID and Secret, a keyless card says so),
  accountPlanOf (routing), PlanQuotas and the key card tag.
- Hosts: token-plan.cn-beijing.maas.aliyuncs.com (bailian-token-plan) and
  the new token-plan.ap-southeast-1.maas.aliyuncs.com preset
  alibaba-token-plan (Alibaba Cloud international Token Plan, #2940), also
  an OpenCode import target.
- Editor hint in zh, zh-TW, ja, de; docs (providers-accounts, reference).

Not covered: qwen-token-plan (Qwen AI platform) and qwencloud-token-plan
have no AccessKey route (browser-session console, #5829); team plans.

Run on mica at this tree: go test ./internal/gui ./internal/provider ok;
go vet darwin, linux nogui, windows on provider/gui clean; GUI files
i18n-keys, i18n-en-no-cjk, tencent-access-key, volc-access-key,
usage-access-key-card, tencent-cloud in chromium and webkit: 60 of 64 pass,
the 4 reds are tencent-cloud's "region clicked right after the strip
scrolled", red the same at origin/main 319753d89 (filed: #4321, #4399,
#4625). Broke it by hand: dropping the *100 on the percentage turns
TestAliReadWindows and TestAliPlanQuotas red.
Tests never reach the network (httptest behind a rewriting transport).

Not tried: no real Alibaba Cloud account, so neither the mint nor the
usage reply was seen live; the field names and the envelope come from the
official client's source. The international gateway host
(bailian-singapore-cs.alibabacloud.com) and the RAM-user case are the least
certain. The full suite was not run before the tag.
2026-11-12 01:20:52 +08:00
..