Get the stored API key if it's valid (not a placeholder).
(self)
| 88 | return bool(api_key) and api_key != "sk-temp-placeholder" |
| 89 | |
| 90 | def get_api_key(self) -> Optional[str]: |
| 91 | """Get the stored API key if it's valid (not a placeholder).""" |
| 92 | config = self.get_config() |
| 93 | api_key = config.get('openrouter_api_key') |
| 94 | # Return None if it's the placeholder value |
| 95 | if api_key == "sk-temp-placeholder": |
| 96 | return None |
| 97 | return api_key |
| 98 | |
| 99 | def save_api_key(self, api_key: str): |
| 100 | """Save API key to config (prevents saving placeholder keys).""" |