Skip to content

[Feature]: API key validation / connection test for AI services #38

Description

@MRAKS05

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:
    1. User taps "Test Connection"
    2. App makes a minimal API call (e.g., list models or a small test prompt)
    3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: engineBrowserDetector, GeminiClient, ShizukuUninstaller, BrowserDatabasearea: uiScreens, navigation, composables, themingenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions