@@ -5,6 +5,7 @@ import type { SupportedProvider } from "@/types/index.js"
55const envVarMap : Record < SupportedProvider , string > = {
66 anthropic : "ANTHROPIC_API_KEY" ,
77 "openai-native" : "OPENAI_API_KEY" ,
8+ openai : "OPENAI_API_KEY" ,
89 gemini : "GOOGLE_API_KEY" ,
910 openrouter : "OPENROUTER_API_KEY" ,
1011 "vercel-ai-gateway" : "VERCEL_AI_GATEWAY_API_KEY" ,
@@ -24,6 +25,7 @@ export function getProviderSettings(
2425 provider : SupportedProvider ,
2526 apiKey : string | undefined ,
2627 model : string | undefined ,
28+ baseUrl : string | undefined ,
2729) : RooCodeSettings {
2830 const config : RooCodeSettings = { apiProvider : provider }
2931
@@ -32,17 +34,25 @@ export function getProviderSettings(
3234 if ( apiKey ) config . apiKey = apiKey
3335 if ( model ) config . apiModelId = model
3436 break
37+ case "openai" :
38+ if ( apiKey ) config . openAiApiKey = apiKey
39+ if ( model ) config . openAiModelId = model
40+ if ( baseUrl ) config . openAiBaseUrl = baseUrl
41+ break
3542 case "openai-native" :
3643 if ( apiKey ) config . openAiNativeApiKey = apiKey
3744 if ( model ) config . apiModelId = model
45+ if ( baseUrl ) config . openAiNativeBaseUrl = baseUrl
3846 break
3947 case "gemini" :
4048 if ( apiKey ) config . geminiApiKey = apiKey
4149 if ( model ) config . apiModelId = model
50+ if ( baseUrl ) config . googleGeminiBaseUrl = baseUrl
4251 break
4352 case "openrouter" :
4453 if ( apiKey ) config . openRouterApiKey = apiKey
4554 if ( model ) config . openRouterModelId = model
55+ if ( baseUrl ) config . openRouterBaseUrl = baseUrl
4656 break
4757 case "vercel-ai-gateway" :
4858 if ( apiKey ) config . vercelAiGatewayApiKey = apiKey
@@ -55,6 +65,7 @@ export function getProviderSettings(
5565 default :
5666 if ( apiKey ) config . apiKey = apiKey
5767 if ( model ) config . apiModelId = model
68+ if ( baseUrl ) config . openAiBaseUrl = baseUrl
5869 }
5970
6071 return config
0 commit comments