> ## Documentation Index
> Fetch the complete documentation index at: https://docs.profclaw.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Mistral AI

> Use Mistral Large, Mistral Medium, and Codestral via the Mistral AI API. Strong coding and European data residency options.

Mistral AI provides high-quality models with European data residency. Codestral is particularly well-suited for code generation tasks.

## Supported Models

| Model | ID | Context | Tools | Notes |
| - | - | - | - | - |
| Mistral Large | `mistral-large-latest` | 128K | Yes | Best capability |
| Mistral Medium | `mistral-medium-latest` | 32K | Yes | Balanced |
| Codestral | `codestral-latest` | 32K | Yes | Code-optimized |
| Mistral Small | `mistral-small-latest` | 32K | Yes | Cost-efficient |

## Setup

**1. Get an API key**

Sign up at [console.mistral.ai](https://console.mistral.ai).

**2. Set the environment variable**

```bash theme={null}
export MISTRAL_API_KEY=...
```

**3. Verify**

```bash theme={null}
profclaw doctor --provider mistral
```

## Environment Variables

**MISTRAL\_API\_KEY** `string` *required*

Your Mistral AI API key.

## Configuration Example

> [tab] .env
>
> ```bash theme={null}
> MISTRAL_API_KEY=...
> ```

> [tab] settings.yml
>
> ```yaml theme={null}
> providers:
>   mistral:
>     api_key: "${MISTRAL_API_KEY}"
> ```

## Model Aliases

| Alias | Model |
| - | - |
| `mistral` | mistral-large-latest |
| `mistral-medium` | mistral-medium-latest |
| `codestral` | codestral-latest |
| `mistral-local` | mistral:7b (via Ollama) |

## Usage Examples

```bash CLI theme={null}
profclaw chat --model mistral "Review this API design"
profclaw chat --model codestral "Generate unit tests for this function"
```

```typescript SDK theme={null}
import { chat } from 'profclaw';

const code = await chat("Write a binary search in TypeScript", {
  model: "codestral",
  temperature: 0.1,
});
```

## Notes

* API endpoint: `https://api.mistral.ai/v1` (OpenAI-compatible)
* Mistral offers EU data residency - useful for GDPR-sensitive workloads.
* `codestral-latest` is optimized for code completion and generation.
* The local `mistral-local` alias runs via Ollama at no API cost.

## Related

* [AI Providers Overview](https://docs.profclaw.ai/ai-providers/overview.md) - Compare all 37 supported providers
* [Ollama](https://docs.profclaw.ai/ai-providers/ollama.md) - Run Mistral models locally at no API cost
* [Cohere](https://docs.profclaw.ai/ai-providers/cohere.md) - Another European-headquartered provider option
* [profclaw provider](https://docs.profclaw.ai/cli/provider.md) - Add and test providers from the CLI


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.