By Faheem R. Khattak | Facts checked 1 December 2026
Mistral Agents Explained: Websearch, Code Interpreter, and AI Agents
A Mistral agent is a Mistral model given instructions and tools, running in a loop: it reads your request, decides what to do, calls a tool — a web search, a Python sandbox, your own function, a connected MCP server — reads the result, and repeats until it has an answer. That loop is the whole idea, and everything in this guide is the practical detail of building one on Mistral’s platform as it stands on 1 December 2026. If you have built agents on another platform, the shape will feel familiar: model, instructions, tools, state, approvals. What is different is Mistral’s own story, and it has moved fast in the last month — fast enough that most tutorials written before November 2026 are now wrong about the recommended way to build.
The headline change is this: the Agents API, launched on 27 May 2025, is being deprecated. Mistral’s own documentation now says, in plain words, “The Agents API v1 is about to be deprecated. Build new agents with the Agents SDK.” The replacement is the Agents SDK, a Python package in public preview since 5 November 2026, in which the agent is an object in your code and the loop runs in your process. This guide leads with the SDK as the current path, covers the Agents API as the legacy path, and includes a full migration section — because a reader who starts a new project on the API today is starting on a path Mistral has already marked for retirement. One caution that belongs in the first paragraph, not a footnote: Mistral has published no removal date for the Agents API or the Conversations API, and this guide invents none. Deprecated, with no published removal date, is the whole truth as of 1 December 2026.
Two more facts from yesterday change what this guide recommends. Codestral 25.08 was deprecated on 30 November 2026 — yesterday — and retires on 31 December 2026, so no new agent in this guide is built on Codestral. Mistral Large 3 and Mistral Medium 3.5 were deprecated on 31 October 2026 and retire on 30 April 2027, so the model picks in this guide are Mistral Large 4 and Mistral Small 4, named by their versioned API names. If you have read Mistral’s own documentation, you will have noticed its websearch example still uses mistral-medium-latest — that alias now resolves to Medium 3.5, a deprecated model, so this guide does not copy that example as a recommendation. Versions move, and this guide is dated 1 December 2026 for exactly that reason: check the source pages named in the Sources section before you build, because they are the authority, not this guide.
One boundary, stated up front so the rest of the guide stays focused. The Mistral company story, the full model family, Vibe, and Studio’s non-agent pillars are covered in our explainer Mistral AI Explained, which maps the whole family. This guide is the developer companion to it: the SDK quickstart, the tools one by one, the migration, the memory and approvals, the model picks, and the pricing model. It does not re-explain the company or the model family; it assumes you have that map and want to build.

1. The Short Answer: What a Mistral Agent Is
<img src="

” alt=”A glowing circular track with a question entering, tools spinning around it and an answer coming out, an agent at work. No words.”>
A Mistral agent is three things working together. First, a model — usually Mistral Large 4 for the hardest work or Mistral Small 4 for fast, cheap agents. Second, instructions: a plain-language description of what the agent is for, how it should behave, and what it should never do. Third, tools: the things the agent can call when words alone are not enough. A web search when the answer needs today’s news. A code interpreter when the answer needs a calculation or a chart. Your own function when the answer lives in your systems. A document library when the answer lives in your files. A registered MCP server when the answer lives in another application. The model plans, the tools act, and the loop repeats until the agent has something worth returning.
That loop is what separates an agent from a chatbot. A chatbot answers from what the model already knows, which stops at its training cutoff. An agent goes and finds out: it searches, it runs code, it reads your documents, it calls your API, and it brings the result back into the conversation. Mistral’s own launch announcement for the Agents API put it this way: agents are “autonomous systems powered by large language models (LLMs) that, given high-level instructions, can plan, use tools, carry out steps of processing, and take actions to achieve specific goals.” The definition has not changed. What has changed is where the loop lives and how you build it.
There are two ways to build, and the choice between them is the first decision this guide settles. The current way is the Agents SDK, package mistralai-agents for Python. The agent is a Python object in your code — agents.Agent(model=..., instructions=...) — and the harness runs the loop inside your process. You deploy it three ways, with the same code: in-process inside your application, self-hosted on your own servers, or Mistral-managed on Mistral’s infrastructure. The SDK is in public preview, which Mistral labels on the features themselves, and the honest meaning of that label is that the API, the behaviour and the limits may change, and an update may require code changes. It is the recommended path and it is a preview; this guide says both, because both are true.
The old way is the Agents API v1, launched on 27 May 2025. You create an agent on Mistral’s servers, then run conversations against it through the Conversations API. It still works, and section 2 explains exactly who should migrate now and who can wait — but no new project should start on it. Mistral’s migration page opens with the sentence that settles the question: “The Agents SDK replaces the Agents and Conversations API.” The rest of this guide is written for the SDK first and the API second, in that order, and every command and code fragment comes from Mistral’s own documentation as read on 1 December 2026.
The model family behind the agents is the short version only, because the full map is our Mistral AI Explained guide, linked in the introduction. Mistral Large 4 is the flagship: generally available, version 26.10, a 1-million-token context window, an open-weight hybrid model that unifies instruction, reasoning and agentic capabilities in one model, and natively fluent in more than 160 languages. Mistral Small 4 is the fast, cheap counterpart, unifying instruction, reasoning and coding ability in one smaller model. Ministral 3 is the compact line, in 3B, 8B and 14B sizes, with image understanding. That is all the family this guide needs; the model-picking detail, with prices and the deprecation table, is section 12. For the general idea of what an AI agent is — the concept rather than Mistral’s version of it — our guide to AI agents explained covers the concept, the tool-use pattern, multi-agent systems, and the ways agents fail.
What you will be able to do by the end of this guide: scaffold a working agent in about ten minutes, give it web search and a code interpreter, connect your own functions, ground it in your documents, let it generate an image, connect it to an MCP server, split work across subagents, keep its memory and approvals under control, pick the right model, and work out what it will cost. That is the whole job, and it starts with the migration question.
2. Two Ways to Build: The Agents SDK vs the Agents API

