Repository navigation
Unified subscription and API usage with configurable fallback #19695
Replies: 4 comments
Additional use case: Credits & Balances across all current clients and billing accountsI'd like to support the balance-visibility part of this proposal and extend its explicit scope beyond Claude. The existing Usage dashboard helps answer “how much have I used?”; I also want to see “how much usable allowance or credit is left?” without visiting each billing portal. A useful first phase could be a read-only Credits & Balances section in Usage → Limits, also available through Include current clients, while identifying who actually bills each request
This is a request for coverage of existing integrations, not a requirement to add new client integrations. A gateway balance should be attributed to the gateway account, not duplicated under every model vendor available through it. Display and account handlingFor each connected billing account, organization, team, or workspace, show where available:
Keep accounts individually inspectable. Deduplicate the same billing pool across clients, provider instances, hubs, and T3 Connect environments. An optional overview may group compatible currency/unit totals, but must not imply funds are transferable or combine quota percentages, currencies, and restricted credits into one spendable balance. Identify which billing source applies to the selected connection when known. Accuracy and securityUse official documented provider APIs or supported client/SDK reporting where available. A provider supporting usage/cost reporting does not necessarily support balance retrieval. Show Unavailable with the reason and a billing-portal link when reliable retrieval is unsupported; never derive a remaining balance from local tokens or estimated cost. Cache and share readings through the existing Usage infrastructure, with conservative refresh and clear observation times. Request billing/admin access only when needed, protect credentials, and do not scrape billing pages or ask for browser session cookies. This display should not purchase credits, enable auto-reload, change spending limits, or authorize paid fallback. References and overlapping work
The smallest useful outcome is an accurate per-account balance view for supported sources, with explicit unavailable states for the rest. It should make remaining resources visible without promising that every client or account exposes a balance API. |
|
Hey I'm hitting extra costs on fallback switches too since big threads have to replay cold on the backup key or plan (~150K to >1M tokens). I put up a proposal in #44039 to compact them right before 100% so both the switch and post-reset return would stay cheap, just reserving a small headroom buffer. Check it out if it sounds useful and lmk what you think. |
|
Building on @PonkoKobo's suggestion, can we start by showing the ChatGPT credit balance Codex already reports? This was already raised in #17704 and #17705. At the moment, weekly usage can show 0% left even when the account still has credits available. For a first step, I'd suggest:
I would keep this read-only, with spending and fallback behavior unchanged. Claude's spend allowance could follow separately through #19897. |

Uh oh!
There was an error while loading. Please reload this page.
I'd like T3 to show subscription allowances and API funding together, with an optional way to continue on an approved API connection when subscription usage runs out.
In the version I'm using, adding an Anthropic API key to my Claude connection changes it to API billing, and that connection stops showing my Max subscription limits. Both forms of access still exist. Separate provider instances let me select subscription or API billing manually, but they do not solve the Usage display: Limits shows the subscription's Session, Weekly, and model-specific weekly allowances without a separate API credit balance. The Cost metric is an API-equivalent estimate, not a reading of funds remaining. I'd like both access types represented together in Usage, rather than only being available as separate connections in settings.
This applies to people who buy API access as well as people who receive credits with a subscription. Claude Max and Team currently include monthly API credits. Those credits are separate from subscription usage and can cover the Agent SDK with an API key from the linked Console organization. Other providers and API services have different billing arrangements, so the feature should support those differences rather than assume every API account has a prepaid balance.
What Usage should show
Figures should identify the provider, account or organization, and workspace where needed. Show when they were checked and distinguish provider-reported balances from estimates. Use the provider's authoritative total and flag inconsistent or differently timed components instead of deriving a precise total from rounded or stale values. If a provider doesn't expose a balance, show that limitation and link to its billing page. Keep subscription cost estimates separate from money actually charged to an API account.
Billing options to support
The settings should represent monthly promotional credits, a fixed prepaid amount, prepaid credits with auto-reload, uncapped pay-as-you-go billing, and pay-as-you-go billing with a spending cap. Support direct provider accounts and third-party API services through the same interface where their reporting and controls allow it.
A promotional balance is not the same as permission to buy more credits or incur additional charges. Users should choose which funding sources T3 may use. Where a provider decides the order in which promotional and purchased credits are consumed, show that order and any limits on T3's control over it.
Reflect an existing provider auto-reload policy accurately. Enabling fallback should not itself enable auto-reload, raise a cap, purchase credits, or approve uncapped spending. Changes that can create additional charges need a separate, explicit choice.
Optional fallback
Offer Off, Manual, and Automatic modes. A user could continue with a manual switch, or configure an ordered set of eligible subscription accounts and API connections. Multiple subscriptions should be supported when the user explicitly chooses that order.
In Automatic mode, start with the preferred subscription. On a confirmed subscription usage limit, check the allowed fallback's funding and spending policy. Continue only when that policy permits the request. Preserve the conversation and model where the destination supports them, and clearly identify any unavoidable model or context change before proceeding.
If subscriptions and permitted API funding are exhausted, stop with one clear message explaining what ran out and when usage or credits refresh, if those dates are known. A network error, overload, or ordinary API rate limit should not be mistaken for subscription exhaustion or trigger a billing change.
After a subscription reset, an optional setting should return new work to the subscription after checking that allowance is available. Users should also be able to stay on their selected API connection or switch manually.
Spending controls and reliable readings
Allow spending caps and alerts per connection, with optional conversation, daily, and monthly limits. Account for concurrent requests and pending spend. Explain the difference between a T3 budget and a provider-enforced spending limit; delayed usage reporting and requests already in flight can affect when a local stop takes effect.
Refresh readings when Usage opens, after relevant turns, and before an automatic billing switch. Show stale or unavailable data explicitly. Unknown funding should not silently authorize paid fallback. A failed refresh should retain the previous reading as stale, rather than hide the subscription or present it as a current balance.
The normal conversation picker should be able to present one Claude option with its billing policy behind it, while Usage shows the separate subscription and API details. The same behavior should work for other supported providers and across desktop, web, mobile, and connected environments.
Claude subscription plus direct Agent SDK API credits would be a useful first implementation. The design should leave room for other providers, third-party services, and the billing types above.
All reactions