Skip to main content
This will help you get started with AzureAIChatCompletionsModel chat models. For detailed documentation of all AzureAIChatCompletionsModel features and configurations, head to the API reference The AzureAIChatCompletionsModel class uses the Azure AI Foundry SDK. AI Foundry has several chat models, including AzureOpenAI, Cohere, Llama, Phi-3/4, and DeepSeek-R1, among others. You can find information about their latest models and their costs, context windows, and supported input types in the Azure docs.

Overview

Integration details

Model features

Setup

To access AzureAIChatCompletionsModel models, you’ll need to create an Azure account, get an API key, and install the langchain-azure-ai integration package.

Credentials

Head to the Azure docs to see how to create your deployment and generate an API key. Once your model is deployed, you click the ‘get endpoint’ button in AI Foundry. This will show you your endpoint and api key. Once you’ve done this, set the AZURE_AI_CREDENTIAL and AZURE_AI_ENDPOINT environment variables:
If you want to get automated tracing of your model calls, you can also set your LangSmith API key by uncommenting below:

Installation

The LangChain AzureAIChatCompletionsModel integration lives in the langchain-azure-ai package:

Instantiation

Now we can instantiate our model object and generate chat completions:

Invocation


API reference

For detailed documentation of all AzureAIChatCompletionsModel features and configurations, head to the API reference: python.langchain.com/api_reference/azure_ai/chat_models/langchain_azure_ai.chat_models.AzureAIChatCompletionsModel.html