Repository navigation
fix(billing): expose upstream price targets for aliased models - #164
Merged
Merged
Conversation
GavinKung
force-pushed
the
fix/issue-136-billing-model-targets
branch
from
October 22, 2026 14:39
2b9aa67 to
b611913
Compare
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.
A configured alias such as
MY-MODELis a public routing ID, while billing matches the upstream model reported in usage. The current merged model catalog cannot describe aliases shared by different providers or credentials reliably.Add
billing_modelsto available models inGET /v8/management/models. Resolve each registered credential's public routes through the existing dispatch resolver and return deduplicated(provider, model)targets. This covers prefixes, configured aliases, OAuth aliases, and several upstream models behind the same public ID. Update the English and Chinese API contracts. Existing price rules and charges are not rewritten.Companion HMC PR: router-for-me/Home-Management-Center#216
Both changes are needed to resolve #136. Legacy management responses, static catalogs, and CPA payloads retain their existing shapes.
Validation: focused Management API regressions pass for per-credential targets, deduplication, disabled/removed credentials, prefixes, OAuth aliases, unresolved targets, and legacy response compatibility. Home compiles with
go build -o test-output ./cmd/home && rm test-output;git diff --checkpasses.Related: #136.