skip to Main Content

Azure openai error 401, "Unauthorized. Access token is missing, invalid, audience is incorrect (https://cognitiveservices.azure.com), or have expired

Here is my python code, and encountered run time error, Error: 401 { "statusCode": 401, "message": "Unauthorized. Access token is missing, invalid, audience is incorrect (https://cognitiveservices.azure.com), or have expired." } import requests # Azure OpenAI Configuration API_KEY = "xxxxxx" #…

VIEW QUESTION

How can I write a POST request for Azure OpenAI that uses structured output?

I want to write a POST request for Azure OpenAI that uses structured output. https://azure.microsoft.com/en-us/blog/announcing-a-new-openai-feature-for-developers-on-azure/ says: Here’s an example API call to illustrate how to use Structured Outputs: { "model": "gpt-4o-2024-08-06", "prompt": "Generate a customer support response", "structured_output": { "schema":…

VIEW QUESTION
Back To Top
Search