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
| Model | Context | Description | Best For |
|---|---|---|---|
mistral-large-latest | 128K | Most capable Mistral model | Complex reasoning, multilingual |
mistral-large-2411 | 128K | Latest Mistral Large | Production applications |
mistral-large-2407 | 128K | July 2024 version | Stable release |
mistral-medium-latest | 32K | Balanced performance | General purpose |
mistral-small-latest | 32K | Fast and efficient | Simple tasks, high volume |
Open-Weight Models
| Model | Context | Description |
|---|---|---|
open-mistral-nemo | 128K | Latest open model |
open-mixtral-8x22b | 64K | Mixture of Experts (MoE) |
open-mixtral-8x7b | 32K | Efficient MoE |
open-mistral-7b | 32K | Compact model |
Specialized Models
| Model | Type | Description |
|---|---|---|
codestral-latest | Code | Code generation |
codestral-mamba-latest | Code | Efficient code model |
mistral-embed | Embeddings | Text embeddings (1024 dims) |
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
| Header | Description | Required |
|---|---|---|
Authorization | Mistral API key (Bearer token) | Yes |
Advanced Features
Function Calling
JSON Mode
Force JSON output:System Prompts
Fill-in-the-Middle (FIM)
Special mode for code completion:Embeddings
Fallback Configuration
Fallback to OpenAI:Load Balancing
Balance between Mistral models:Error Handling
Best Practices
- Use latest versions - Model IDs with “latest” get automatic updates
- Leverage function calling - Mistral has strong tool use capabilities
- Try JSON mode - For structured outputs
- Use Codestral - For code-specific tasks
- Consider Small for volume - Cost-effective for simple tasks
- Enable streaming - Better user experience
- Use embeddings - For semantic search and RAG
- System prompts - Guide behavior consistently
Context Windows
| Model | Context Window | Notes |
|---|---|---|
| mistral-large-latest | 128K tokens | Full documents |
| mistral-medium-latest | 32K tokens | Standard documents |
| mistral-small-latest | 32K tokens | Standard documents |
| open-mistral-nemo | 128K tokens | Long context open model |
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
Related Resources
Function Calling
Advanced function calling
Fallbacks
Fallback configurations
Code Generation
Using Codestral
JSON Mode
Structured outputs