Skip to main content
This will help you get started with Mistral chat models. For detailed documentation of all ChatMistralAI features and configurations head to the API reference. The ChatMistralAI class is built on top of the Mistral API. For a list of all the models supported by Mistral, check out this page.

Overview

Integration details

ClassPackageSerializableJS supportDownloadsVersion
ChatMistralAIlangchain-mistralaibetaPyPI - DownloadsPyPI - Version

Model features

Tool callingStructured outputImage inputAudio inputVideo inputToken-level streamingNative asyncToken usageLogprobs

Setup

To access ChatMistralAI models you’ll need to create a Mistral account, get an API key, and install the langchain-mistralai integration package.

Credentials

A valid API key is needed to communicate with the API. Once you’ve done this set the MISTRAL_API_KEY environment variable:
To enable automated tracing of your model calls, set your LangSmith API key:

Installation

The LangChain Mistral integration lives in the langchain-mistralai package:

Instantiation

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

Invocation


API reference

Head to the API reference for detailed documentation of all attributes and methods.