Skip to content

Account Pooler: show and spend Claude and Codex usage-limit resets per account #4157

Description

@rebryk

The workflow

I pool several Claude and ChatGPT subscriptions through the Account Pooler. Both providers now grant accounts usage-limit resets: ChatGPT gives Codex users "Full reset" credits, and Claude runs grants such as "Claude Opus 5.5 launch: one usage-limit reset for Pro and Max". When a pooled account hits its limit, I want to spend one of its resets from bb and keep working.

Today I have to sign in to that exact account in the Codex CLI (/status → Redeem reset) or Claude Code (/limit-reset), which defeats the point of pooling. bb also never shows which accounts hold resets or when they expire, so resets expire unused.

What happens today

  • Account Pooler settings, bb pool account list, and the status.get / account.list RPCs show usage windows but nothing about resets.
  • bb has no way to spend a reset for a pooled account.
  • Observed on bb 0.43.4 (desktop app, macOS). A read-only query of my pool found unused resets on most accounts, one of which expires in 11 days. bb showed none of them.

The pool already fetches both usage endpoints that carry reset data but ignores it:

  • ChatGPT /wham/usage returns rate_limit_reset_credits; the pool parses only plan_type and rate_limit (codex-adapter.ts#L185-L196).
  • Claude /api/oauth/usage returns reset grants only when asked with cedar_ember=1, and the pool requests the plain URL (hub.ts#L42).

What you would expect

  • Each OAuth account shows how many resets it holds and when the next one expires: a badge on its row in settings, a Resets line in the account dialog, a Resets column in bb pool account list, and resetCredits in status.get / account.list.
  • Use reset… in the account menu and dialog, bb pool account reset-limits <id> --yes, and an account.resetLimits RPC spend one reset and refresh the account's usage. A spent reset cannot be restored, so the UI asks for confirmation and the CLI refuses to run without --yes.

Prototype: main...rebryk:bb:account-pool-reset-credits (based on 94d77da). Typecheck, lint, and the plugin's 319 tests pass, including 8 new ones. I also ran the new adapters read-only against live accounts through the pool's own transport. They reported the same counts and expiries as the providers; nothing was spent.

Provider APIs the prototype uses:

  • ChatGPT, the same endpoints the open-source Codex CLI uses (rate_limit_resets.rs#L124-L154):
    • The count comes from rate_limit_reset_credits.available_count in /wham/usage, which the pool already fetches.
    • The expiry comes from GET /wham/rate-limit-reset-credits, requested only when the count changes.
    • A reset is spent with POST /wham/rate-limit-reset-credits/consume {redeem_request_id}, which answers reset | nothing_to_reset | no_credit | already_redeemed. nothing_to_reset keeps the credit.
  • Claude, the calls Claude Code's /limit-reset makes:
    • GET /api/oauth/usage?cedar_ember=1&skip_spend=1 adds a cedar_ember block with grants[].resets_left, grants[].ends_at, and next_grant_id. The pool uses this URL for its regular usage refresh, so there are no extra requests.
    • A reset is spent with POST /api/organizations/{organization_uuid}/reset_rate_limits {program: "cedar_ember", grant_id, request_id}. The organization UUID comes from /api/oauth/profile.

Each attempt sends a fresh idempotency key. After a successful reset the pool clears the account's hold and refreshes its usage.

Context and alternatives

Open questions:

  1. Claude user agent. Claude only reports reset grants to Claude Code clients. Without a claude-cli/… user agent the block reads {"eligible": false, "ineligible_reason": "surface"}. The prototype sends claude-cli/2.1.280 (external, cli) on the pool's own Claude usage, profile, and claim requests; the tokens are already Claude Code OAuth tokens. Alternatives:
    • forward the user agent of the most recent Claude Code request the pool proxied, or
    • ship ChatGPT only and leave Claude until there is a sanctioned way.
  2. Stability. The Claude endpoints are undocumented and experiment-gated, and they may change. The ChatGPT endpoints are visible in the open-source client.
  3. Scope. Provider Usage (usage.fetch) does not carry resets in the prototype. That could follow.

A third-party plugin cannot do this, because only the Account Pooler holds the account tokens. Related: #3243.

Once this is signed off, I'd like to open the PR myself. I'm not in .github/APPROVED_CONTRIBUTORS yet.

  • I searched open and closed issues for the same request.
  • If an agent wrote this, the body ends with > AGENT GENERATED.

AGENT GENERATED

Activity

  1. added
    providers
    on Sep 23, 2026
  2. bb-slop-cop commented on Sep 23, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Applied Type Feature, Priority Medium, Effort High, and label providers. All fields were previously unset; classification was verified after writing.

    This adds reset visibility and redemption across provider integrations, RPCs, CLI, and UI. Provider tools offer a workaround, while the new actions and integration decisions make the effort High.

    No reproduction report or pull request: the final Type is Feature, so this rule skips bug reproduction and fixes.

    AGENT GENERATED

  3. added
    provider-claude-code
    provider-codex
    on Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    provider-claude-codeprovider-codexproviders

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions