You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem
The current "Hello World" example in the docs assumes that the OPENAI_API_KEY
is already available in the system environment variables.
However, many Python developers store keys in a .env file.
If they don't call load_dotenv(), they run into the following error:
openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable
Suggested improvement
Add a note in the docs for Python users that if you are using a .env file,
you need to load it with:
fromdotenvimportload_dotenvload_dotenv()
before creating the agent or runner.
Benefit
This will save beginners from confusion and make the SDK easier to adopt
for Python users following common .env practices.