Open
Description
I got Error code: 401 even when I allow all permissions for OpenAI API
I am starting to learn with the first lesson 01-intro-to-ai-agents/code_samples/01-semantic-kernel.ipynb
I tried to test it on Jupyter Lab, but then I face with 401 error at the last step. It notice that the problem occur at my line 28 (await main() )
I did try:
from openai import OpenAI
client = OpenAI(
api_key=OPENAI_API_KEY
)
completion = client.chat.completions.create(
model="gpt-4o-mini",
store=True,
messages=[
{"role": "user", "content": "write a haiku about ai"}
]
)
print(completion.choices[0].message);
to test if the API available and it still works well. So I do not know what is going wrong here
Here is the screenshot of the problem
FYI: I am using the newest version of Jyputer Lab and Python. All packages were also up-to-date.