The Agents API arrived on 27 May 2025 with a launch announcement titled “Build AI agents with the Mistral Agents API”. It was a real step forward at the time: create an agent on Mistral’s servers with instructions and built-in tools, run stateful conversations against it, let it search the web, run Python, call your functions, hand off to specialist agents, and branch a conversation from any point. Developers built on it for five months. Then, on 5 November 2026, Mistral expanded Studio with Managed Agents, a workflow builder, apps, evaluations and tracing — and the Agents SDK arrived in public preview as part of that release. The 5 November 2026 date is secondary-corroborated: four independent reports agree on it, and Mistral’s own release-notes page was not re-read first-hand for this guide, so the date is stated with that sourcing. The SDK changes where the agent lives: instead of an object on Mistral’s servers that you talk to over an API, the agent is an object in your Python code, and the harness that runs the loop lives in your process.
The deprecation is stated on Mistral’s own Tools documentation page: “The Agents API v1 is about to be deprecated. Build new agents with the Agents SDK.” The migration page is blunter still: “The Agents SDK replaces the Agents and Conversations API.” Read together, the two sentences are the whole policy. What Mistral has not done is publish a removal date. No page read on 1 December 2026 gives one, and several independent write-ups from November 2026 agree that no removal date has been published. So the honest statement is: the Agents API is being deprecated, with no removal date published. Do not let any tutorial tell you it “shuts down” on a date — that date does not exist in anything Mistral has published.
The practical difference between the two paths is worth understanding before you choose, because it is a difference of architecture, not just of fashion. In the Agents API, the agent is a server-side resource: you create it with an API call, it keeps versions, and conversations run against it on Mistral’s side. In the SDK, the agent is your code: a Python object you construct, tools you write as decorated Python functions, and a harness that calls them for you. The SDK’s three run modes are the same code with no changes. In-process mode runs the agent inside your application, with sessions living in your process memory — the fastest way to develop and the natural fit for an agent embedded in an existing app. Self-hosted mode runs a long-running worker on your servers with agents serve, and sessions are stored by Mistral. Mistral-managed mode deploys with agents deploy: you push code, Mistral handles building, scaling and the lifecycle. That last mode is the one the 5 November 2026 Studio expansion was built around — Managed Agents as a product, with the workflow builder, apps, evaluations and tracing alongside it. Our news coverage of that launch, Mistral Studio Managed Agents and Apps, covers what arrived that day; this guide covers how to build on it.
The migration itself is documented concept by concept on Mistral’s migration page, and the table below is the honest summary of it — every row is a real difference, and none of it is guesswork.
| Concept | Agents API (legacy) | Agents SDK (current) |
|---|---|---|
| Where the agent lives | On Mistral’s servers, created by API call | In your Python code, as an agents.Agent object |
| Where the loop runs | Server-side, through the Conversations API | In your process (in-process), on your servers (agents serve), or on Mistral’s infrastructure (agents deploy) |
| Defining a tool | JSON schema for a function; your code runs it and returns the result | A Python function with the @agents.tool decorator; the harness calls it |
| Built-in tools | Declared on the agent; executed on Mistral’s side | Reached through your own tool calling the Conversations API, or declared directly for document libraries |
| Conversations | Server-side, stateful, branchable | Sessions in your process or stored by Mistral when deployed |
| Handoffs | handoffs=[...] on the agent | subagents=[agents.Subagent(...)] on the planner |
| Approvals | requires_confirmation in tool configuration | permission_mode="ask" or a permission_policy |
| Structured output | completion_args with a JSON schema response format | A Pydantic model passed as output_type= |
| Versions | The API agent keeps versions; update_version() picks one | Your code at one commit; each new deploy under the same name replaces it |
| Streaming | conversations.start_stream() | on_event= with agents.TextDelta events |
Who should migrate now, and who can wait? If you are starting a new agent today, there is no decision to make: build it on the SDK, following section 3. If you have an agent in production on the Agents API, the absence of a removal date means there is no emergency — but the direction is unambiguous, and the migration page exists precisely so you can plan the move on your own schedule rather than under a deadline. The one group that should move soonest is anyone whose agent depends on features the SDK changes most: function calling, where the decorator replaces the manual round-trip; handoffs, which become subagents; and deployment, where the managed mode replaces a server you run yourself. The group that can wait longest is anyone with a small, stable API agent that does one job well and rarely changes — it will keep working while you plan, and the migration page will still be there.
One more API surface deserves a sentence, because readers will meet it and wonder where it fits. Mistral also offers a Responses API, a separate agent-native endpoint for building agents without the full Agents API, and our coverage of it — Mistral Responses API for agent builders — explains that surface. It is not the subject of this guide, and it is not the SDK’s replacement: the SDK is the current path for building agents, and the Responses API is another way to reach Mistral’s models for agent-style work. Do not confuse the two, and do not build a new agent on the Agents API because you read a tutorial from before 5 November 2026. That is the single most expensive mistake this guide exists to prevent.
A final note on the preview label, because it matters to anyone planning production work. Public preview means the API, the behaviour and the limits may change, and an update may require code changes. That is not a reason to avoid the SDK — it is the recommended path, and Mistral is building Studio around it — but it is a reason to pin your version, read the release notes before you upgrade, and keep your agent’s behaviour covered by tests of your own. Section 3 pins version 1.1.0, the version the migration guide itself uses, and does not claim any newer version.
3. Your First Agent in 10 Minutes: The SDK Quickstart

The quickest way to understand the SDK is to build a small agent and watch it work. The steps below come from Mistral’s own Quickstart, read on 1 December 2026, and the commands are copied exactly as the documentation gives them. You need Python 3.12, 3.13 or 3.14 — the standard build, not the free-threaded 3.14t build — and a Mistral API key. The Quickstart scaffolds a project for you:
uvx --python 3.12 --from mistralai-agents agents init hello-agent
That command creates a project called hello-agent with the starter files, including a main.py and a .env file for your key. Put your Mistral API key in .env as MISTRAL_API_KEY. If you would rather install the package into an existing project, the migration guide’s install line is:
uv add "mistralai-agents==1.1.0"
Version 1.1.0 is the version the migration guide pins, and it is the only version this guide states. A secondary source reports version 1.1.3 on PyPI as of 13 November 2026, but that version was not verified first-hand for this guide, so it is not stated here as the version to install. Pin 1.1.0, as the guide does, and check PyPI yourself before you move to a newer release. The package is called mistralai-agents; you import it as from mistralai import agents.
The starter agent in main.py is a weather agent, and it is worth reading carefully because it shows the whole SDK pattern in a few lines. The agent is a Python object:
agent = agents.Agent(model="mistral-large-4", instructions="...")
A tool is an ordinary Python function with the @agents.tool decorator. The starter’s example tool is get_weather, and the important detail is how the model decides to call it: it reads the function’s name, its docstring and its typed parameters. Write the docstring as if you were explaining the function to a colleague, because in a real sense you are — the model is the colleague, and a vague docstring produces vague tool use. The harness calls the function for you when the model asks for it; there is no manual round-trip code to write, no JSON schema to hand-craft, and no result to append by hand. That is the single biggest difference from the Agents API’s function calling, and it is the reason the SDK feels simpler in practice.
Running the agent is one call:
await agent.run("...")
That starts a session, sends your message, and returns the turn’s result. For a conversation rather than a single turn, open a session explicitly:
session = await agent.start_session()
await session.run("...")
Each session.run(...) is one more message in the same session, and the agent remembers what came before. The Quickstart also gives you a terminal chat over the same main.py with agents chat: type messages, watch the agent answer, press Ctrl+C to interrupt a turn, and Ctrl+D or /exit to end the chat. It is the fastest way to test an agent you are building, and it is where you should spend your first ten minutes.
Adding a second tool is the moment the pattern clicks. Write another decorated function — a second @agents.tool — and pass both tools to the agent. The model now has two things it can do, and it chooses between them from the request: a question about the weather goes to the weather tool, a question about something else goes to the other tool, and a question that needs both gets both, in whatever order the model decides. There is no routing code to write. The routing is the model’s job, and your job is to make each tool’s name, docstring and parameters clear enough that the choice is obvious. If the model keeps choosing the wrong tool, the fix is almost always a better docstring, not more code.
Two details from the Quickstart deserve attention before you go further. First, structured output: pass a Pydantic model as output_type=, and the completed record’s output is the parsed object — the agent’s answer comes back as a typed record you can use directly in your code, not as text you have to parse. Second, traces: once an agent is deployed, each turn appears as a trace in Mistral Studio, with one span per model call and one span per tool call, so you can see exactly what the agent did, in what order, and where it spent its time. Traces are the difference between guessing why an agent behaved oddly and knowing. Section 11 returns to sessions, memory and approvals in full; for now, the point is that ten minutes with the Quickstart gives you a working agent, a chat to test it in, and a trace to inspect it with.
4. The Tool Map: Everything a Mistral Agent Can Use

A Mistral agent’s tools fall into three groups, and the group determines who runs the tool — which is the question that decides your security model, your costs and your debugging. Built-in tools run on Mistral’s side, inside Mistral’s internal environment, and they are ready out of the box. Function tools run in your code, on your machines, under your control. Connectors are registered MCP servers that Mistral calls on your behalf. The table below is the whole map, from Mistral’s own Tools documentation page, read on 1 December 2026.
| Tool | Type | Who executes it | What it does |
|---|---|---|---|
web_search | Built-in | Mistral | Search engine access, with citations |
web_search_premium | Built-in | Mistral | Search plus news articles via integrated news-provider verification |
code_interpreter | Built-in | Mistral | Python in an isolated container: plots, analysis, maths |
image_generation | Built-in | Mistral | Images via Black Forest Labs FLUX1.1 [pro] Ultra |
document_library | Built-in | Mistral | Retrieval over documents uploaded to your Libraries |
| Function calling | Custom | Your code (local) | Your functions, declared with a JSON schema |
| Connectors | MCP servers | Mistral (server-side) | Registered MCP servers; tools discovered automatically |
Built-in tools have one property that matters more than any other: they are also usable directly through the Conversations API without creating an agent first. If you only need one web search or one code execution, you do not need an agent at all — you can call the Conversations API with the tool and get the result. The agent earns its keep when the work needs several tools, several turns, memory across turns, or delegation to specialists. That is a useful rule of thumb for deciding whether to build an agent or just make an API call.
There is also an API support rule that catches people out, and it is stated plainly on Mistral’s Tools page. web_search, web_search_premium and code_interpreter work with the Conversations API (/v1/conversations) and the Agents API. They are not supported in the Chat Completions API (/v1/chat/completions), because Chat Completions responses do not include the search-result references these tools return. image_generation is the exception: it is also supported in Chat Completions. The practical consequence is simple. If your code uses Chat Completions and you want web search or a code interpreter, you need to move to the Conversations API or the SDK — the old endpoint cannot carry those tools, and no parameter will make it do so.
Two more facts from the Tools page are worth knowing before you design anything. First, you can use multiple tools at the same time — Mistral’s own words are “You can use multiple tools at the same time!” — so an agent that needs to search the web and run code and read a document can have all three available at once, and the model decides which to call and in what order. Second, in the SDK the built-in tools are reached differently from the API: a hosted tool such as web search is reached through a tool of yours that calls the Conversations API; for document libraries you pass tools=[{"type": "document_library", "library_ids": [...]}]; and for image generation you return the image URL from the tool execution entry. The migration page documents each of these, and section 8 and section 9 walk through them in context. The point of this section is the map itself: five built-in tools, your own functions, and MCP connectors — and the knowledge of who runs each one.
5. Websearch: Giving Your Agent Today’s News

Every language model has a knowledge cutoff — a date after which it knows nothing, because its training data ends. Websearch is the tool that fixes that. Mistral’s documentation describes it as “the capability to browse the web in search of information”, and calls it “a handy tool for any agent that needs to be up to date with the world.” An agent with websearch can answer questions about events that happened after its training, check a specific website, verify a claim against a live source, or gather the latest numbers before it writes. Without websearch, an agent can only answer from what it already knows; with it, the agent can go and find out.
There are two versions, and choosing between them is the first decision in this section. web_search is, in Mistral’s words, “a simple web search tool that enables access to a search engine.” web_search_premium is “a more complex web search tool that enables access to both a search engine and to news articles via integrated news provider verification.” The premium tier adds news articles with verification through an integrated news provider; a secondary read of the launch announcement by Simon Willison names AFP and AP as the news agencies behind that verification, but that detail comes from Willison’s read rather than from the documentation page itself, so treat the agency names as secondary-reported and the news-verification feature as Mistral’s own claim. For most agents, the choice is straightforward: web_search for general research and fact-checking, web_search_premium when the answer depends on verified news — a breaking story, a market event, a claim that needs a news source behind it.
The results come back with citations, and the citation format is part of the design. The answer’s message.output content interleaves text chunks with tool_reference chunks carrying a title, a url and a source — those are the citations, and they are what make a websearch answer checkable rather than merely plausible. The tool execution itself appears as a tool.execution entry with name: web_search, timestamps and an id, so the trace shows exactly when the search happened and what it returned. If you are building an agent whose answers people will rely on, surface those citations to the user. An answer with a source is verifiable; an answer without one is a claim, and the difference matters more as the stakes rise.
There is a control on websearch that many builders miss until it bites them: domain filtering. An organisation admin can restrict which websites web search returns, with an allowlist or a blocklist, and the filtering is applied before the agent sees the results — including inside web_search_premium. The trap is how the filtering behaves. Filtered results are removed silently: they are not returned, not cited, not visible to the model, and the response carries no indication that anything was removed. If every result is dropped, the search returns nothing at all. An agent in a filtered organisation can therefore confidently answer from a partial picture, or answer nothing, without ever knowing that results were withheld. The same lists cover open_url: a blocked domain is refused with HTTP 451, Unavailable For Legal Reasons. If you administer an organisation, understand that the filter is invisible to the agent by design; if you build an agent for a filtered organisation, know that silence in the results may mean filtering, not absence. Test your agent’s search behaviour against domains you know are filtered, so the gap is a known quantity rather than a surprise in production.
Does websearch actually make the model more accurate? Mistral’s own blog gives a number, and it is a large one. On the SimpleQA benchmark — a test of short, factual questions with a single correct answer — Mistral Large with web search scores 75%, against 23% without it. Mistral Medium scores 82.32% with web search, against 22.08% without. Those are Mistral-reported figures from Mistral’s own announcement, not independent measurements, and this guide labels them as such. They are also the only agent benchmark figures in this guide, because no other agent benchmark was verified for this post. The direction is what matters rather than the decimals: a model that can search is dramatically more accurate on factual questions than the same model without search, because it stops guessing and starts looking. That is the whole argument for giving your agent websearch, and it is the argument Mistral’s own numbers make.
A practical note on using websearch well, drawn from how the tool works rather than from any single page. Give the agent a reason to search and a standard for the result: instructions such as “search before answering questions about events after your training data, and cite the source for every factual claim” produce visibly better answers than an agent that is merely allowed to search. And remember the API rule from section 4: websearch works with the Conversations API and the Agents API, not with Chat Completions. If your agent searches and gets nothing back, check first that you are calling the right endpoint — it is the most common cause of a silent failure, and the fix is a different API call, not a different prompt.
6. Code Interpreter: A Python Sandbox Inside Your Agent

Some questions cannot be answered in words. They need a calculation, a chart, a table, or a piece of code run to see whether it works. The code interpreter is the tool for those questions. Mistral’s documentation describes it as adding “the capability to safely execute code in an isolated container”, and lists the uses plainly: graphs, data analysis, mathematical operations, code validation, “and much more.” The agent writes Python, the interpreter runs it on Mistral’s side, and the result comes back into the conversation — a number, a table, a chart, or the output of the code itself.
The documentation’s worked example is deliberately simple, and it is worth following because it shows the shape of every code-interpreter interaction. You create an agent with the code_interpreter tool, start a conversation, and the model runs code on demand. The example asks for a Python function, fibonacci(n), that generates the first 20 Fibonacci numbers. The model writes the function, the interpreter runs it, and the answer comes back with the numbers. Nothing about the example is special — that is the point. Any time the model needs to compute rather than recall, it writes code and runs it, and the answer it gives is grounded in the output of that code rather than in its memory of what the answer ought to be.
The output has a shape worth knowing, because it is how you read what happened. The execution appears as a tool.execution entry whose info section carries code — what was executed — and code_output — the result. A final message.output then presents the answer to the user. That separation matters for debugging: if an agent’s arithmetic is wrong, the trace shows you the code it ran and the output it got, so you can tell whether the code was wrong, the output was misread, or the answer was garbled in presentation. Keep the code visible in your traces. An agent that shows its working is an agent you can trust, and an agent that hides it is one you cannot audit.
Files the code produces are handled the same way. Charts and CSVs arrive as tool_file chunks, and you download them with the Files API — files.download(). The pattern is: ask the agent for a chart, let it write the plotting code, let the interpreter produce the image file, and download the file from the conversation. It is a small workflow, but it is the difference between an agent that describes a chart and an agent that delivers one.
The sandbox boundary is the part to understand before you give an agent the interpreter. The code runs in an isolated container on Mistral’s side. It cannot read files on your machine. If the agent needs your data, pass it in the prompt, or upload it as a document and let the agent retrieve it — section 8 covers the document route. That boundary is a feature, not a limitation: the agent can run arbitrary code without ever touching your filesystem, which is exactly the property you want when a model is writing code you have not reviewed. Do not try to work around it. Design for it: put the data where the agent can reach it, through the prompt or through a document library, and let the sandbox stay a sandbox.
In the SDK, the interpreter becomes the agent’s environment rather than a tool you declare. You pass environment=agents.MistralSandbox() — “a container in which the model runs Python and shell commands.” Two setup details from the migration page matter here. The Mistral sandbox needs the koyeb extra, installed with uv add "mistralai-agents[koyeb]==1.1.0", and it needs the cloud_user workspace role, shown as “Mistral Cloud User” in the console. If your sandbox fails to start, check those two things first: the extra and the role. They are the most common cause of a sandbox that will not run, and both are fixed in configuration rather than in code.
What this guide does not tell you is the interpreter’s limits, because they could not be verified. Execution timeout, memory and CPU limits, maximum file size, and which Python packages are pre-installed — none of these appear on the documentation pages read on 1 December 2026, so none of them are stated here. Do not plan a workload around a limit you read in a tutorial; check Mistral’s documentation for the current limits on the day you build, and design your agent to fail gracefully when it hits one. A data-analysis agent that reports “the computation timed out, here is what I completed” is far more useful than one that silently returns a partial answer. For the coding-agent angle more broadly — what coding assistants do, and how they compare — our guide to AI coding assistants compared covers the assistants themselves, and a Mistral agent with a code interpreter is a legitimate engine for one, for code you would rather run in Mistral’s sandbox than on your own machine.
7. Function Calling: Connecting Your Own Code

