Overview
Mistral AI ships open-weight + commercial LLMs (mistral-large, mistral-small, codestral, ministral, pixtral). The Automize connector covers Chat, FIM (fill-in-the-middle for code), Embeddings, Moderation, Agents, file uploads, and model metadata.
- Regions: Single global API at api.mistral.ai. EU-hosted by default – suitable for EU data-residency requirements out of the box.
- Plans: Pay-as-you-go on La Plateforme. Enterprise tier (separate onboarding) adds dedicated capacity + EU-hosted on-prem options.
Setting up the connection
Auth type: Bearer Token.
- In Mistral Console → API Keys, click Create new key.
- Paste it as the API token. Connector sends Authorization: Bearer <key>.
- Make sure billing is set up – keys are issued without billing but every endpoint 402s until a card is on file.
Find your credentials at https://console.mistral.ai/api-keys/.
Rate limits
RPM + TPM per workspace, varies by model. mistral-large is the tightest (60 req/min default). 429 response includes Retry-After; connector backs off and retries.
Data model
Mistral's surface splits between generative + utility endpoints:
Chat messages[] in/out, tool-use capable
FIM code infilling (prompt + suffix), codestral only
Embedding mistral-embed (1024-dim, L2-normalised)
Moderation category scoring for content safety
Agents persistent named prompt+tools bundles
Files upload for fine-tunes or batch jobs
Model families:
mistral-large-latest flagship reasoning, tool-use
mistral-medium-latest balanced cost/quality
mistral-small-latest cheap + fast, weaker reasoning
codestral-latest code-specialised (chat + FIM)
ministral-3b / ministral-8b edge / on-device tier
pixtral-large vision-capable
mistral-embed embeddings only
mistral-moderation-latest safety classifier
Pin -latest aliases only in dev; for production, snapshot to the
dated version (e.g. mistral-large-2407) so Mistral's model rotations
don't quietly shift behaviour under you.
Files lifecycle: uploaded files are retained 30 days unless attached
to a fine-tune or batch job. Past that, they're gone – archive the
source on your side if you need long retention.Available operations
10 operations available. Click any row to jump to its detail.
| Operation | Category | What it does |
|---|---|---|
| Chat Completion | General | Generate a chat completion |
| Create Agent | General | Create a Mistral agent |
| Delete File | General | Delete an uploaded file |
| Create Embedding | General | Generate text embeddings |
| Fill-in-the-Middle | General | Code completion with prefix + suffix (codestral) |
| Get Model | General | Get model details |
| List Files | General | List uploaded files |
| List Models | General | List available models |
| Content Moderation | General | Classify content for safety |
| Upload File | General | Upload a file for fine-tuning or batch jobs |
Operations
Chat Completion
Generate a chat completion
| Parameter | Required | Type | Description |
|---|---|---|---|
Model model | No | text | |
Messages messages | No | text | |
Temperature temperature | No | text | |
Max Tokens max_tokens | No | text | |
Top P top_p | No | text | |
Tools tools | No | text | |
Tool Choice tool_choice | No | text |
Tips
- OpenAI-compatible shape: messages=[{role,content}]. Tools/function calling on mistral-large and mistral-small.
- response_format={type:'json_object'} forces valid JSON. Use this with a strict schema in the prompt.
- random_seed for deterministic replays; default temperature is 0.7.
Create Agent
Create a Mistral agent
| Parameter | Required | Type | Description |
|---|---|---|---|
Agent Id agent_id | No | text | |
Messages messages | No | text | |
Temperature temperature | No | text | |
Max Tokens max_tokens | No | text | |
Tools tools | No | text |
Tips
- Agents are persistent named prompt+tool bundles. Re-use the agent_id in chat instead of resending the system prompt + tools each turn.
- Body: name + model + instructions + tools[] + (optional) handoffs[] for multi-agent routing.
Delete File
Delete an uploaded file
| Parameter | Required | Type | Description |
|---|---|---|---|
File Id file_id | Yes | text |
Tips
- DELETE /v1/files/{file_id} – permanent. Files attached to an active fine-tune cannot be deleted (returns 400 with model_dependency).
- Doesn't refund storage credits (files are stored free up to a workspace cap). Cleanup is hygiene, not cost-driven.
Create Embedding
Generate text embeddings
| Parameter | Required | Type | Description |
|---|---|---|---|
Model model | No | text | |
Input input | No | text | |
Encoding Format encoding_format | No | text |
Tips
- model=mistral-embed (1024-dim). Up to 32 inputs/call, ~16k tokens total.
- Embeddings are L2-normalised – cosine similarity == dot product on these.
Fill-in-the-Middle
Code completion with prefix + suffix (codestral)
| Parameter | Required | Type | Description |
|---|---|---|---|
Model model | No | text | |
Prompt prompt | No | text | |
Suffix suffix | No | text | |
Temperature temperature | No | text | |
Max Tokens max_tokens | No | text |
Tips
- Fill-in-the-middle – pass prompt (text before) + suffix (text after); model fills the gap. codestral-* models only.
- stop=['\n\n'] stops at blank line – useful when you want one logical block.
Get Model
Get model details
| Parameter | Required | Type | Description |
|---|---|---|---|
Model Id model_id | Yes | text |
Tips
- GET /v1/models/{model_id} – capabilities (completion_chat, completion_fim, function_calling, fine_tuning, vision), max_context_length, deprecation_date.
- Check deprecation_date before pinning a model in production – Mistral retires older versions on a ~6-month notice.
List Files
List uploaded files
No input parameters.
Tips
- GET /v1/files – uploaded files (fine-tune training data, batch inputs). Paginated; filter by purpose='fine-tune' or 'batch'.
- Files retained 30 days unless attached to a fine-tune. Past 30 days they vanish; archive the source elsewhere if you need long retention.
List Models
List available models
No input parameters.
Tips
- Returns every model accessible to the workspace: mistral-large-latest, mistral-small-latest, mistral-medium-latest, codestral-latest, ministral-3b/8b, pixtral-large, mistral-embed, mistral-moderation-latest, plus any of your fine-tunes.
- object='model' for base models, 'fine-tune' for trained variants. owned_by tells you whether it's mistralai/* (shared) or your-org/* (private fine-tune).
Content Moderation
Classify content for safety
| Parameter | Required | Type | Description |
|---|---|---|---|
Model model | No | text | |
Input input | No | text |
Tips
- model=mistral-moderation-latest – returns category scores (sexual, hate_and_discrimination, violence_and_threats, etc.). Threshold > 0.5 is a strong signal.
Upload File
Upload a file for fine-tuning or batch jobs
| Parameter | Required | Type | Description |
|---|---|---|---|
File file | No | text | |
Purpose purpose | No | text |
Tips
- purpose=fine-tune or batch. Returns file_id; pass it into the fine-tunes or batch endpoints.
- Files retained 30 days unless attached to a fine-tune.
FAQ
- EU data residency – guaranteed?
- Mistral hosts in EU by default and publishes a DPA. For full residency guarantees (no transit outside EU at all), Enterprise tier with the EU on-prem option is the safest contractual answer.
- Codestral pricing vs mistral-large?
- Codestral is purpose-built for code (FIM, infilling) and cheaper per-token than mistral-large. Use it for autocomplete, refactor, and code-only chat; use mistral-large for general reasoning.
- JSON mode actually returns JSON?
- response_format=json_object guarantees valid JSON, not adherence to a specific schema. Combine with a strict 'reply ONLY with JSON matching {...}' system prompt for schema compliance.
- Embedding dimensionality?
- mistral-embed returns 1024-dim vectors. Cosine similarity works directly (vectors are normalised). Don't truncate dimensions – Mistral's embeddings aren't Matryoshka-trained.