Repository navigation
feat(routing): support per-client-key strict provider routing and Claude tier model mapping #7318
mvn-bachhuynh-dn
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
When multiple clients or account profiles share a single CLIProxyAPI instance (for example via
claude-swapor background agent gateways), all authenticated proxy keys share the same global model aliases and provider pool. There is no way to pin a specific client API key to a single provider (e.g.antigravity) while mapping different Claude model tiers (opus,sonnet,haiku) to appropriate upstream models so routine/background requests use lighter, higher-quota models and only explicit Opus requests hit flagship models.Proposed Solution
Add
access.api-key-routesto allow pinning an authenticated client key to a strict provider and target model set:model: default target model for the keyopus-model: optional target model forclaude-opus-*,claude-fable-*, andclaude-mythos-*requestssonnet-model: optional target model forclaude-sonnet-*requestshaiku-model: optional target model forclaude-haiku-*requestsPolicies precede router plugins and registry aliases, fail closed on duplicate/incomplete rules, and never fall back to another provider on quota exhaustion.
All reactions