Skip to main content
Use the OpenAI SDKs with the Azure OpenAI v1 endpoint to build model inference applications in Python, C#, JavaScript, Java, or Go. The examples use the Responses API for new applications and show Chat Completions for applications that still use its message-based interface.

Prerequisites

  • An Azure subscription. Create one for free if you don’t have one.
  • An Azure OpenAI resource with a gpt-5-mini model 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.
The 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 401 or 403 response, confirm that the intended identity or API key can access the Azure OpenAI resource.
  • For a 404 response, confirm that the base URL ends in /openai/v1/ and that model contains 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.