Built-in tools cover what Mistral runs. Function calling covers everything else: your databases, your APIs, your business logic, your own code. The pattern is the same in both the API and the SDK, but the mechanics differ, and the SDK’s version is simpler enough that it is worth seeing the two side by side.
In the Agents API, the pattern is a round-trip you write yourself. You define a function and provide its JSON schema, then create the agent with it. When the model wants to use the function, it outputs a function call instead of an answer. Your code detects the call, runs the function, and returns the result to the conversation with conversations.append() and a FunctionResultEntry. The model reads the result and continues. You own the round-trip: detection, execution, and return. It works, and every Agents API agent with custom tools is built this way — but it is boilerplate, and boilerplate is where bugs live.
In the SDK, the round-trip disappears. You decorate the function with @agents.tool. The model reads the function’s name, its docstring and its typed parameters, and decides when to call it. The harness calls it for you — no detection code, no manual result append, no JSON schema to hand-write. The schema is derived from the function itself: the name, the docstring, and the type annotations on the parameters. That derivation is why the docstring matters so much. A function called get_weather with the docstring “Returns the current weather for a city” and a typed city: str parameter is self-describing; a function called do_thing with no docstring is a mystery, and the model will treat it as one. Write functions for the model the way you would write them for a new colleague: clear names, honest docstrings, precise types.
There is a second kind of function in the SDK that solves a problem the API pattern handles awkwardly: answers that exist only in the application running the agent. The user’s location is the classic example — the agent cannot know it, and no server-side tool can fetch it, because it lives in the app on the user’s device. The SDK calls these client tools. You declare the function as a client tool with @agents.client_tool, bind the answering function with .answer, and pass it to run() via on_client_tool=. The model asks, your app answers, the agent continues. Client tools are the bridge between the agent and the world only the client can see, and they are the right answer whenever the data is local to the user rather than to your servers.
Who runs what, stated once more because it is the security model: built-in tools run on Mistral’s side; function tools run in your code. Your functions execute with whatever permissions your code has, so a function that deletes records can delete records, and a function that charges a card can charge a card. The agent does not know or care what the function does — it only knows the name, the docstring and the parameters. That is why approvals exist, and why section 11 treats them as a first-class feature rather than an afterthought. A function tool is a loaded capability wearing a friendly name, and the docstring is not a safety boundary. The approval is.
Three design rules follow from all of this, and they are worth adopting before your first function. First, make each function do one thing, and name it for that thing. A function called search_orders is callable; a function called handle_data is not. Second, keep the parameters typed and few. The model reasons about types — a str is a name, an int is a count, a date is a date — and every untyped or ambiguous parameter is a chance for the model to pass the wrong thing. Third, return results the model can use: short, structured, and complete enough to answer from, without dumping a whole database row into the conversation. A function that returns a hundred fields will cost you tokens and confuse the model; a function that returns the five fields the answer needs is a better tool in every way.
8. Document Libraries: RAG Without Building a Pipeline

Most of the knowledge an agent needs does not live on the web and does not live in the model. It lives in your documents: the handbook, the policy file, the product manual, the contract, the research archive. Document libraries are Mistral’s answer to that problem, and they are the simplest form of retrieval-augmented generation — RAG — that Mistral offers: upload your documents to a Library, give the agent the document_library tool, and the agent retrieves the relevant passages when it needs them, then grounds its answer in what it retrieved.
The mechanics are deliberately unglamorous. You upload documents to your Libraries in Mistral Studio. You declare the document_library tool on the agent, pointing at the library or libraries it may use. When the agent needs information from your documents, it calls the tool, the tool retrieves the relevant passages, and the model answers from those passages rather than from its training data. In the SDK you pass the tool as tools=[{"type": "document_library", "library_ids": [...]}], naming the libraries by id. There is no pipeline to build, no embedding model to choose, no vector database to run, and no retrieval code to write. That is the point: the library is the pipeline, and Mistral runs it.
What document libraries are not matters as much as what they are. They are not training and they are not fine-tuning. Uploading a document does not teach the model anything permanently; it gives the agent something to read at answer time, and the agent’s knowledge of your documents lasts exactly as long as the retrieval does. That distinction has two practical consequences. First, updating a document updates the agent’s answers, because the next retrieval reads the new version — there is no retraining step, and no stale weights to worry about. Second, the agent can only answer from what it retrieves, so the quality of the answer depends on the quality of the documents and the quality of the retrieval. A library full of outdated, contradictory or badly written documents will produce an agent that answers confidently from outdated, contradictory or badly written material. Curate the library the way you would curate a reference shelf: keep it current, remove what is superseded, and do not upload documents you would not want quoted back to you.
The pattern works best for a specific kind of question: “what does our policy say about X”, “what did the report conclude about Y”, “summarise the contract’s position on Z”. Those are retrieval questions, and a document library answers them well. It works worst for questions that need reasoning across many documents, or synthesis of material the retrieval cannot surface in one pass. For those, the answer is usually a better agent design — a planner that breaks the question into retrieval steps, or subagents that each read one part of the library — rather than a bigger library. Section 10 covers that design. And the sandbox boundary from section 6 applies here too: if your code interpreter needs data from a document, upload the document to a library and let the agent retrieve it, rather than trying to hand the sandbox a file it cannot see.
One honest limit belongs in this section. The documentation pages read on 1 December 2026 do not state the document library’s limits — maximum documents, maximum pages, indexing time, or supported file types — so this guide states none of them. Check the current limits on Mistral’s documentation before you plan a library around a number, and test with your real documents rather than assuming a format is supported because it worked elsewhere. A library is only as good as the documents it can actually ingest, and the ingestion behaviour is the thing to verify first, before you build an agent on top of it.
9. Image Generation and Connectors: FLUX Images and MCP

