| # Setting LLM API Keys | |
| You can use either OpenAI or OpenRouter (or both) for LLM reasoning. Set whichever keys you have. | |
| ## Option A: OpenRouter (GPT-5-nano, etc.) | |
| ### Quick Setup (Current Session) | |
| ```powershell | |
| $env:OPENROUTER_API_KEY = "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" | |
| $env:OPENROUTER_MODEL = "gpt-5-nano" # optional override | |
| ``` | |
| ### Make It Permanent | |
| ```powershell | |
| [System.Environment]::SetEnvironmentVariable("OPENROUTER_API_KEY", "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", "User") | |
| [System.Environment]::SetEnvironmentVariable("OPENROUTER_MODEL", "gpt-5-nano", "User") | |
| ``` | |
| ### .env Example | |
| ```env | |
| OPENROUTER_API_KEY=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 | |
| OPENROUTER_MODEL=gpt-5-nano | |
| ``` | |
| ### Hugging Face Spaces | |
| - `OPENROUTER_API_KEY`: `sk-or-...` | |
| - `OPENROUTER_MODEL`: `gpt-5-nano` (optional, defaults to this) | |
| --- | |
| ## Option B: OpenAI (GPT-4o, etc.) | |
| ### Quick Setup | |
| ```powershell | |
| $env:OPENAI_API_KEY = "sk-your-openai-api-key" | |
| ``` | |
| Or run: | |
| ```powershell | |
| .\set_api_key.ps1 | |
| ``` | |
| ### Make It Permanent | |
| ```powershell | |
| [System.Environment]::SetEnvironmentVariable("OPENAI_API_KEY", "sk-your-openai-api-key", "User") | |
| ``` | |
| ### .env Example | |
| ```env | |
| OPENAI_API_KEY=sk-your-openai-api-key | |
| ``` | |
| ### Hugging Face Spaces | |
| - `OPENAI_API_KEY`: `sk-...` | |
| --- | |
| ## Verification | |
| Run: | |
| ```powershell | |
| python test_env.json.py | |
| ``` | |
| You should see at least one of the LLM keys marked as `set`, and `llm_enabled: true`. | |