You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(auth): add support for multiple profiles per provider
Allow users to store multiple API keys for the same provider with named
profiles (e.g., separate OpenRouter keys for different cost tracking).
Changes:
- Auth module: Added profile support to get/set/remove, plus profiles(),
hasDefault(), setDefault() functions
- CLI commands: login prompts for profile name when default exists,
logout/list show profile names, new set-default command
- Provider: parseModel() extracts profile from provider:profile/model format
- Config: Added optional profile field to provider schema
Key format: 'providerID' for default, 'providerID:profileName' for named.
Usage:
opencode auth login # first login creates default
opencode auth login # second login prompts for profile name
opencode auth list # shows all profiles grouped by provider
opencode auth set-default # swap a named profile to be the default
opencode auth logout # shows profiles in selection
Model string format:
openrouter:work/claude-sonnet-4 # uses 'work' profile
openrouter/claude-sonnet-4 # uses default profile
Closes#5391
0 commit comments