An agent that can only write is half an agent. The image_generation tool gives it the other half: the ability to produce an image on request. The engine behind it is Black Forest Labs FLUX1.1 [pro] Ultra, as Mistral’s launch blog stated in May 2025, and the tool is the one built-in tool that also works in the Chat Completions API, not only in Conversations and the Agents API. In the SDK, image generation is reached through a tool of yours that returns the image URL from the tool execution entry — the model asks for an image, your tool runs the generation, and the URL comes back as the result.
Keep the expectations honest. Image generation in an agent is for illustrations, diagrams and visual drafts — the picture that accompanies an answer, the mock-up that shows an idea, the chart rendered as an image. It is not a design tool, and the agent cannot iterate on an image the way a human designer would, because it cannot see the image it just made unless you show it the result. Use it for one-shot visuals where a good first attempt is enough, and do not build a workflow that depends on the agent judging its own pictures. The engine detail itself — whether FLUX1.1 [pro] Ultra is still the engine — was stated in the May 2025 blog and was not re-confirmed on a documentation page read for this guide, so this guide dates that claim to the blog and does not present it as a current specification. Output sizes, formats and per-image latency were not verified either, and are not stated here.
Connectors are the more important half of this section, because they are how an agent reaches the rest of your software. A connector is a registered MCP server — a Model Context Protocol server — used as a tool in conversations and agents. Mistral’s documentation puts the key fact in one sentence: “You don’t run an MCP client yourself.” You register the server, the model discovers its tools, and it calls the ones that match the request. You can also call a tool directly when you know which one you want. The agent does not need to know how the server works, what protocol it speaks, or where it lives; it sees tools, and it calls them.
Connectors are in public preview, and the API can change — the same caveat as the SDK itself, and worth repeating because a connector is a dependency on someone else’s server. There is also a permissions detail that matters from the first day. API keys have a Connector access scope: the default is “Shared connectors only”, and private connectors need a key created with the “Private and shared connectors” scope. If your agent cannot see a connector you registered, check the key’s scope before you debug anything else. It is the most common cause of a missing connector, and it is a configuration fix, not a code fix.
Mistral’s own announcement shows what connectors make possible, through five demo agents that are worth knowing because they map the patterns. A coding assistant oversees a developer agent to write code, with full authority over GitHub. A Linear tickets assistant turns call transcripts into product requirements and actionable Linear issues through a multi-server MCP architecture. A financial analyst orchestrates multiple MCP servers to source financial metrics, compile insights and archive results. A travel assistant plans trips, books accommodation and manages travel needs. A nutrition assistant tracks goals, logs meals, makes suggestions and keeps the history. Those are Mistral’s own demos, with cookbook links on GitHub, and they are usable as the “what people build” examples for this guide — with one caveat the reader must know. The coding demo’s model is Devstral, and Devstral 2 is now retired, having been retired on 31 July 2026. The pattern is not dated; the model in the demo is. Build the same pattern on Large 4 or Small 4, which absorbed the coding line, and do not copy the demo’s model choice.
The GitHub demo deserves one more sentence, because it is the pattern most readers will copy first. An agent with authority over a repository is an agent that can write code, open pull requests and merge them — which is exactly the capability that makes approvals, in section 11, non-negotiable. Give a coding agent read access while you are learning, and add write access only when you have seen it behave well and have an approval step in front of the dangerous calls. Our guide to GitHub Copilot explained covers the coding-assistant context the demo sits in, and the voice-agent sibling of all of this — agents that speak rather than write — is covered in our Voxtral 3 coverage, which this guide does not repeat. The point of this section is narrower: image generation makes an agent visual, and connectors make it connected, and both are tools the model calls the same way it calls anything else.
10. Multi-Agent Workflows: Handoffs and Subagents

One agent can do a lot. It cannot do everything well. The moment a job splits naturally into parts — research, then analysis, then writing; or planning, then searching, then calculating — the right design is several agents, each doing one part, coordinated by one planner. Mistral supports that design in both the API and the SDK, and the two forms have different names for the same idea: handoffs in the API, subagents in the SDK.
In the Agents API, a handoff is declared on the agent: client.beta.agents.update(agent_id=..., handoffs=[...]). A planner agent passes the conversation to a specialist — a finance agent delegates to a web-search agent or a calculator agent — and the specialist takes over from there. In the SDK, the same idea is declared on the planner: subagents=[agents.Subagent(...)]. A subagent reports back to its parent, and the parent answers. The parent can start several subagents at once, so a question that splits into three independent parts can be worked on in parallel rather than in sequence. To hand over fully — not a delegation that reports back, but a transfer to another agent that owns the conversation — you make the other agent its own agents.Agent and carry the history with start_session(history=...).
Mistral’s own financial-analyst demo is the worked example worth keeping in mind. A planner agent receives a research request, delegates market-data gathering to one specialist, news gathering to another, and analysis to a third, then compiles the results into a report. Each specialist is a small agent with one tool set and one job: the search agent searches, the calculator agent calculates, the writer agent writes. The planner’s job is not to do the work but to divide it, watch it, and assemble the result. That division is what makes multi-agent designs scale: each specialist’s instructions are short and precise, because each specialist does one thing, and the planner’s instructions are about coordination rather than execution.
When is one agent enough, and when do you need several? The honest answer is that most agents should start as one. A single agent with three tools is simpler to build, simpler to test, and simpler to debug than three agents with one tool each, and the single agent will handle most jobs well. Split when you can name the failure: the instructions are getting long and contradictory, because one agent is being asked to be a researcher and an analyst and a writer at once; or the tool list is getting long, because one agent has ten tools and keeps calling the wrong one; or the job genuinely splits into parts that need different models, different tools, or different permissions. Those are the signs. Splitting for the sake of splitting — a multi-agent system because multi-agent systems sound impressive — is the most common over-engineering mistake in agent design, and it produces systems that are harder to debug and no more capable than the single agent they replaced.
Two practical rules for the designs that do need several agents. First, give each subagent a narrow job and a clear report format: “return the three most relevant figures with their sources” is a delegation; “look into this” is not. Second, keep the planner in charge of the answer. The subagents report back, the planner assembles, and the user hears one voice. An agent system that lets specialists answer the user directly is a system with no editor, and it reads like one. For the general concept behind all of this — what multi-agent systems are, how they fail, and where the pattern comes from — our guide to AI agents explained covers the concept in full, and this section is the Mistral-specific version of it: handoffs in the API, subagents in the SDK, and the judgement to know when one agent is enough.
11. Memory, Sessions and Approvals: Keeping Agents Safe

