Prerequisites
- An Azure subscription. Create one for free if you don’t have one.
- An Azure OpenAI resource with a
gpt-5-minimodel deployment. - Your Azure OpenAI resource endpoint, such as
https://YOUR-RESOURCE-NAME.openai.azure.com. - For Microsoft Entra ID authentication, an identity that has permission to run inference. For role options, see Configure Microsoft Entra ID authentication.
- For API key authentication, an Azure OpenAI resource key. Microsoft Entra ID is recommended for production applications.
- A supported language runtime and package manager for the language you select.
model value in every request is your Azure model deployment name. The examples use gpt-5-mini; replace it if your deployment has a different name.
Troubleshooting
- For a
401or403response, confirm that the intended identity or API key can access the Azure OpenAI resource. - For a
404response, confirm that the base URL ends in/openai/v1/and thatmodelcontains a valid deployment name. - For a package or type error, update the SDK and compare the installed version with the version tested on this page.
- For a model parameter error, check whether the deployed model supports the parameter. Parameter support can differ between model families.