We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9b85bf9 commit a39e4c4Copy full SHA for a39e4c4
src/codex/_client.py
@@ -101,14 +101,14 @@ def __init__(
101
- `api_key` from `CODEX_API_KEY`
102
- `access_key` from `CODEX_ACCESS_KEY`
103
"""
104
- if api_key is None:
105
- api_key = os.environ.get("CODEX_API_KEY")
106
self.api_key = api_key
107
-
108
- if access_key is None:
109
- access_key = os.environ.get("CODEX_ACCESS_KEY")
110
self.access_key = access_key
111
+ # if neither api_key nor access_key are provided, check the environment variables
+ if self.api_key is None and self.access_key is None:
+ self.api_key = os.environ.get("CODEX_API_KEY")
+ self.access_key = os.environ.get("CODEX_ACCESS_KEY")
+
112
self._environment = environment
113
114
base_url_env = os.environ.get("CODEX_BASE_URL")
0 commit comments