Skip to content

Mistral model behaviour

Mistral's API and open weights — streaming shape, tool calling, function declines, and the parameters that behave differently from OpenAI's near-identical names.

Mistral’s chat endpoint was built to be familiar. It takes a messages array of role-tagged objects, it accepts temperature and max_tokens and stop, it streams server-sent events terminated by data: [DONE], and it returns choices with a finish_reason. If you have written against OpenAI, you can write against Mistral in an afternoon. That familiarity is the problem these pages exist for: the names are shared, the semantics are not always, and the divergences are concentrated in exactly the parameters people set once and never look at again.

So the subject here is not “how to call Mistral”. It is the specific behaviour behind each field — what tool_choice: "any" forces that "auto" does not, why JSON mode can emit an unbounded run of whitespace, what safe_prompt actually puts in your context and what it costs you, where the context window numbers come from and which of them are for models that no longer exist. Figures are sourced to Mistral’s own model cards and API reference and dated, because this is a vendor whose model line has turned over completely twice.

Mistral Large's Context Window and Output Limit

The documented context length for the current Mistral Large, why there is no separate output cap to quote, and how much room a real system prompt leaves you.

8 min read

Function Calling in the Mistral API: tool_choice Options

What each tool_choice value does to Mistral's output, including the 'any' mode that has no OpenAI equivalent, and the response shape each one produces.

9 min read

System Prompt Handling in the Mistral API

How the system role works in Mistral's messages array, where the documentation says to put it, and why a system message behaves differently from an instruction in the user turn.

8 min read

Mistral's Tokenizer: v1 to v3 and Why the Vocabulary Grew

The documented vocabulary size of each Mistral tokenizer version, what changed between them, and why a larger vocabulary produces fewer tokens for the same text.

9 min read

Mixtral's Context Window

The documented context length for Mixtral 8x7B and 8x22B, their retirement dates on Mistral's API, and what still applies if you are running the open weights.

8 min read

JSON Mode in the Mistral API: response_format Type json_object

What json_object guarantees, the documented failure that produces an infinite whitespace stream, and when to reach for a schema instead.

8 min read

The Streaming Response Shape of the Mistral Chat API

The SSE frames Mistral's chat endpoint emits, what each delta contains, how usage is reported, and the ten-minute idle timeout that ends a stream.

9 min read

The safe_prompt Parameter in the Mistral API

What safe_prompt injects into your conversation, the exact text of the guardrail, what it costs you, and its current deprecated status.

8 min read

Codestral's Context Window and What It's Tuned For

The documented context length for the current Codestral, how it grew from the original release, and why the fill-in-the-middle endpoint changes how you should spend it.

8 min read

Stop Sequences in the Mistral API

The shape of Mistral's stop parameter, what happens to the matched text, and the tokenisation boundary problem that makes a stop sequence fail to fire.

8 min read

Mistral's Licence Terms: Apache 2.0 Models and Research-Only Releases

Which Mistral weights ship under Apache 2.0, which ship under the Mistral Research Licence, and what the difference means for a product you charge for.

9 min read

Parallel Tool Calls in the Mistral API

What a Mistral response looks like when the model requests several tools at once, and the exact rule for matching each result back to its call.

9 min read

The random_seed Parameter in the Mistral API

What fixing random_seed does to a Mistral request, why identical seeds still produce different text, and what to use instead when you need a test that passes twice.

9 min read

Mistral's max_tokens Default and Output Ceiling

What happens when you omit max_tokens on a Mistral request, what actually caps the length of a completion, and how to read the current per-model number rather than trusting a copied table.

9 min read

Mistral Small's Context Window

The documented context length for the current Mistral Small line, why older Small releases were much shorter, and how to read the exact figure for the version you are calling.

8 min read

Mistral's Instruct Prompt Template, and What Raw Completion Mode Skips

The [INST] template Mistral's instruct models were fine-tuned on, how multi-turn conversations are laid out inside it, and what changes when you send raw text instead.

9 min read

When Mistral Declines to Call a Tool

Why a Mistral model answers in prose when a perfectly good tool was available, what tool_choice auto actually promises, and how to force the call when you need one.

9 min read

Pinning a Dated Mistral Model Version

Swap a moving family alias like mistral-large-latest for a dated snapshot, verify the pin took, and set up the check that tells you before the snapshot retires.

9 min read

Mistral's Embeddings Model: Dimension and Token Limit per Request

The documented output dimension and per-input token cap for mistral-embed, what happens to text that exceeds it, and how to size chunks and batches around both.

8 min read

What Model Version the Mistral API Actually Serves Under a Family Name

How to find the dated snapshot behind mistral-large-latest or mistral-small-latest today, using the alias mapping the API publishes rather than a figure someone wrote down.

8 min read

Other topics