An agent that forgets everything between messages is a search box. An agent that remembers is a colleague. Memory is what makes the difference, and Mistral’s design gives you two kinds of it: the conversation, which the platform keeps, and the session, which you keep in the SDK. Understanding both is the difference between an agent that feels continuous and one that starts from zero every time.
In the Agents API, conversations are stateful. There are two ways to start one: with an agent, by passing an agent_id, or by direct access — specifying the model and completion parameters directly, which gives quick access to built-in tools without creating an agent first. Each conversation retains its context: you can view past conversations, continue any conversation, or branch from any point. Branching is the feature most builders underuse. conversations.restart(conversation_id=..., from_entry_id=..., inputs=...) starts a new conversation keeping the entries up to the chosen entry — which means you can rewind to the moment before an agent went wrong, change the instruction, and try again from there, without losing the good work that came before. It is the undo button for agent conversations, and it is worth building into any interface where a human works alongside an agent.
In the SDK, the same ideas live in sessions. You start one with session = await agent.start_session(), then send messages with await session.run("..."). A deployed agent’s sessions are stored by Mistral and reopened by id with agent.session(session_id); session.cancel() ends one. Local agents keep their sessions in-process only, which means a restart loses them — a fact to design around if your agent runs in-process and your users expect continuity. To restart from a point in the SDK, pass history with start_session(history=...), giving it the entries up to the restart point. To convert stored API history into an SDK session, import_conversation(conversation_id) does the job, with one documented gap: it leaves out hosted-tool and handoff entries, though the model still reads the replies that used them. List what exists with conversations.list() and conversations.get_history() on the API side, and agents.list_sessions() for deployed agents or agents.list_sessions(host="local") for in-process ones on the SDK side.
Streaming is how an agent feels responsive rather than slow. On the API, conversations.start_stream() sends message.output.delta events as the answer forms. In the SDK, you pass on_event= and receive agents.TextDelta events. The event mapping between the two is documented — for example, conversation.response.started becomes agents.TurnStarted, and tool.execution.started and tool.execution.done become agents.EntryAdded and agents.EntryCompleted. If you are migrating an interface from the API to the SDK, that mapping table is the piece to read first, because it is the difference between a streaming UI that works on day one and one that needs a rewrite.
Approvals are the other half of this section, and they are the part that keeps an agent safe rather than merely useful. A tool call can require approval before it runs. In the API, you declare it in the tool configuration: tool_configuration: {"requires_confirmation": ["web_search"]} makes those calls wait, and you answer with append(tool_confirmations=[...]). In the SDK, you pass permission_mode="ask" to make every tool call wait, or a permission_policy for selected tools, and answer with on_approval=. Approvals can also be left open and answered later by id, which is the shape you want when the approver is a human who is not sitting at the terminal. The rule for when to require approval is simple: any tool call whose effect cannot be undone — sending a message, charging a card, deleting a record, merging a pull request, publishing anything — should wait for a human. Read-only calls — a search, a calculation, a document retrieval — can run freely. An agent that asks before every search is annoying; an agent that merges a pull request without asking is dangerous. Set the policy to match the stakes, and set it per tool rather than per agent, so the safe tools stay fast and the dangerous ones stay gated.
Traces close the loop on safety, because an approval policy you cannot audit is a policy you cannot trust. Once an agent is deployed, each turn appears as a trace in Mistral Studio, with one span per model call and one span per tool call. Read the traces for your first week in production the way you would read a new employee’s first week of work: what did it call, in what order, what did it retrieve, what did it approve, and where did it hesitate. The trace is also where the other features in this section become visible — the session history, the branching, the approvals — as a single record of what actually happened, rather than what you hoped would happen. Evaluations and tracing are Studio features alongside the SDK; the documentation pages read for this guide do not state which plan tiers they are available on, so no tier restriction is stated here.
12. Picking the Right Model for Your Agent

The model is the agent’s brain, and the choice is narrower than the model list suggests. For a Mistral agent built on 1 December 2026, the real choice is between two models — Large 4 and Small 4 — with Ministral 3 for the smallest jobs. Everything else on the list is either deprecated, retired, or a specialist. This section gives you the prices, the context windows, and the deprecation table, so the choice is made from current facts rather than from a tutorial written before the deprecations.
| Model | API name | Input / cached input / output per million tokens | Context | Best for |
|---|---|---|---|---|
| Mistral Large 4 | mistral-large-4 | $0.70 / $0.07 / $2.10 | 1M tokens | The hardest work: planning, reasoning, multi-tool agents |
| Mistral Small 4 | mistral-small-2603 | $0.15 / $0.60 | 256K tokens | Fast, cheap agents: single-tool and high-volume work |
| Ministral 3 14B | — | $0.20 / $0.20 | — | Compact agents with the most capability in the small line |
| Ministral 3 8B | — | $0.15 / $0.15 | — | Compact agents balancing size and capability |
| Ministral 3 3B | — | $0.10 / $0.10 | — | The smallest agents |
The prices in that table were read first-hand from Mistral’s documentation pricing page on 1 December 2026, and they are the current prices as of that date. Two details in the table need their sourcing stated plainly. The Small 4 context window of 256K tokens was re-checked first-hand on the Small 4 model page on 1 December 2026, which also confirms the $0.15 input and $0.60 output prices. The Large 4 parameter counts — about 1 trillion parameters in total, 52 billion active — are agreed by the C19 brief and Wikipedia, but the Large 4 model page crawled for this guide does not show them, so they are stated here with that attribution and not as a first-hand read. What the Large 4 model page does state first-hand is the description that matters for agent builders: Large 4 is an open-weight hybrid instruct-and-reasoning model with multimodal input, unifying instruction, reasoning and agentic capabilities in a single model, under the Mistral Ecosystem Open-Weight licence, and natively fluent in more than 160 languages.
The rule for choosing is a rule about the job, not about the model. Large 4 is the pick when the agent has to plan, reason across several steps, use several tools, or handle long conversations — the 1-million-token context is the practical difference, because a long agent session with tool results and retrieved documents fills a context window fast, and a model that runs out of room starts forgetting the beginning of the job. Small 4 is the pick when the agent does one thing, does it often, and needs to be fast and cheap — a classifier, a single-tool lookup agent, a high-volume worker where the per-token price dominates. Ministral 3 is the pick when the agent has to run small — anywhere a large model cannot go, and where the compact sizes are the point. Start with Small 4, and move to Large 4 when you can name the failure — the agent losing track of a long conversation, or failing a multi-step plan — because that failure tells you the job needs the bigger model. Starting on Large 4 for everything is the expensive version of the same mistake in reverse.
The deprecation table is the part of this section that saves readers from building on a dead model. Read it, then check your own code for any of these names.
| Model | Deprecated | Retires | Alternative |
|---|---|---|---|
Codestral 25.08 (codestral-2508, codestral-latest) | 30 Nov 2026 | 31 Dec 2026 | None listed |
Mistral Large 3 (mistral-large-2512) | 31 Oct 2026 | 30 Apr 2027 | Mistral Large 4 |
Mistral Medium 3.5 (mistral-medium-3-5, mistral-medium-latest) | 31 Oct 2026 | 30 Apr 2027 | Mistral Large 4 |
Devstral 2 (devstral-2512) | 22 May 2026 | 31 Jul 2026 (retired) | Medium 3.5 (itself now deprecated) |
| Magistral Medium 1.2 | 22 May 2026 | 31 Jul 2026 (retired) | Reasoning now lives inside Small 4 and Large 4 |
| Magistral Small 1.2 | 30 Apr 2026 | 31 Jul 2026 (retired) | Reasoning now lives inside Small 4 and Large 4 |
Three things about that table deserve emphasis. First, Codestral 25.08 was deprecated yesterday — 30 November 2026 — and retires on 31 December 2026, with no alternative listed. Do not recommend Codestral for new agents, and do not build a coding agent on it. Second, the mistral-medium-latest alias that Mistral’s own websearch example uses resolves to Medium 3.5, which is deprecated and retires on 30 April 2027. The documentation example is stale, and this guide does not copy it as a recommendation. Third, pin the versioned API name in your code — mistral-large-4, mistral-small-2603 — not an alias like -latest, because an alias can change its meaning underneath you, as mistral-medium-latest just did. A versioned name is a decision you made; an alias is a decision someone else can remake.
Two more notes for the completeness-minded. No official per-model Agents support matrix was found on the documentation pages read on 1 December 2026, so this guide prints none — do not assume a model supports agents because it is on the list, and do not assume it does not. A secondary guide states that agents accept any chat model a workspace can use, but that claim is secondary only, and this guide does not repeat it as Mistral’s own position. And Mistral also hosts third-party models on its API — Z.ai’s GLM 5.3 and GLM 5.3 Flash, and DeepSeek V4.1 Flash — served without Mistral modifications and described as built for agentic workflows. They are not Mistral models, and they are one line in this guide because they are one line in the story: an alternative engine for an agent, available through the same platform.
For readers who want a general framework for choosing between models — the questions to ask about capability, cost, latency and context before you pick — our guide to how to choose an AI model covers the decision itself. And if you would rather run Mistral’s open-weight models somewhere else entirely, the hosted routes exist: Amazon Bedrock explained covers Bedrock as an alternative hosted route for Mistral models, and Microsoft Azure AI explained covers Azure and Foundry, the first cloud to carry Large 4. The model is portable; the agent design in this guide travels with it.
13. What It Costs: Tokens Plus Per-Call Tool Fees

