Mistral SDK

The Mistral SDK is the official client library for Mistral AI's API platform, La Plateforme. Sits at the model SDK layer of AI SDKs, peer to Anthropic SDK and OpenAI SDK. Officially supported in Python (`mistralai`) and TypeScript / JavaScript (`@mistralai/mistralai`), with a Go and TypeScript imple

Canonical version: Mistral SDK.

The Mistral SDK is the official client library for Mistral AI's API platform, La Plateforme. Sits at the model SDK layer of AI SDKs, peer to Anthropic SDK and OpenAI SDK. Officially supported in Python (mistralai) and TypeScript / JavaScript (@mistralai/mistralai), with a Go and TypeScript implementations also available.

It is also OpenAI-API-compatible at the chat completions layer, so the OpenAI SDK can talk to Mistral's endpoints with a custom base_url if you want a single dependency across providers.

API Surfaces

  • Chat Completions ; standard prompt/response, tool use, streaming
  • Embeddings ; mistral-embed
  • Code completion ; Codestral models
  • Vision ; Pixtral models
  • OCR ; Mistral OCR for document understanding
  • Function calling ; structured tool definitions
  • JSON mode / structured outputs
  • Fine-tuning ; via API
  • Agents API ; Mistral's own agent runtime layer (newer)

Python Example

from mistralai import Mistral

client = Mistral(api_key=os.environ["MISTRAL_API_KEY"])

response = client.chat.complete(
    model="mistral-large-latest",
    messages=[{"role": "user", "content": "Why pick Mistral?"}],
)

TypeScript Example

import { Mistral } from "@mistralai/mistralai";

const client = new Mistral({ apiKey: process.env.MISTRAL_API_KEY });

const result = await client.chat.complete({
  model: "mistral-large-latest",
  messages: [{ role: "user", content: "Why pick Mistral?" }],
});

Why You'd Reach For It

  • Open-weight models with optional managed hosting ; Mistral 7B, 8x7B, Mistral Small/Medium/Large, Codestral, Pixtral, Mistral OCR. La Plateforme hosts the closed Large/Medium tier; the smaller models are downloadable
  • EU residency ; Mistral runs on EU infrastructure; meaningful for GDPR-strict deployments
  • Specialized models ; Codestral for code, Pixtral for vision, OCR for document workflows ; one provider covers several niches
  • Strong cost / quality trade-off for the medium tier

Where It Fits

  • Direct Mistral API access → Mistral SDK
  • Mistral as one of many providers behind one abstractionVercel AI SDK with @ai-sdk/mistral, or LiteLLM in Python
  • Self-hosted Mistral via Ollama / vLLM → use those tools' clients (often OpenAI-API-compatible)
  • Mistral via Groq ; Groq hosts open Mistral variants on LPU silicon for very fast inference

License

Apache-2.0 on the SDK. Mistral's models have varying licenses (Apache-2.0 for many open-weight ones; commercial licenses for Large/Medium).

References


About Sébastien

I'm Sébastien Dubois, and I'm on a mission to help knowledge workers escape information overload. After 20+ years in IT and seeing too many brilliant minds drowning in digital chaos, I've decided to help people build systems that actually work. Through the Knowii Community, my courses, products & services and my Website/Newsletter, I share practical and battle-tested systems.

I write about Knowledge Work, Personal Knowledge Management, Note-taking, Lifelong Learning, Personal Organization, Productivity, and more. I also craft lovely digital products and tools.

If you want to follow my work, then become a member and join our community.

Ready to get to the next level?

If you're tired of information overwhelm and ready to build a reliable knowledge system:

Found this valuable? Share it with someone who needs it.

Join 6,000+ readers. Get practical systems for knowledge & AI. Free.

Subscribe ✨

Free: Knowledge System Checklist

A clear roadmap to building your own knowledge system. Subscribe and get it straight to your inbox.

6,000+ readers. No spam. Unsubscribe anytime.