feat: unify Claude API key and profile system with flexible key sourcing

- Add ApiKeySource type ('inline' | 'env' | 'credentials') to ClaudeApiProfile
- Allow profiles to source API keys from credentials.json or environment variables
- Add provider templates: OpenRouter, MiniMax, MiniMax (China)
- Auto-migrate existing users with Anthropic key to "Direct Anthropic" profile
- Update all API call sites to pass credentials for key resolution
- Add API key source selector to profile creation UI
- Increment settings version to 5 for migration support

This allows users to:
- Share a single API key across multiple profile configurations
- Use environment variables for CI/CD deployments
- Easily switch between providers without re-entering keys
This commit is contained in:
Stefan de Vogelaere
2026-01-19 17:28:28 +01:00
parent 10b49bd3b4
commit b88c940a36
25 changed files with 706 additions and 71 deletions

View File

@@ -109,6 +109,15 @@ export function ApiKeysSection() {
{/* Security Notice */}
<SecurityNotice />
{/* Profile Usage Note */}
<div className="text-xs text-muted-foreground/80 px-1">
<p>
API Keys saved here can be used by API Profiles with "credentials" as the API key
source. This lets you share a single key across multiple profile configurations without
re-entering it.
</p>
</div>
{/* Action Buttons */}
<div className="flex flex-wrap items-center gap-3 pt-2">
<Button