--- id: mistralai version: "2.9.3" license: unclear license_treatment: unclear maintenance: active --- # mistralai — Python Client SDK for the Mistral AI API. License: unclear · Maintenance: active · Popularity: top 1,000 on PyPI ## Install pip install mistralai uv add mistralai poetry add mistralai ## Description # Mistral Python Client ## Migrating from v1 If you are upgrading from v1 to v2, check the [migration guide](https://github.com/mistralai/client-python/blob/main/MIGRATION.md) for details on breaking changes and how to update your code. ## API Key Setup Before you begin, you will need a Mistral AI API key. 1. Get your own Mistral API Key: 2. Set your Mistral API Key as an environment variable. You only need to do this once. ```bash # set Mistral API Key (using zsh for example) $ echo 'export MISTRAL_API_KEY=[your_key_here]' >> ~/.zshenv # reload the environment (or just quit and open a new terminal) $ source ~/.zshenv ``` ## Summary Mistral AI API: Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it. ## Table of Contents * [Mistral Python Client](#mistral-python-client) * [Migrating from v1](#migrating-from-v1) * [API Key Setup](#api-key-setup) *... ## AI interpretation — verify before relying Official Python client for the Mistral AI API, enabling synchronous and asynchronous chat completions, embeddings, file uploads, and agent interactions with Mistral's language models. Verdict: A well-maintained, actively developed official SDK for Mistral AI's API with low install friction and no known vulnerabilities. Suitable for production use, but the unclear license status warrants verification before adopting in proprietary or compliance-sensitive contexts. [View on SkillFed](https://skillfed.io/packages/mistralai) · [View on PyPI](https://pypi.org/project/mistralai/)