Alibaba Token Plan Provider
August 3, 2026 ยท View on GitHub
The Alibaba Token Plan provider tracks Team credits and Personal/Solo rolling-window usage from the Alibaba Cloud console.
Features
- Token-plan usage display: Shows used, total, and remaining token-plan credits when Bailian returns quota totals.
- Personal/Solo windows: Shows 5-hour and 7-day usage, reset times, and tier-specific quota totals.
- Cookie-based auth: Uses browser cookies or a pasted
Cookie:header. - Expiry awareness: Shows the nearest token-plan expiration date as the reset time when the subscription summary includes it.
Setup
- Open Settings -> Providers
- Enable Alibaba Token Plan
- Choose the matching Gateway region Team or Personal/Solo variant
- Leave Cookie source on Auto (recommended)
Manual cookie import (optional)
- Open the Token Plan page using Open Token Plan in settings
- Copy a
Cookie:header from the quota request in your browser's Network tab. For Personal/Solo, use the.../tokenplan/personal/api/v2/usagerequest so the header is scoped to the quota host. - Paste it into Alibaba Token Plan -> Cookie source -> Manual
How it works
- Team variants fetch
GetSubscriptionSummaryfrom the selected international or mainland console and parse the credit pool without probing Personal endpoints. - Personal/Solo variants fetch
usage,subscription, andquota-configfrom the rolling-window API. International usesbailian-singapore-cs.alibabacloud.com; mainland usesbailian-cs.console.aliyun.com. - Browser cookies are rebuilt independently for the dashboard and quota hosts. Personal/Solo requests use the
quota-host cookie header. The dashboard
sec_tokenis resolved best-effort and appended when available (some accounts getBailianGateway.Workspace.NotAuthorisedwithout it); requests still proceed without it. - Config region values are
intlandcnfor Team, orintl-personalandcn-personalfor Personal/Solo. - Supports
ALIBABA_TOKEN_PLAN_HOSTandALIBABA_TOKEN_PLAN_QUOTA_URLfor testing endpoint overrides
Limitations
- Alibaba Token Plan currently supports the Bailian web-cookie path only
- API-key auth, token cost summaries, and automatic status polling are not supported
- Live provider auth is not exercised by the test suite; endpoint changes rely on reporter confirmation after release
Troubleshooting
"No Alibaba Token Plan session cookies found in browsers"
Log in at https://bailian.console.aliyun.com/cn-beijing?tab=plan#/efm/subscription/token-plan in Chrome, then refresh CodexBar.
"Alibaba Token Plan cookie header is invalid"
The pasted header is empty or not a valid Cookie header. Re-copy the request from the Token Plan page after logging in again.
"Alibaba Token Plan login required"
Your Bailian session is stale. Sign out and back in on the Bailian console, then refresh CodexBar.
Empty subscription summary
If Bailian returns TotalCount: 0, CodexBar keeps the provider visible but does not show a quota window because the account has no active token-plan subscription summary to graph.