Setup API key.
(self)
| 498 | self._setup_api_key() |
| 499 | |
| 500 | def _setup_api_key(self): |
| 501 | """Setup API key.""" |
| 502 | console.print("\n[yellow]Get your API key from: https://openrouter.ai[/yellow]") |
| 503 | |
| 504 | questions = [ |
| 505 | inquirer.Password('key', message="Enter API key") |
| 506 | ] |
| 507 | |
| 508 | try: |
| 509 | answers = inquirer.prompt(questions) |
| 510 | if answers and answers['key']: |
| 511 | self.cache_manager.save_api_key(answers['key']) |
| 512 | console.print("[green]✓ API key saved[/green]\n") |
| 513 | except Exception as e: |
| 514 | console.print(f"[red]Error: {e}[/red]\n") |
no test coverage detected