Skip to content

fix(billing): expose upstream price targets for aliased models - #164

Merged
GavinKung merged 1 commit into
devfrom
fix/issue-136-billing-model-targets
Oct 22, 2026
Merged

GavinKung merged 1 commit into
devfrom
fix/issue-136-billing-model-targets

Conversation

@GavinKung

@GavinKung GavinKung commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

A configured alias such as MY-MODEL is 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_models to available models in GET /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 --check passes.

Related: #136.

@GavinKung
GavinKung force-pushed the fix/issue-136-billing-model-targets branch from 2b9aa67 to b611913 Compare October 22, 2026 14:39
@GavinKung
GavinKung merged commit 0bacf9c into dev Oct 22, 2026
2 checks passed
@GavinKung
GavinKung deleted the fix/issue-136-billing-model-targets branch October 22, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant