Repository navigation
Feature Request: Support Qwen Cloud / DashScope pay-as-you-go API balance and usage #3553
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.Issue quality rating does not apply to this item.
Description
Summary
Currently, CodexBar's Qwen Cloud provider (.qwencloud) exclusively tracks the individual Token Plan (Personal/Solo) via web console session cookies from home.qwencloud.com (reporting rolling 5-hour and 7-day rate windows).
However, many users access Qwen models (such as Qwen 2.5 / Qwen 3 Coder, Qwen-Max, and Qwen-Plus) via standard pay-as-you-go API keys (DashScope / Qwen Cloud API keys) billed against an account cash balance or credit card, rather than a fixed Token Plan subscription.
I would like CodexBar to support tracking pay-as-you-go account balance and spend for Qwen Cloud / DashScope accounts, similar to existing API balance providers like DeepSeek (deepseek) and Doubao (doubao).
Current Behavior
- Enabling
qwen-cloudrequires web cookies fromhome.qwencloud.comand attempts to fetchzeldaHttp.apikeyMgr./tokenplan/personal/api/v2/*endpoints. - In
QwenCloudProviderDescriptor.swift,supportsCreditsandsupportsTokenCostare hardcoded tofalse. - Accounts without an active Token Plan subscription cannot view their remaining account balance or API spend.
Expected Behavior
- Balance & Credit Display: Support displaying available account balance / prepaid credits for pay-as-you-go accounts.
- API-First Authentication: Allow configuring an API key (or Alibaba Cloud RAM / BSS OpenAPI credentials if the inference gateway lacks a direct balance endpoint) without requiring browser cookie imports.
- Graceful Handling: If an account has no Token Plan subscription but has a valid pay-as-you-go balance, show the balance instead of failing or reporting missing token plan data.
Relevant Context
- PR feat(providers): add Qwen Cloud individual token-plan provider #2361 added the initial Qwen Cloud Token Plan provider.
- Issue Alibaba Coding Plan: INTL accounts cannot fetch usage — no working auth path #612 investigated DashScope API endpoints and noted that inference keys on
coding-intl.dashscope.aliyuncs.comreturn 404 for/v1/usageand/v1/quota. A billing/balance integration may need to target Alibaba Cloud BSS OpenAPI (QueryAccountBalance) or Qwen Cloud console balance endpoints. - PR Add China API models.dev pricing lookup #2376 added China API pricing lookups for session cost attribution.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.Issue quality rating does not apply to this item.
Activity
clawsweeper commentedon Sep 11, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed September 11, 2026, 3:33 AM ET / 07:33 UTC.
Summary
Keep open: pay-as-you-go billing remains unsupported, and the related work does not supply it. This is a distinct provider feature requiring a verified billing contract and authentication decision; the repository profile also prohibits automatic closure.
Reproducibility: not applicable. this requests new billing coverage; current source and released documentation explicitly limit Qwen support to Token Plan quotas.
Ways to help us reproduce this
Maintainer decision needed
Why: That choice expands authentication and account scope beyond the existing Token Plan provider, and VISION.md requires sign-off for such changes.
Next step
Confirm the acceptable billing credential scope and obtain a documented or redacted working balance response before commissioning implementation.
Review details
Best possible solution:
Use a verified, least-privilege billing API and shared provider presentation, clearly separating account currency balances from Token Plan credits while preserving existing cookie-based subscriptions.
Do we have a high-confidence way to reproduce the issue?
Not applicable: this requests new billing coverage; current source and released documentation explicitly limit Qwen support to Token Plan quotas.
Is this the best way to solve the issue?
Unclear: API-first billing fits the product, but the endpoint and credential contract must be verified before choosing an implementation; toggling capability flags alone would not provide balances.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning medium; reviewed against 4cfb60692bdd.
Label changes
Label changes:
P2: This is useful, bounded provider coverage without an established regression or blocked supported setup.impact:other: Pay-as-you-go users lack account balance and spend visibility in CodexBar.issue-rating: 🌊 off-meta tidepool: Current issue advisory state selects this label.clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.clawsweeper:needs-maintainer-review: Current issue advisory state selects this label.clawsweeper:needs-product-decision: Current issue advisory state selects this label.Label justifications:
P2: This is useful, bounded provider coverage without an established regression or blocked supported setup.impact:other: Pay-as-you-go users lack account balance and spend visibility in CodexBar.Evidence reviewed
What I checked:
Sources/CodexBarCore/Providers/QwenCloud/QwenCloudProviderDescriptor.swift:88, 4cfb60692bdd)docs/qwen-cloud.md:51, dca9c5f4b7a2)VISION.md:19, 4cfb60692bdd)Sources/CodexBarCore/Providers/QwenCloud/QwenCloudProviderDescriptor.swift, c2701d241f97)Likely related people:
How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.steipete commentedon Sep 24, 2026
Current main still supports Qwen Cloud Token Plan quotas only. Alibaba documents QueryAccountBalance, but its official SDK uses signed AccessKey billing requests, not a DashScope inference bearer key. The response is an Alibaba account balance, not Qwen-specific spend. Keeping this open pending a scoped billing-auth/signing design and confirmation of the desired account/currency presentation.
steipete commentedon Oct 7, 2026
Thanks @mvicari.
QueryAccountBalanceexists, but uses signed AccessKey billing requests and returns account-wide funds rather than Qwen spend. The plugin host has no Alibaba signer. Keeping this open for that capability and an explicit account-balance presentation.The official API documentation exposes
AvailableAmount,AvailableCashAmount, credit limits, and CNY/USD/JPY currency, withbss:DescribeAcccountpermission. The official SDK declares AccessKey-authenticated RPC/form POST.Plugins/ProviderPluginManifest.swift:25andPlugins/ProviderPluginHTTPResponse.swift:272expose static auth headers, not an Alibaba signer. The owner’s missing-host-capability stop rule applies; no native billing implementation was added.Maintainer decision: signed AccessKey billing requests and account-wide funds are outside what the plugin host supports today, and nobody is working on an Alibaba signer, so I am closing this as not planned for now. A PR adding that capability is welcome and I will reopen.