Check if API key is configured and valid (not a placeholder).
(self)
| 81 | json.dump(config, f, indent=2) |
| 82 | |
| 83 | def has_api_key(self) -> bool: |
| 84 | """Check if API key is configured and valid (not a placeholder).""" |
| 85 | config = self.get_config() |
| 86 | api_key = config.get('openrouter_api_key') |
| 87 | # Check if API key exists and is not the placeholder value |
| 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).""" |