How Credentials Are Resolved
Rusty resolves API keys through a tiered chain, checking each source in order. The first non-empty value found is used.Resolution Order
Environment Variables
RUSTY_API_KEY is checked first, then OPENAI_API_KEY. Empty strings are treated as absent.OS Keyring
If
credential_store is set to "keyring" in settings, Rusty reads from the system keyring:- macOS: Keychain Access
- Windows: Credential Manager
- Linux: Secret Service (GNOME Keyring, KWallet)
Credential Store Options
Keyring (Recommended)
Stores the API key in the operating system’s secure credential store. This is the default and recommended option.Settings File
Stores the API key in plaintext in~/.rusty/settings.json. Use this if your platform does not have a keyring available (e.g., headless Linux without a desktop environment).
Multi-Provider Setup
If you switch between providers, you can store separate credentials using environment variables:RUSTY_API_KEY always takes precedence over OPENAI_API_KEY.