| name | mistral-install-auth |
| description | Install and configure the Mistral AI SDK with authentication.
Use when setting up a new Mistral integration, configuring API keys,
or initializing Mistral AI in your project.
Trigger with phrases like "install mistral", "setup mistral",
"mistral auth", "configure mistral API key".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Bash(pip:*), Grep |
| version | 1.12.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","mistral","api","authentication"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Mistral AI Install & Auth
Overview
Set up the official Mistral AI SDK (@mistralai/mistralai for TypeScript, mistralai for Python) and configure authentication for chat completions, embeddings, function calling, vision, and agents.
Prerequisites
- Node.js 18+ or Python 3.9+
- Package manager (npm, pnpm, yarn, or pip)
- Mistral AI account at console.mistral.ai
- API key from La Plateforme (Settings > API Keys)
Instructions
Step 1: Install SDK
Node.js (TypeScript/JavaScript) — ESM only
set -euo pipefail
npm install @mistralai/mistralai
pnpm add @mistralai/mistralai
yarn add @mistralai/mistralai
Python
set -euo pipefail
pip install mistralai
Step 2: Configure Authentication
Environment Variables (Recommended)
export MISTRAL_API_KEY="your-api-key"
echo 'MISTRAL_API_KEY=your-api-key' >> .env
echo '.env' >> .gitignore
Using dotenv (Node.js)
set -euo pipefail
npm install dotenv
import 'dotenv/config';
Step 3: Verify Connection
TypeScript
import { Mistral } from '@mistralai/mistralai';
const client = new ({
: process..,
});
() {
{
models = client..();
.();
( model models. ?? []) {
.();
}
} (: ) {
(error. === ) {
.();
} {
.(, error.);
}
}
}
();