Skip to content

Commit 31ed50b

Browse files
author
wangshudong
committed
Add the default base url configuration item
1 parent e0aafc6 commit 31ed50b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/openai/_client.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def __init__(
100100
self.organization = organization
101101

102102
if base_url is None:
103-
base_url = f"https://api.openai.com/v1"
103+
base_url = os.environ.get("OPENAI_ORG_ID") || f"https://api.openai.com/v1"
104104

105105
super().__init__(
106106
version=__version__,
@@ -307,7 +307,8 @@ def __init__(
307307
self.organization = organization
308308

309309
if base_url is None:
310-
base_url = f"https://api.openai.com/v1"
310+
base_url = base_url = os.environ.get("OPENAI_BASE_URL", "https://api.openai.com/v1")
311+
311312

312313
super().__init__(
313314
version=__version__,

0 commit comments

Comments
 (0)