on main help sign in
fix(openrouter): set api key from env (#129)
commit76275e533e029b25c01e3cf07af3f89a35de0a55 authorHunter Casten <41604962+enchantednatures@users.noreply.github.com> dateWed 30 Apr 2025, 03:50 (1 year ago) parent98e2910
1 file changed+3
internal/config/config.go+3
internal/config/config.go+3
@@ -228,6 +228,9 @@ func setProviderDefaults() {
228228 if apiKey := os.Getenv("GROQ_API_KEY"); apiKey != "" {
229229 viper.SetDefault("providers.groq.apiKey", apiKey)
230230 }
231+ if apiKey := os.Getenv("OPENROUTER_API_KEY"); apiKey != "" {
232+ viper.SetDefault("providers.openrouter.apiKey", apiKey)
233+ }
231234
232235 // Use this order to set the default models
233236 // 1. Anthropic