Hi Magnus Vinterhav
Greetings & Welcome to Microsoft Q&A forum! Thanks for posting your query!
Apologies for the issue that you are facing.
The error message you are seeing indicates an issue with the authentication process when trying to call the Azure OpenAI API.
This could happen for several reasons, such as your API key is missing or invalid, or the endpoint is incorrect.
Please make sure that you have a valid API key and endpoint for GPT-4o.
Also, make sure that you are using latest and updated python versions, Openai and api_version.
See the similar issues below which has been addressed and let me know if that helps.
Failed to call Azure OpenAI API: failed with error:invalid_api_key.
Hope this helps. Do let us know if you have any further queries.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful.