Repository navigation
per-API-key routing (choose provider and account for each 9router token) #5635
fariaotavio12
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.
Uh oh!
There was an error while loading. Please reload this page.
Summary
I'd like to be able to configure, for each API key (token) generated by 9router, which provider(s) and which account(s) it is allowed to use.
Motivation
Right now, any request made with a 9router key goes through the global routing/fallback logic, so I can't control which provider or account serves a given client. I run several tools and projects against the same 9router instance, and I need to separate them:
Today the only way to get this separation is to run multiple instances, which is heavy and hard to maintain.
Proposed behavior
When creating or editing an API key, allow configuring:
Possible shape of the config:
{ "key": "sk-9r-...", "name": "work-project", "routing": { "providers": [ { "provider": "openai", "accounts": ["work-account-1"] }, { "provider": "claude", "accounts": ["personal"] } ], "strict": true } }With
strict: true, the request fails with a clear error if none of the allowed accounts is available. It does not fall back to other providers or accounts.Benefits
Alternatives considered
Questions
Thanks for the great project!
All reactions