An agent’s bill has two parts, and the second part is the one most builders forget to budget for. The first part is tokens: every prompt and every answer is priced per million tokens, at the rates in section 12. The second part is tool calls: the built-in tools are billed per call, on top of the tokens. Mistral’s pricing FAQ states the shape plainly — “tool APIs are priced per call” — and the token prices in this section were read first-hand from Mistral’s documentation pricing page on 1 December 2026. The per-call tool prices were not on either Mistral pricing page as crawled on that date, and this guide says so rather than pretending otherwise.
The verified token prices, from the documentation pricing page read on 1 December 2026: Mistral Large 4 costs $0.70 per million input tokens, $0.07 for cached input, and $2.10 per million output tokens. Mistral Small 4 costs $0.15 in and $0.60 out. Ministral 3 costs $0.20, $0.15 and $0.10 per million tokens for the 14B, 8B and 3B sizes, with input and output at the same rate. Two discounts apply on top of those rates, both stated in Mistral’s pricing FAQ: batch processing, for high-volume work, reduces the price by 50%, and cached input tokens reduce input cost by up to 90% for repeated prompts. Cached input is the discount that matters most for agents, because an agent’s instructions and retrieved context repeat across turns — the same system prompt, the same tool definitions, the same documents — and each repeat is a cached input at a tenth of the price. Design your agent to reuse context and you will feel the difference in the bill.
The tool-call prices need a careful paragraph, because they are the one place in this guide where the verification is second-hand. Five independent price trackers agree on the same figures — web search $30 per 1,000 calls, code execution $30 per 1,000 calls, image generation $100 per 1,000 images, premium news $50 per 1,000 calls, and document libraries at $3 per 1,000 pages for OCR plus $1 per million tokens for indexing plus $0.01 per call — and all five cite Mistral’s pricing page as their source. But those prices do not appear on Mistral’s pricing pages as crawled on 1 December 2026, either on the documentation pricing page or on mistral.ai/pricing, and the writer of this guide checked mistral.ai/pricing first-hand on that date and could not verify them there. So this guide reports the figures as secondary-corroborated — the consensus of independent trackers, not a first-hand read — and asks you to confirm them on mistral.ai/pricing before you budget against them. If the figures hold, the lesson of this section follows. If they do not, the token prices above still hold, and the tool prices are whatever the live pricing page says on the day you check. Do not quote the $30 figures as Mistral’s own words, because they were not read on Mistral’s own pages.
The worked example below uses those secondary-corroborated figures, and it is labelled as such, because it makes the point more clearly than any paragraph. Take 1,000 agent turns on Mistral Large 4, each with 2,000 input tokens and 500 output tokens, and one web search each. The tokens cost 1,000 times (2,000 times $0.70 plus 500 times $2.10) divided by 1,000,000 — that is 1,000 times ($0.0014 plus $0.00105), which is $2.45. The 1,000 web searches, at the secondary-corroborated $30 per 1,000 calls, cost $30.00. The total is $32.45 — and the lesson is that the tool calls, not the tokens, dominate the bill. The tokens are less than a tenth of the total. That ratio is the reason the tool prices matter more than the token prices for a search-heavy agent, and the reason a design that searches once per turn costs very differently from a design that searches ten times per turn. But the example only holds if the $30 figure holds, and this guide repeats that caveat rather than burying it: the figures are secondary-corroborated, and the live pricing page is the authority.
Three cost habits follow from the arithmetic, and they are worth adopting from the first day. First, cache deliberately: keep instructions stable, reuse sessions, and let repeated prompts benefit from the cached-input rate. Second, search deliberately: give the agent a reason to search, and a reason not to — a web search per turn is cheap once, expensive a thousand times, and an agent that searches when it already knows the answer is burning money. Third, measure per turn, not per month: work out what one turn costs, in tokens and in tool calls, and multiply by your volume. A monthly bill is a surprise; a per-turn cost is a budget. And one more figure from the pricing page, for completeness: OCR is priced per 1,000 pages — OCR 4.1 at $4 and OCR 3 at $2 — and regional inference carries a 10% surcharge. Neither is an agent tool price, but both are part of the same bill, and both were read first-hand on the same page.
14. Mistral Agents vs OpenAI’s Agents SDK — and the Verdict

