Formerly known as Azure AI Services or Azure Cognitive Services is a unified collection of prebuilt AI capabilities within the Microsoft Foundry platform
Hello Ishan Bhuta,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
I understand that you are having 403 and 400 error.
A 403 Forbidden error typically indicates a permissions issue. Check similar answer to your issue here. To resolve the 403 Forbidden and 400 Bad Request errors you're encountering with Azure OpenAI services, follow these steps: First, ensure that you have the correct API key and that it has the necessary permissions. Verify that the key is not expired and is correctly configured in your request. If you're using private endpoints, make sure that the network configuration allows access, and consider adding the public IP to the Azure OpenAI firewall. Additionally, verify that your user account has the required roles (e.g., Owner or Contributor) on the subscription and resource group where the resources are created.
For the 400 Bad Request error, ensure you are using the correct API version for the model you are trying to access. Newer models might require specific API versions. Double-check the request parameters to ensure they are correctly formatted and valid, including the model name, deployment name, and any other required fields. If your network settings restrict access, ensure that the necessary IP addresses are whitelisted. Sometimes, setting the firewall to allow all networks temporarily can help identify if the issue is related to network restrictions.
If you're using a specific model like GPT-o1, make sure your API version is set correctly in your configuration:
model:
provider: azure-openai
model_name: gpt-o1
deployment_name: your-deployment-name
api_version: 2024-12-01-preview
Save and rerun.
I hope this is helpful! Do not hesitate to let me know if you have any other questions or clarifications.
Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.