Repository navigation
Read a gpt-load pool's balance for Anthropic channels - #7
Merged
Merged
Conversation
Anthropic channels had no balance branch, so the gpt-load channel always
showed $0 and "Never". Type 14 now reads GET {base_url}/v1/pool/balance with
the channel key and stores the weekly remainder; the official Anthropic host
keeps the unsupported answer. Errors, an inactive key, or a missing or
negative balance store nothing, so a failed estimate cannot become a zero
balance that auto-disables the channel.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
gpt-load-claudeis an Anthropic channel (type 14).updateStandardChannelBalancehad no branch for type 14, so the balance always showed $0 / "Never".Change
GET {base_url}/v1/pool/balancewith the channel key as Bearer and storesbalance. That value is the engine's estimate of the subscription pool's weekly remainder, in reference USD.Depends on the engine endpoint in alphafoxai/corecode-engine. Merge after the engine deploy. Until then the button reports "upstream does not report a pool balance" and stores nothing.
Verification
channel_billing_anthropic_pool_test.gocovers:go vet ./controller/pass.Merging deploys to production (the
productionenvironment has no protection rules).🤖 Generated with Claude Code