---
title: Mistral
url: https://arcana.otnelhq.com/docs/providers/mistral
---

# Mistral



Mistral provides fast, efficient models with strong European compliance. Their API is OpenAI-compatible, making setup straightforward.




## Setup



```bash
# 1. Get your API key from https://console.mistral.ai/
export MISTRAL_API_KEY=...

# 2. Verify detection
arcana doctor

# 3. Run
arcana run "hello"
```




## Available Models



| Model | Context | Best For |
| --- | --- | --- |
| `mistral-large-latest` | 128K | Best quality, complex tasks |
| `mistral-small-latest` | 128K | Fast, cost-effective |
| `codestral-latest` | 128K | Code generation and completion |




## Config File



```json
{
  "provider": "mistral",
  "model": "mistral-large-latest"
}
```




## Environment Variables



| Variable | Description |
| --- | --- |
| `MISTRAL_API_KEY` | Your Mistral API key (required) |
| `MISTRAL_BASE_URL` | Custom base URL (default: api.mistral.ai) |




## Pricing Notes



| Model | Input | Output |
| --- | --- | --- |
| mistral-large | $2.00 | $6.00 |
| mistral-small | $0.10 | $0.30 |
| codestral | $0.30 | $0.90 |



Prices per 1M tokens. Check [mistral.ai/products](https://mistral.ai/products) for current rates.




## OpenAI-Compatible API



Mistral's API is OpenAI-compatible. You can also use it via OpenAI's client by setting the base URL:



```bash
export OPENAI_API_KEY=$MISTRAL_API_KEY
export OPENAI_BASE_URL=https://api.mistral.ai/v1
export ARCANA_MODEL=mistral-large-latest
```




## Tips



- `codestral` is excellent for code generation and completion tasks
- Mistral offers strong European data compliance (GDPR-friendly)
- The OpenAI-compatible API means most OpenAI tools work out of the box
- `mistral-small` is very cost-effective for everyday tasks
