Overview
Mistral AI provides state-of-the-art open and commercial large language models optimized for performance and efficiency. Known for their competitive pricing and strong performance across multiple benchmarks. Key Features:- Advanced reasoning and coding capabilities
- Function calling and JSON mode support
- Multilingual support (English, French, German, Spanish, Italian)
- OpenAI-compatible API for easy integration
Authentication
Mistral uses Bearer token authentication with the OpenAI-compatible endpoint format. Header:Popular Models (October 2025)
| Model | Context | Description | Use Case |
|---|---|---|---|
| mistral-large-latest | 128K | Flagship model with top-tier reasoning | Complex analysis, coding, research |
| mistral-small-latest | 32K | Fast and cost-effective | General chat, simple tasks |
| codestral-latest | 32K | Specialized for code generation | Coding, debugging, documentation |
Quick Start Example
Available Endpoints
Mistral AI supports the OpenAI-compatible chat completions endpoint:| Endpoint | Method | Description |
|---|---|---|
/v1/chat/completions | POST | Text generation with conversation context |
/v1/embeddings | POST | Generate text embeddings |
/v1/models | GET | List available models |
Usage Tracking
Usage data is returned in the response body (OpenAI format):data.usage
Format: Standard OpenAI usage object
Lava Tracking: Automatically tracked via x-lava-request-id header
Features & Capabilities
Function Calling:BYOK Support
Status: ✅ Supported (managed keys + BYOK) BYOK Implementation:- Append your Mistral API key to the forward token:
${TOKEN}.${YOUR_MISTRAL_KEY} - Lava tracks usage and billing while you maintain key control
- No additional Lava API key costs (metering-only mode available)
- Sign up at Mistral AI Console
- Navigate to API Keys section
- Create a new API key
- Use in Lava forward token (4th segment)
Best Practices
- Model Selection: Use
mistral-large-latestfor complex reasoning,mistral-small-latestfor speed - Temperature: 0.7 for creative tasks, 0.1-0.3 for factual/deterministic outputs
- Context Management: Mistral Large supports 128K context - use for long documents
- Error Handling: Mistral returns OpenAI-compatible errors with descriptive messages
- Rate Limits: Monitor
x-ratelimit-*headers in responses