Skip to content

feat(server): route Claude usage and reset credits through a usage source (superseded) - #39

Closed
orbitingflea wants to merge 2 commits into
mainfrom
feat/claude-usage-via-t3switch
Closed

orbitingflea wants to merge 2 commits into
mainfrom
feat/claude-usage-via-t3switch

Conversation

@orbitingflea

@orbitingflea orbitingflea commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Superseded by #42.

orbitingflea and others added 2 commits October 31, 2026 18:28
Hub (CLIProxyAPI-compatible, e.g. t3switch) Claude accounts showed usage
but never their reset credits, and could not redeem one, while native
Claude logins and Codex hub accounts could.

The hub Claude usage read now asks for the cedar_ember block and maps it
with claudeResetCreditsToContract. Redemption posts the claim through the
hub's api-call to the account's own organization (organization_uuid from
auth-files), with a request id derived from account and grant so retries
deduplicate, then clears the hub cooldown as for Codex. The native and hub
paths share claim validation and answer mapping, so 429, 401/403,
cooldown and unavailable read the same on both. The hub's Claude user
agent is now the CLI's, which Anthropic requires for reset eligibility.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Re-applies PR #34 (Claude reset credits for hub accounts) without its
hard-coded user agent; t3switch sets the headers Anthropic sees.

Directly signed-in Claude logins now read plan usage and reset credits
from the t3switch account with the same email and organization, and
redeem through it too, so T3 sends none of these requests to Anthropic
itself. The CLI probe no longer asks Claude for usage. A login no
t3switch source holds shows usage as unavailable and cannot redeem.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 31, 2026 18:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:L labels Oct 31, 2026
@orbitingflea orbitingflea changed the title feat(server): route Claude usage and reset credits through t3switch feat(server): route Claude usage and reset credits through a usage source (superseded) Oct 31, 2026
@orbitingflea
orbitingflea deleted the feat/claude-usage-via-t3switch branch October 31, 2026 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants