From 9ca8873893c3411c9ba984d4b802079ac6d26df8 Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Tue, 5 Sep 2023 12:36:37 +0000 Subject: [PATCH] fix(client): handle case where the client is instantiated with a undefined baseURL --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index e8013a515..16e4adbb3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -111,8 +111,8 @@ export class OpenAI extends Core.APIClient { const options: ClientOptions = { apiKey, organization, - baseURL: `https://api.openai.com/v1`, ...opts, + baseURL: opts.baseURL ?? `https://api.openai.com/v1`, }; if (!options.dangerouslyAllowBrowser && Core.isRunningInBrowser()) {