Skip to main content

Overview

Mistral AI provides open-weight and commercial models with strong performance, efficient inference, and competitive pricing. Access Mistral through Portkey for European-hosted AI with excellent multilingual capabilities. Base URL: https://api.mistral.ai/v1

Supported Features

  • ✅ Chat Completions
  • ✅ Streaming
  • ✅ Embeddings
  • ✅ Function Calling
  • ✅ JSON Mode
  • ✅ Fill-in-the-middle (FIM)
  • ❌ Vision (not yet available)
  • ❌ Image Generation
  • ❌ Fine-tuning

Quick Start

Chat Completions

Streaming

Available Models

Commercial Models

Open-Weight Models

Specialized Models

Mistral excels at:
  • Multilingual tasks (French, English, Spanish, German, Italian)
  • Code generation with Codestral
  • Efficient inference with MoE architecture
  • European data residency (GDPR compliant)
  • Instruction following and function calling

Configuration Options

Headers

Advanced Features

Function Calling

JSON Mode

Force JSON output:

System Prompts

Fill-in-the-Middle (FIM)

Special mode for code completion:

Embeddings

Batch embeddings:

Fallback Configuration

Fallback to OpenAI:

Load Balancing

Balance between Mistral models:

Error Handling

Best Practices

  1. Use latest versions - Model IDs with “latest” get automatic updates
  2. Leverage function calling - Mistral has strong tool use capabilities
  3. Try JSON mode - For structured outputs
  4. Use Codestral - For code-specific tasks
  5. Consider Small for volume - Cost-effective for simple tasks
  6. Enable streaming - Better user experience
  7. Use embeddings - For semantic search and RAG
  8. System prompts - Guide behavior consistently

Context Windows

European Data Residency

Mistral AI is headquartered in France and offers EU data residency:
  • GDPR compliant by default
  • European infrastructure (Paris, Frankfurt)
  • Data sovereignty for EU customers
  • No data training on customer inputs

Pricing

Mistral offers competitive pricing with open models:

Mistral Pricing

View detailed pricing for all Mistral models

Function Calling

Advanced function calling

Fallbacks

Fallback configurations

Code Generation

Using Codestral

JSON Mode

Structured outputs