Problem
Users enter API keys in Settings but have no way to verify if the key is valid, correctly configured, or if the service is reachable. An invalid or expired key only becomes apparent when classification fails, which is a poor UX.
Proposed Solution
Add a Verify / Test Connection button in the AI service settings that validates the API key and provider connectivity.
Behavior
- Test button: Next to the API key input field or in the provider card
- Validation flow:
- User taps "Test Connection"
- App makes a minimal API call (e.g., list models or a small test prompt)
- Shows result: ✅ Success (with latency) or ❌ Error (with reason)
- Auto-validate on save: Optionally test the key when the user saves settings
- Status indicator: Show a persistent status icon (green/red) next to the configured provider
Error Handling
- Invalid key → "API key rejected — check for typos or expiration"
- Network error → "Cannot reach service — check internet connection"
- Rate limited → "Service is rate-limited — try again later"
- Wrong region/endpoint → "Check endpoint configuration"
Implementation Notes
- Each provider should implement a
validateApiKey(): Result<Boolean> method in its adapter
- Must not count against the user's daily usage/quota
- Store validation status in SettingsManager for quick display
Problem
Users enter API keys in Settings but have no way to verify if the key is valid, correctly configured, or if the service is reachable. An invalid or expired key only becomes apparent when classification fails, which is a poor UX.
Proposed Solution
Add a
Verify / Test Connectionbutton in the AI service settings that validates the API key and provider connectivity.Behavior
Error Handling
Implementation Notes
validateApiKey(): Result<Boolean>method in its adapter