Mistral integration

AI: chat completions, embeddings, fill-in-the-middle, agents, files (Mistral Le Plateforme)

Help CentreConnectors

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.

  1. In Mistral Console → API Keys, click Create new key.
  2. Paste it as the API token. Connector sends Authorization: Bearer <key>.
  3. 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.

OperationCategoryWhat it does
Chat CompletionGeneralGenerate a chat completion
Create AgentGeneralCreate a Mistral agent
Delete FileGeneralDelete an uploaded file
Create EmbeddingGeneralGenerate text embeddings
Fill-in-the-MiddleGeneralCode completion with prefix + suffix (codestral)
Get ModelGeneralGet model details
List FilesGeneralList uploaded files
List ModelsGeneralList available models
Content ModerationGeneralClassify content for safety
Upload FileGeneralUpload a file for fine-tuning or batch jobs

Operations

Chat Completion

Generate a chat completion

ParameterRequiredTypeDescription
Model modelNotext
Messages messagesNotext
Temperature temperatureNotext
Max Tokens max_tokensNotext
Top P top_pNotext
Tools toolsNotext
Tool Choice tool_choiceNotext

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

ParameterRequiredTypeDescription
Agent Id agent_idNotext
Messages messagesNotext
Temperature temperatureNotext
Max Tokens max_tokensNotext
Tools toolsNotext

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

ParameterRequiredTypeDescription
File Id file_idYestext

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

ParameterRequiredTypeDescription
Model modelNotext
Input inputNotext
Encoding Format encoding_formatNotext

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)

ParameterRequiredTypeDescription
Model modelNotext
Prompt promptNotext
Suffix suffixNotext
Temperature temperatureNotext
Max Tokens max_tokensNotext

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

ParameterRequiredTypeDescription
Model Id model_idYestext

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

ParameterRequiredTypeDescription
Model modelNotext
Input inputNotext

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

ParameterRequiredTypeDescription
File fileNotext
Purpose purposeNotext

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.

Related connectors

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or go live in 7 days.