Every agent builder eventually asks the same question: Mistral or OpenAI? The two platforms converged on the same shape in 2025, within weeks of each other, and the comparison below is a structural one — who runs what, where the loop lives, what is open and what is hosted — built from secondary reads and flagged as such. No OpenAI price, model specification or benchmark appears in this section, because none was verified for this guide, and a scored head-to-head built on unverified figures would be worse than no comparison at all.
The shape both vendors converged on is genuinely the same. A model plus instructions plus tools, running in a loop. Server-side state. Built-in web search, code execution and image tools. MCP support. And an SDK that runs the loop in your process. OpenAI’s version of that shape is the Responses API — POST /v1/responses, launched in March 2025 — with the open-source Agents SDK built on top of it: @function_tool, with the schema derived from type hints and the docstring, and hosted tools for web search, file search, code interpreter, computer use and hosted MCP. Mistral’s Agents API followed in May 2025, and Anthropic’s MCP support landed in the same weeks. The old OpenAI Assistants API was removed in August 2026, and Agent Builder and Evals were announced in June 2026 with a shutdown date of 30 November 2026. All of those OpenAI facts are secondary-verified, from reads of secondary sources on 1 December 2026, and this guide presents them as such — not as first-hand reads of OpenAI’s own pages.
The differences a reader can act on are differences of shape and of values, not of capability. Mistral’s SDK is Python-first, with three run modes — in-process, self-hosted, and Mistral-managed — and deploys through Studio. OpenAI’s Agents SDK is also Python, and TypeScript as well, and runs on the Responses API. Mistral’s headline differentiators are open weights — Large 4 and Small 4 are downloadable under an open-weight licence — European hosting and sovereignty, and lower token prices. OpenAI’s are the larger tool catalogue, including file search and computer use, and the bigger ecosystem around the platform. Neither list is a verdict by itself; each is a set of facts that points at a different kind of builder.
The verdict, by builder type, is where the comparison becomes useful. Pick Mistral if you want open weights you can download and run elsewhere, if European hosting and sovereignty matter to your users or your regulator, if the token prices in section 13 make your volume affordable, or if you want the SDK’s three run modes — especially the Mistral-managed mode — without running your own infrastructure. Pick OpenAI if you need the wider tool catalogue — file search and computer use are real capabilities with no Mistral equivalent in this guide — or if your team, your tooling and your existing code already live in OpenAI’s ecosystem, where the switching cost is the deciding factor. Pick either if your agent is a straightforward loop of model, instructions and tools, because both platforms do that well, and the difference for a simple agent is smaller than the marketing suggests. For the OpenAI side of the map, our guide to OpenAI’s API explained covers OpenAI’s endpoints in full; read it alongside this guide before you choose, and choose on the structure, not on a benchmark.
The honest limits belong in the verdict, not in a footnote. First, the preview status: the Agents SDK is in public preview, and its API, behaviour and limits may change. Build on it — it is the recommended path — but pin your version and read the release notes before you upgrade. Second, the model churn: three model lines were deprecated in the five weeks before this guide was written, and the documentation’s own examples are already stale. Pin versioned API names, and treat every model name in this guide as dated 1 December 2026. Third, the removal date that does not exist: the Agents API is being deprecated with no published removal date, and any plan that assumes a date is a plan built on a guess. Fourth, the provenance: the tool-call prices in section 13 are secondary-corroborated, the 5 November 2026 SDK launch date is secondary-corroborated, the AFP and AP news agencies are secondary-reported, and the OpenAI comparison in this section is secondary throughout. Those distinctions are stated where they arise, and they are repeated here so a reader who skips to the verdict still sees them. Check the source pages in the Sources section on the day you build. The SDK is the current path, the API is the legacy path, the tools are the map, and the agent is yours to build.
Sources
All sources checked 1 December 2026 unless stated. Version numbers, prices and deprecation dates are as listed on that date; the source pages named below are the authority for current versions and prices.
- Mistral — Agents API launch announcement, “Build AI agents with the Mistral Agents API” (mistral.ai/news/agents-api/), published 27 May 2025, updated 8 October 2026, read in full 1 December 2026: the definition of agents as “autonomous systems powered by large language models (LLMs) that, given high-level instructions, can plan, use tools, carry out steps of processing, and take actions to achieve specific goals”; built-in tools; SimpleQA figures — Mistral Large with web search 75% (vs 23% without), Mistral Medium 82.32% (vs 22.08% without), labelled Mistral-reported; image generation via Black Forest Labs FLUX1.1 [pro] Ultra; the five demo agents (GitHub coding, Linear tickets, financial analyst, travel, nutrition); stateful conversations and branching; handoffs.
- Mistral Docs — Tools (docs.mistral.ai/studio/agents/agent-tools), read in full 1 December 2026: “The Agents API v1 is about to be deprecated. Build new agents with the Agents SDK.”; the tool-type table (web search, code interpreter, image generation, document library, function calling, connectors); built-in tools run in Mistral’s internal environment; web_search, web_search_premium and code_interpreter work with the Conversations API and the Agents API, not with Chat Completions; image_generation is also supported in Chat Completions; multiple tools at once.
- Mistral Docs — Websearch (docs.mistral.ai/studio/agents/agent-tools/websearch), read in full 1 December 2026: two tiers (web_search / web_search_premium with news-provider verification); citations as ToolReferenceChunk (title, url, source); the worked example uses mistral-medium-latest; domain filtering (allowlist/blocklist, silent removal, HTTP 451 for open_url).
- Mistral Docs — Code Interpreter (docs.mistral.ai/studio/agents/agent-tools/code-interpreter), read in full 1 December 2026: isolated container; the Fibonacci worked example; tool.execution info carries code and code_output; works with the Conversations API and the Agents API, not Chat Completions.
- Mistral Docs — Function Calling (docs.mistral.ai/studio/agents/agent-tools/function-calling), read in full 1 December 2026: JSON schema, agent creation, the return-the-result pattern; built-in tools listed; MCP connectors link.
- Mistral Docs — Connectors (docs.mistral.ai/studio/connectors), read in full 1 December 2026: registered MCP servers; public preview, API can change; “You don’t run an MCP client yourself”; the model discovers tools and can call them directly; API-key Connector scopes (Shared connectors only by default; Private and shared connectors for private connectors).
- Mistral Docs — Move from the Agents API (docs.mistral.ai/studio/agents/getting-started/from-agents-api), read in full 1 December 2026: “The Agents SDK replaces the Agents and Conversations API”; the concept-by-concept migration table (create, temperature, ask, functions, client tools, hosted tools, code and MistralSandbox with the koyeb extra and cloud_user role, connectors, approvals, sessions, streaming, handoffs to subagents, typed answers, history, versions); install
uv add "mistralai-agents==1.1.0". - Mistral Docs — Quickstart (docs.mistral.ai/studio/agents/getting-started/quickstart), read in full 1 December 2026:
agents initscaffold, MISTRAL_API_KEY in .env, the get_weather tool,agent.run,agents chat, manual install (Python 3.12 / 3.13 / 3.14, package mistralai-agents), three run modes, traces in Studio. - Mistral Docs — Pricing (docs.mistral.ai/inference/pricing), read in full 1 December 2026: Mistral Large 4 $0.70 / $0.07 cached / $2.10 per million tokens; Mistral Small 4 $0.15 / $0.60; Ministral 3 14B $0.20, 8B $0.15, 3B $0.10; OCR 4.1 $4 per 1,000 pages, OCR 3 $2 per 1,000 pages; regional inference +10%; third-party GLM 5.3 and DeepSeek V4.1 Flash prices; the code-models table rendered empty; no tool-call prices in the crawled text.
- Mistral Docs — Models (docs.mistral.ai/models), read in full 1 December 2026: Mistral Large 4 and Mistral Small 4 descriptions; third-party hosted models (Z.ai GLM 5.3 / GLM 5.3 Flash, DeepSeek V4.1 Flash 1017), “served without Mistral modifications”; the full deprecated and retired table (Codestral 25.08 deprecated 30 November 2026, retires 31 December 2026; Large 3 and Medium 3.5 deprecated 31 October 2026, retire 30 April 2027; Devstral 2 and Magistral 1.2 retired 31 July 2026).
- Mistral Docs — Mistral Large 4 (docs.mistral.ai/models/mistral-large-4-0), read in full 1 December 2026: generally available, v26.10, 1M-token context, $0.70 / $0.07 / $2.10, Mistral Ecosystem Open-Weight licence, hybrid instruct-and-reasoning model with multimodal input, fluent in 160+ languages.
- Mistral — Pricing page (mistral.ai/pricing), read in full 1 December 2026 by the writer: Vibe Free $0, Pro $14.99 per month, Team $24.99 per user per month, Enterprise custom, students $5.99 per month; FAQ — batch processing reduces price by 50%, cached input tokens reduce input cost by up to 90%, “tool APIs are priced per call”; the FAQ’s “Mistral Large costs $0.5 per million tokens in and $1.5 out” example is stale (that is Large 3’s price) and is not quoted in this article; the Enterprise “$50 per month” figure renders without a clear column and is not quoted; no per-call tool prices appear on the page.
- Secondary sources, used only where flagged in the text: the Agents SDK and Managed Agents public preview dated 5 November 2026, with no removal date published for the Agents/Conversations API, and SDK 1.1.3 on PyPI as of 13 November 2026 — datastudios.org, eneralabs.com, hardiai.com, ai-primer.com, aistackcurrent.com (November 2026); web_search_premium adding AFP and AP news agencies — simonwillison.net (27 May 2025); the sandbox having no access to your network or files, files arriving as tool_file chunks, and “agents accept any chat model your workspace can use” — codehalwell.github.io AgentGuides (verified against mistralai 3.9.0, checked 30 November 2026); tool-call prices (web search $30, code execution $30, image generation $100, premium news $50 per 1,000; document libraries $3 per 1,000 pages OCR + $1 per million indexing + $0.01 per call) — developer.puter.com, curlscape.com, seminal.ai, cabina.ai, costuse.com, all citing Mistral’s pricing page, not verified first-hand on 1 December 2026; OpenAI’s Responses API (POST /v1/responses, March 2025), Agents SDK shape, Assistants API removed August 2026, Agent Builder and Evals shutdown 30 November 2026 — neurals.ca, codewithkg.com; Large 4 parameter counts (about 1 trillion parameters, 52 billion active) — en.wikipedia.org/wiki/Mistral_AI.
- Prior briefs read, not sources for new facts: C19 brief (21 November 2026) — the Mistral family map; the boundary for this post; Large 4 GA 5 November 2026 v26.10; Small 4 256K context; the 5 November 2026 managed-agents preview corroboration from Mistral’s docs release notes; D17 brief (30 November 2026) — format model.
- Our own guides, for the context cited in the text: C19 Mistral AI Explained (post 6232, 21 November 2026) for the Mistral family, Vibe and Studio; C20 AI Agents Explained (post 6248, 21 November 2026) for the general concept of AI agents; Mistral Studio Managed Agents and Apps (news post 4550) for the 5 November 2026 Studio launch; Mistral Responses API for agent builders (news post 3523) for the other API surface; B1 OpenAI API Explained for the section 14 comparison; A3 How to Choose an AI Model for model picking; B4 AI Coding Assistants Compared for the coding-agent angle; A4 GitHub Copilot Explained for the GitHub demo’s context; C15 Amazon Bedrock Explained and C16 Microsoft Azure AI Explained for alternative hosted routes for Mistral models.


0 Comments