Models & inference
- La Plateforme — Mistral's hosted API product, reached at api.mistral.ai.
- Mistral Large / Small / Ministral — the general-purpose chat models, ordered by capability.
- Codestral — the code-specialist model, with a dedicated fill-in-the-middle endpoint.
- Embed (mistral-embed) — Mistral's embedding model, returns dense vectors for semantic search and RAG.
- Context window — the max combined input + output tokens the model can hold in one call.
- Decoding — the process of generating output tokens one at a time from the model's probability distribution.
- TTFT — time to first token; the perceived-latency metric that matters most for interactive UIs.
Tokens & pricing
- Token — the model's atomic unit; ~4 characters of English on average, though tokenization varies by language.
- Input tokens — everything you send: system prompt, user turns, tool defs, retrieved passages.
- Output tokens — the tokens the model generates in its reply. Priced higher than input.
- TPS / TPM — tokens per second / minute, the two axes of Mistral's per-key rate limits.
- Batch API — async request lane with a 24h SLA and a meaningful per-token discount.
- Prompt caching — server-side reuse of a fixed prompt prefix so its input cost only bills once.
Tool use & agents
- Tool / function — a JSON-schema-described operation the model can call.
- tool_calls — the assistant-message field carrying one or more requested calls.
- tool_choice — the request-level control that forces or forbids specific tools ('auto', 'any', 'none', or an object).
- Parallel tool calls — multiple tool_calls emitted in a single turn; execute concurrently.
- role: tool — the message role you use to return a tool's result to the model.
- Agent — a loop that alternates model calls and tool executions until a goal is reached.
Errors & ops
- 429 — rate-limited. Read Retry-After and back off exponentially.
- invalid_tool_schema — your tool JSON schema is not strict Draft-07 or is missing additionalProperties: false.
- Retry-After — server-supplied delay hint returned with 429s.
- Region — the physical deployment your requests hit; EU is the default for Mistral.
- SLA — service-level agreement; Batch API is 24h, live inference has no formal per-request SLA.
RAG & retrieval vocabulary
- RAG — retrieval-augmented generation; inject fetched passages so the model can cite fresh context.
- Top-k — the number of passages you retrieve for a query. Aggressive truncation (k ≤ 5) usually helps quality and always helps cost.
- Chunking — the step where you split documents into passages before embedding.
- Rerank — a second pass that reorders retrieved passages by relevance to the query.
Deployment & licensing
- Open weights — model weights released under a licence that lets you download and self-host (Mistral 7B, Mixtral, Codestral Mamba).
- Fine-tuning — continuing training on your own data to specialize a base model.
- MoE — Mixture of Experts; only a subset of expert sub-networks fire per token (used by Mixtral).
- OpenAI-compatible — a provider whose HTTP schema matches OpenAI's, so existing SDKs work by changing the base URL.
How to read a Mistral error response
Mistral errors follow a predictable shape: an HTTP status code, a machine-readable `type` field, and a human `message`. The status code tells you the category — 400 for your bug, 401 for auth, 429 for rate limits, 5xx for their side. The `type` narrows it: invalid_tool_schema, context_length_exceeded, model_not_found. The `message` is where the actual fix lives. Log all three, and when you file a support ticket include the request id from the response headers — it turns a vague repro into a lookup Mistral's support team can act on in minutes rather than days.
The pricing formulas in one paragraph
Cost per request equals (input_tokens × input_rate_per_million ÷ 1,000,000) + (output_tokens × output_rate_per_million ÷ 1,000,000). Cost per day equals cost per request × daily request volume. To model a workload before writing a check, take the mean input and output length per request from a representative log sample, multiply through both formulas, and add 30% for variance and growth. If your app has multiple endpoints on different models, do it per endpoint and sum. That single spreadsheet is enough to talk about scale with confidence.
Where these terms overlap with the wider LLM ecosystem
Most Mistral vocabulary is shared with the wider LLM ecosystem — tokens, context windows, tool_calls, RAG, embeddings mean the same thing at OpenAI, Anthropic, DeepSeek, and Hugging Face. The provider-specific parts are usually product names (La Plateforme vs Anthropic Workbench), quotas that differ per tier, and small schema differences like Mistral's `tool_choice: 'any'` where OpenAI uses `'required'`. Learning the shared vocabulary once lets you move between providers in an afternoon rather than a sprint, which is exactly why an OpenAI-compatible surface matters.
Pricing terms with a concrete Mistral example
Per-million-token rate: the unit on Mistral's price sheet. Every model has an input rate and an output rate, quoted per 1,000,000 tokens. Example: a request with 800 input tokens and 300 output tokens on a model priced $0.20/$0.60 per million costs (800 × 0.20 + 300 × 0.60) ÷ 1,000,000 = $0.000340. Effective rate: the blended per-million cost after prompt caching and batch discounts apply — usually 30–70% of list. Cached prefix: the leading tokens of a prompt that are eligible for prompt-cache pricing on tiers that support it. Batch discount: the ~50% off on `/v1/batch` submissions vs live inference. Committed-use rate: the negotiated per-token rate on an enterprise contract, tied to a monthly minimum. All five appear on your invoice or usage export somewhere; if you cannot reconcile a monthly bill to a formula built from these, your instrumentation has a gap worth closing.
Model terms every Mistral developer meets
Base model: an untuned checkpoint (`mistral-large-2411`) — the raw weights before instruction tuning. Instruct model: the same weights tuned to follow user instructions, which is what La Plateforme actually serves. Latest alias: `mistral-large-latest` resolves to Mistral's current recommended snapshot; pin to a dated version (`mistral-large-2411`) in production so a silent server-side upgrade cannot change your evals overnight. Fine-tuned model: a checkpoint you produced by continuing training on your own data. Open-weight model: a checkpoint released under a permissive licence (Mixtral, Codestral Mamba) that you can download and self-host. MoE (Mixture of Experts): the Mixtral architecture where only a subset of expert sub-networks fire per token, which is why an 8×22B model serves faster than the parameter count suggests. Context window: 32k or 128k tokens depending on model; every message and every retrieved passage counts against it.
API endpoints and what to call them for
`POST /v1/chat/completions`: the workhorse — chat turns, tool calls, streaming, JSON mode. `POST /v1/fim/completions`: fill-in-the-middle for Codestral IDE autocomplete; takes prefix + suffix, returns the middle. `POST /v1/embeddings`: dense vectors from `mistral-embed`, for search and RAG. `POST /v1/moderations`: content safety classification. `POST /v1/batch`: submit a JSONL file of requests, get back results within 24 hours at a discount. `GET /v1/models`: list available models and their ids. `POST /v1/agents`: Mistral's managed agent loop that wraps the model-call → tool-call → tool-response cycle. All endpoints live under `https://api.mistral.ai`, all authenticate with a bearer token from console.mistral.ai, and all return the same `usage` block so instrumentation code written for one endpoint works for the others with zero changes.
Parameter glossary for chat completions
`temperature` (0–1): randomness. 0 for extraction and deterministic tool use; 0.7 for chat; above 0.9 rarely helps. `top_p`: nucleus sampling; leave at 1 unless you know why. `max_tokens`: cap on output length — set this on every request, always; a runaway reply is the single most common surprise on the monthly bill. `stop`: array of strings that terminate generation. `stream`: true for SSE. `response_format`: `{ type: 'json_object' }` forces valid JSON output. `tools` / `tool_choice`: function-calling surface. `random_seed`: makes generation reproducible across runs for evals. `n`: number of completions per request (rarely used; costs stack). `safe_prompt`: server-side safety layer that prepends a Mistral-authored system prompt about refusal behavior. Get the first four right and 90% of your prompt-engineering surface area is covered.
Common Mistral errors explained
`400 invalid_tool_schema`: your tool JSON is not strict Draft-07 — usually missing `additionalProperties: false` or using `type: 'any'`. `400 context_length_exceeded`: input + max_tokens exceeds the model's context window; trim retrieval or switch to a longer-context model. `401 invalid_api_key`: the bearer token is wrong or revoked; rotate in console.mistral.ai. `403 permission_denied`: your key exists but is not entitled to the model requested — check tier. `404 model_not_found`: the model id is wrong; call `GET /v1/models` to see valid ids. `422 unprocessable_entity`: request body validates as JSON but fails semantic checks (e.g., `role: 'assistant'` message with both `content` and `tool_calls` set to null). `429 rate_limit_exceeded`: over TPM or RPM; back off using the `Retry-After` header and, if chronic, request a quota bump. `500 internal_server_error` / `503 service_unavailable`: Mistral-side; retry with exponential backoff. Every error includes an `x-request-id` header — capture it in your logs, and paste it into any support ticket to skip a day of back-and-forth.