The Mistral AI connector lets your AI agent act in each user's Mistral AI account. Each user connects their own Mistral AI access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 32 tools.
- Tools
- 32
- What they doRead · write · destructive
- 13 · 16 · 313 read16 write3 destructive
- Users sign in with
- Access token
Setup
Install the SDK
Terminal window npm install @scalekit-sdk/node dotenvTerminal window pip install scalekit-sdk-python python-dotenvSet your credentials
Add your Scalekit credentials to your
.envfile. Find values in app.scalekit.com > Developers > API Credentials..env SCALEKIT_ENVIRONMENT_URL=<your-environment-url>SCALEKIT_CLIENT_ID=<your-client-id>SCALEKIT_CLIENT_SECRET=<your-client-secret>Create the Mistral AI connection
In AgentKit > Connections, create a Mistral AI connection. The name you give it is the
connection_nameyour code passes. See Configure connections.Authorize a user and make your first call
quickstart.mts import { ScalekitClient } from '@scalekit-sdk/node'import 'dotenv/config'import { createInterface } from 'node:readline/promises'const scalekit = new ScalekitClient(process.env.SCALEKIT_ENVIRONMENT_URL,process.env.SCALEKIT_CLIENT_ID,process.env.SCALEKIT_CLIENT_SECRET,)const actions = scalekit.actionsconst connector = 'mistral'const identifier = 'user_123'// Generate an authorization link for the userconst { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })console.log('Authorize Mistral AI:', link)const rl = createInterface({ input: process.stdin, output: process.stdout })await rl.question('Press Enter after authorizing...')rl.close()// Make your first callconst result = await actions.executeTool({connector,identifier,toolName: 'mistral_list_agents',toolInput: {},})console.log(result)Terminal window npx tsx quickstart.mtsquickstart.py import osfrom scalekit import ScalekitClientfrom dotenv import load_dotenvload_dotenv()scalekit_client = ScalekitClient(env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),client_id=os.getenv("SCALEKIT_CLIENT_ID"),client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),)actions = scalekit_client.actionsconnection_name = "mistral"identifier = "user_123"# Generate an authorization link for the userlink_response = actions.get_authorization_link(connection_name=connection_name,identifier=identifier,)print("Authorize Mistral AI:", link_response.link)input("Press Enter after authorizing...")# Make your first callresult = actions.execute_tool(tool_input={},tool_name="mistral_list_agents",connection_name=connection_name,identifier=identifier,)print(result)Terminal window python quickstart.pyEach user opens the link once and enters their Mistral AI credentials there. See Authorize a user for the full flow and statuses.
Tools
Pass the exact name toexecute_toolmistral_get_agentGet the full configuration of one Mistral agent, optionally at a specific version.Read-onlyGet Agent
Get the full configuration of one Mistral agent, optionally at a specific version. Returns the agent's id, name, description, model, instructions, tools, completion_args, handoffs, metadata, version, versions and timestamps. Use this to inspect an agent before running or updating it. Use mistral_list_agents to find agent IDs.
Inputs
agent_idstringrequired- ID of the agent, from mistral_list_agents. Example: ag_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.
agent_versioninteger- Version number or alias to get. Leave empty for the current version. Example: 2.
mistral_get_batch_jobGet the status and progress of one Mistral batch job, optionally with its results inline.Read-onlyGet Batch Job
Get the status and progress of one Mistral batch job, optionally with its results inline. Returns the job's id, status, endpoint, model, request counts, errors, output_file and error_file IDs, timestamps, and outputs when inline is true. Use this to poll a job until it finishes. Download large results with mistral_get_file_signed_url on the output_file ID.
Inputs
job_idstringrequired- ID of the batch job, from mistral_list_batch_jobs or mistral_create_batch_job. Example: 9c1e3b2a-5d4f-4e6a-8b7c-1d2e3f4a5b6c.
inlineboolean- true returns the job's results inside the response (outputs) instead of only as an output file. Useful for small jobs created with inline requests.
mistral_get_conversationGet the settings of one stored Mistral conversation.Read-onlyGet Conversation
Get the settings of one stored Mistral conversation. Returns the conversation's id, name, description, model or agent_id, instructions, tools, completion_args, metadata and timestamps, but not its messages. Use this to see how a conversation is configured. Use mistral_get_conversation_history for every entry or mistral_list_conversation_messages for the messages only.
Inputs
conversation_idstringrequired- ID of the conversation. Example: conv_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.
mistral_get_conversation_historyGet every entry of a stored Mistral conversation in the order it was added: input and output messages, function calls and results, tool executions and agent handoffs.Read-onlyGet Conversation History
Get every entry of a stored Mistral conversation in the order it was added: input and output messages, function calls and results, tool executions and agent handoffs. Returns the conversation_id and its entries, each with id, type, role or tool details, content and timestamps. Use this to find an entry id for mistral_restart_conversation or to audit tool use. Use mistral_list_conversation_messages when you only need the messages.
Inputs
conversation_idstringrequired- ID of the conversation. Example: conv_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.
mistral_get_fileGet the metadata of one file in your Mistral workspace.Read-onlyGet File
Get the metadata of one file in your Mistral workspace. Returns the file's id, filename, bytes, purpose, sample_type, source, num_lines, mimetype, created_at and expires_at; not its contents. Use this to check a file before using it. Use mistral_get_file_signed_url to download the contents.
Inputs
file_idstringrequired- ID of the file, from mistral_list_files or a batch job's output_file. Example: 6a5bd9f5-0d4e-4bd0-a6f2-2d2c3b1e7c11.
mistral_get_file_signed_urlCreate a temporary download link for a file in your Mistral workspace.Read-onlyGet File Signed URL
Create a temporary download link for a file in your Mistral workspace. Returns url, a signed link that downloads the file contents without an API key until it expires. Use this to fetch batch results or other file contents. Use mistral_get_file for metadata only.
Inputs
file_idstringrequired- ID of the file to download, for example a batch job's output_file. Example: 6a5bd9f5-0d4e-4bd0-a6f2-2d2c3b1e7c11.
expiryinteger- Hours until the URL stops working, from 1 to 168. Mistral's default is 24. Example: 24.
mistral_get_modelGet the details of one Mistral model by id or alias.Read-onlyGet Model
Get the details of one Mistral model by id or alias. Returns the model's id, name, aliases, description, max_context_length, default temperature, deprecation date and capabilities; fine-tuned models also show their root model and job. Use this to check what a specific model supports. Use mistral_list_models to browse all models.
Inputs
model_idstringrequired- ID or alias of the model, as returned by mistral_list_models. Example: mistral-large-latest.
mistral_list_agentsList the Mistral agents you can access, one page at a time, optionally filtered by name, search text or source.Read-onlyList Agents
List the Mistral agents you can access, one page at a time, optionally filtered by name, search text or source. Returns agents with id, name, description, model, version, instructions, tools and timestamps, plus next_page_token when more pages exist. Use this to find an agent_id. Use mistral_get_agent for one agent's full configuration.
Inputs
namestring- Only return agents with exactly this name. Example: Contract reviewer.
page_sizeinteger- Agents per page. Mistral's default is 20. Example: 20.
page_tokenstring- Cursor for the next page: the next_page_token from the previous response. Leave empty for the first page.
searchstring- Only return agents whose name or ID contains this text. Example: contract.
sourcesarray- Only return agents created in these places: api, playground or agent_builder_v1. Example: ["api"].
mistral_list_batch_jobsList the batch inference jobs in your Mistral workspace, one page at a time, optionally filtered by status, model, agent or creation date.Read-onlyList Batch Jobs
List the batch inference jobs in your Mistral workspace, one page at a time, optionally filtered by status, model, agent or creation date. Returns jobs with id, status, endpoint, model, request counts (total, completed, succeeded, failed), output_file and error_file IDs and timestamps, plus the total count. Use this to monitor batch work. Use mistral_get_batch_job for one job, including inline results.
Inputs
agent_idstring- Only return jobs that use this agent. Example: ag_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.
created_afterstring- Only return jobs created after this ISO 8601 date-time. Example: 2026-10-01T00:00:00Z.
created_by_meboolean- true returns only the jobs created by the API key's own user. Default false.
modelstring- Only return jobs that use this model. Example: mistral-small-latest.
order_bystring- Sort by creation time: -created for newest first (default) or created for oldest first.one of
created-created pageinteger- Page number, starting at 0. Example: 0.
page_sizeinteger- Jobs per page. Mistral's default is 100. Example: 20.
statusarray- Only return jobs in these statuses: QUEUED, RUNNING, SUCCESS, FAILED, TIMEOUT_EXCEEDED, CANCELLATION_REQUESTED, CANCELLED. Example: ["RUNNING", "QUEUED"].
mistral_list_conversation_messagesGet only the user and assistant messages of a stored Mistral conversation, in order.Read-onlyList Conversation Messages
Get only the user and assistant messages of a stored Mistral conversation, in order. Returns the conversation_id and its messages, each with id, role, content and timestamps. Use this to read a transcript. Use mistral_get_conversation_history to also see tool calls, tool executions and handoffs.
Inputs
conversation_idstringrequired- ID of the conversation. Example: conv_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.
mistral_list_conversationsList the stored Mistral conversations in your workspace, newest first, one page at a time.Read-onlyList Conversations
List the stored Mistral conversations in your workspace, newest first, one page at a time. Returns conversations with id, name, description, model or agent_id, instructions, tools, metadata and created_at / updated_at. Use this to find a conversation_id. Use mistral_get_conversation for one conversation and mistral_get_conversation_history for its entries.
Inputs
pageinteger- Page number, starting at 0. Example: 0.
page_sizeinteger- Conversations per page. Mistral's default is 100. Example: 20.
mistral_list_filesList the files in your Mistral workspace, one page at a time, optionally filtered by purpose, name, sample type or source.Read-onlyList Files
List the files in your Mistral workspace, one page at a time, optionally filtered by purpose, name, sample type or source. Returns files with id, filename, bytes, purpose, sample_type, source, num_lines, mimetype, created_at and expires_at, plus the total count. Use this to find a file ID for OCR, a batch job or its results. Use mistral_get_file for one file and mistral_get_file_signed_url to download it.
Inputs
pageinteger- Page number, starting at 0. Example: 0.
page_sizeinteger- Files per page. Mistral's default is 100. Example: 20.
purposestring- Only return files uploaded for this purpose: fine-tune, batch, ocr or agentic_safety. Example: batch.one of
fine-tunebatchocragentic_safety sample_typearray- Only return files of these sample types: pretrain, instruct, batch_request, batch_result or batch_error. Example: ["batch_result"].
searchstring- Only return files whose name matches this text. Example: invoices.
sourcearray- Only return files from these sources: upload, repository or mistral (files Mistral created, such as batch outputs). Example: ["mistral"].
mistral_list_modelsList the base and fine-tuned models your Mistral API key can use.Read-onlyList Models
List the base and fine-tuned models your Mistral API key can use. Returns each model's id, name, aliases, description, max_context_length, type (base or fine-tuned), deprecation date and capabilities such as completion_chat, function_calling, vision, ocr, completion_fim, classification and moderation. Use this to pick a model id for the other tools. Use mistral_get_model for one known model.
Inputs
This tool takes no inputs.
mistral_append_to_conversationAdd new inputs to an existing Mistral conversation and run the next reply on the full history.WriteAppend to Conversation
Add new inputs to an existing Mistral conversation and run the next reply on the full history. Returns the conversation_id, the new output entries (assistant messages, tool executions or function calls) and token usage. Use this for the next turn, or to send a function.result after a function call. Use mistral_restart_conversation to branch from an earlier entry.
Inputs
conversation_idstringrequired- ID of the conversation to continue, from mistral_start_conversation or mistral_list_conversations. Example: conv_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.
inputsstringrequired- What to add to the conversation: a plain string is sent as one user message. For more control pass an array of entries, such as [{"type": "message.input", "role": "user", "content": "..."}], or, to answer a function call the model made, [{"type": "function.result", "tool_call_id": "<id from the function.call entry>", "result": "<your result as a string>"}]. Example: "Summarise the key points of our last discussion."
completion_argsobject- Default generation settings for the agent or conversation: temperature, top_p, max_tokens, random_seed, stop, presence_penalty, frequency_penalty, tool_choice (auto, none, any or required), reasoning_effort and response_format (same shapes as in chat completions). Example: {"temperature": 0.3, "max_tokens": 1024}.
handoff_executionstring- With multi-agent handoffs: server lets Mistral run the handoff, client returns it to you to perform.one of
serverclient storeboolean- Whether Mistral stores the new entries. Default true.
mistral_cancel_batch_jobRequest cancellation of a queued or running Mistral batch job.WriteCancel Batch Job
Request cancellation of a queued or running Mistral batch job. Returns the job with status CANCELLATION_REQUESTED, then CANCELLED once it stops; requests already finished keep their results. Use this to stop a job you no longer need. Use mistral_get_batch_job to confirm it stopped.
Inputs
job_idstringrequired- ID of the batch job to cancel. Example: 9c1e3b2a-5d4f-4e6a-8b7c-1d2e3f4a5b6c.
mistral_classify_chatScore one or more conversations with a classifier model you fine-tuned on Mistral.WriteClassify Chat
Score one or more conversations with a classifier model you fine-tuned on Mistral. Returns one result per conversation with a score for every label of every classification target in your classifier. Use this when the input is a chat. Use mistral_classify_text for standalone text, and mistral_moderate_chat for Mistral's built-in safety categories.
Inputs
inputobjectrequired- The conversation to classify as {"messages": [{"role": "user", "content": "..."}, ...]}, or an array of such objects to classify several conversations in one call.
modelstringrequired- ID of a classifier model you fine-tuned on Mistral, for example ft:classifier:ministral-3b-latest:a1b2c3d4:20260301:e5f6a7b8. Find it with mistral_list_models (its capabilities include classification).
mistral_classify_textScore one or more texts with a classifier model you fine-tuned on Mistral.WriteClassify Text
Score one or more texts with a classifier model you fine-tuned on Mistral. Returns one result per input with a score for every label of every classification target in your classifier. Use this for standalone text with your own labels. Use mistral_classify_chat for conversations, and mistral_moderate_text for Mistral's built-in safety categories.
Inputs
inputstringrequired- Text to classify: one string, or an array of strings to classify in one call. Example: ["The delivery was late again", "Great support!"].
modelstringrequired- ID of a classifier model you fine-tuned on Mistral, for example ft:classifier:ministral-3b-latest:a1b2c3d4:20260301:e5f6a7b8. Find it with mistral_list_models (its capabilities include classification).
mistral_create_agentCreate a Mistral agent: a saved model, instructions, tools and generation settings you can reuse in conversations and agent completions.WriteCreate Agent
Create a Mistral agent: a saved model, instructions, tools and generation settings you can reuse in conversations and agent completions. Returns the new agent with its id, version, model, name, instructions, tools, completion_args and timestamps. Use this to set up a reusable assistant. Use mistral_update_agent to change one, and mistral_start_conversation or mistral_create_agent_completion to run it.
Inputs
modelstringrequired- Model the agent runs on. Example: mistral-medium-latest.
namestringrequired- Name of the agent. Example: Contract reviewer.
completion_argsobject- Default generation settings for the agent or conversation: temperature, top_p, max_tokens, random_seed, stop, presence_penalty, frequency_penalty, tool_choice (auto, none, any or required), reasoning_effort and response_format (same shapes as in chat completions). Example: {"temperature": 0.3, "max_tokens": 1024}.
descriptionstring- Short description of what the agent does. Example: Flags risky clauses in contracts.
handoffsarray- IDs of other agents this agent can hand the conversation to. Example: ["ag_0195b2f2a6f97c3bb6b1c0f5e1a2d3c5"].
instructionsstring- System instructions the agent follows in every conversation. Example: You review contracts and list risky clauses with a short reason for each.
metadataobject- Your own key-value metadata for the agent. Example: {"team": "legal"}.
toolsarray- Tools the agent can use. Built-in tools: {"type": "web_search"}, {"type": "web_search_premium"}, {"type": "code_interpreter"}, {"type": "image_generation"} and {"type": "document_library", "library_ids": ["<library id>"]}. Your own functions use {"type": "function", "function": {"name": ..., "description": ..., "parameters": <JSON Schema>}}; the conversation then pauses with a function.call entry until you send back a function.result. Example: [{"type": "web_search"}].
version_messagestring- Note describing this version of the agent. Example: Added web search.
mistral_create_agent_completionRun a saved Mistral agent on a list of messages and get its next reply, using the agent's model, instructions and settings.WriteCreate Agent Completion
Run a saved Mistral agent on a list of messages and get its next reply, using the agent's model, instructions and settings. Returns the completion id, model, choices (message.content, any message.tool_calls, finish_reason) and token usage, in the same shape as a chat completion; non-streaming only. Use this for a stateless call to an existing agent. Use mistral_start_conversation for a server-stored conversation that runs the agent's built-in tools, and mistral_create_chat_completion to call a model directly.
Inputs
agent_idstringrequired- ID of the agent to run, from mistral_list_agents or Mistral AI Studio. Example: ag_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.
messagesarrayrequired- Conversation so far, oldest first. Each message has a role (system, user, assistant or tool) and content. Content is plain text, or an array of chunks so a user message can also carry images ({"type": "image_url", "image_url": "https://... or data:image/png;base64,..."}) or documents ({"type": "document_url", "document_url": "https://..."}) for vision-capable models. To return a tool result, add the assistant message with its tool_calls from the previous response, then a tool message with tool_call_id and content. Example: [{"role": "system", "content": "You are a concise assistant."}, {"role": "user", "content": "Who is the best French painter? Answer in one sentence."}]
max_tokensinteger- Maximum number of tokens to generate. The prompt plus max_tokens must fit in the model's context length. Leave empty to let the model stop on its own. Example: 512.
random_seedinteger- Seed for random sampling. The same seed and inputs give repeatable results. Example: 42.
response_formatobject- Output format. {"type": "text"} is the default. {"type": "json_object"} turns on JSON mode: the reply is valid JSON, and you must also ask for JSON in a system or user message. {"type": "json_schema", "json_schema": {"name": "book", "schema": {...}, "strict": true}} makes the reply follow your JSON Schema. Example: {"type": "json_object"}.
stopstring- Stop generating when the model writes this string, or any string in this array. Example: ["\n\n", "END"].
tool_choicestring- auto, none, any or required, or {"type": "function", "function": {"name": "..."}} to force one function. Example: auto.
toolsarray- Extra functions the agent may call in this request, in the same shape as chat completion tools. Example: [{"type": "function", "function": {"name": "get_weather", "description": "Get the current weather for a city", "parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}}}]
mistral_create_batch_jobQueue a Mistral batch inference job that runs many requests against one endpoint asynchronously, from inline requests or uploaded .jsonl files.WriteCreate Batch Job
Queue a Mistral batch inference job that runs many requests against one endpoint asynchronously, from inline requests or uploaded .jsonl files. Returns the new job with its id, status (QUEUED at first), endpoint, model and request counts. Use this for large workloads that do not need an immediate answer. Track it with mistral_get_batch_job; stop it with mistral_cancel_batch_job. Usage is billed to the API key's workspace at batch pricing.
Inputs
endpointstringrequired- API endpoint every request in the batch is sent to: /v1/chat/completions, /v1/embeddings, /v1/fim/completions, /v1/moderations, /v1/chat/moderations, /v1/ocr, /v1/classifications, /v1/chat/classifications, /v1/conversations, /v1/audio/transcriptions. Example: /v1/chat/completions.one of
/v1/chat/completions/v1/embeddings/v1/fim/completions/v1/moderations/v1/chat/moderations/v1/ocr/v1/classifications/v1/chat/classifications/v1/conversations/v1/audio/transcriptions agent_idstring- Agent to run every request with, instead of a model. Example: ag_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.
input_filesarray- IDs of .jsonl files already uploaded with purpose batch, where each line is {"custom_id": ..., "body": {...}}. Provide input_files or requests. Example: ["6a5bd9f5-0d4e-4bd0-a6f2-2d2c3b1e7c11"].
metadataobject- Your own key-value metadata for the job. Example: {"job_type": "nightly-summaries"}.
modelstring- Model to run every request with. Provide model or agent_id. Example: mistral-small-latest.
requestsarray- Requests to run, given inline. Each item has an optional custom_id and a body with the request payload for the endpoint, without model. Example: [{"custom_id": "0", "body": {"max_tokens": 100, "messages": [{"role": "user", "content": "What is the best French cheese?"}]}}]. Provide requests or input_files.
timeout_hoursinteger- Hours after which unfinished requests time out. Mistral's default is 24. Example: 24.
mistral_create_chat_completionSend a conversation to a Mistral model and get the next assistant message, with optional function calling, JSON mode or JSON-schema output, and image or document inputs on vision models.WriteCreate Chat Completion
Send a conversation to a Mistral model and get the next assistant message, with optional function calling, JSON mode or JSON-schema output, and image or document inputs on vision models. Returns the completion id, model, choices (each with message.content, any message.tool_calls and finish_reason) and token usage; non-streaming only. Use this for a single synchronous answer from a model you name. Use mistral_create_agent_completion to run a saved agent, mistral_start_conversation for server-stored conversations with built-in tools, and mistral_create_fim_completion for code infilling. Usage is billed to the API key's workspace.
Inputs
messagesarrayrequired- Conversation so far, oldest first. Each message has a role (system, user, assistant or tool) and content. Content is plain text, or an array of chunks so a user message can also carry images ({"type": "image_url", "image_url": "https://... or data:image/png;base64,..."}) or documents ({"type": "document_url", "document_url": "https://..."}) for vision-capable models. To return a tool result, add the assistant message with its tool_calls from the previous response, then a tool message with tool_call_id and content. Example: [{"role": "system", "content": "You are a concise assistant."}, {"role": "user", "content": "Who is the best French painter? Answer in one sentence."}]
modelstringrequired- ID of the Mistral model to run, for example mistral-large-latest, mistral-medium-latest, mistral-small-latest, magistral-medium-latest (reasoning) or a fine-tuned model id. Use mistral_list_models to see what your key can call.
frequency_penaltynumber- From -2 to 2. Higher values discourage repeating words that already appear often in the output. Example: 0.5.
max_tokensinteger- Maximum number of tokens to generate. The prompt plus max_tokens must fit in the model's context length. Leave empty to let the model stop on its own. Example: 512.
ninteger- Number of completions to generate for the request; each is returned as a separate choice. Input tokens are billed once. Example: 2.
parallel_tool_callsboolean- Whether the model may call several tools in one turn. Mistral's default is true. Example: false.
predictionobject- Expected output, which speeds up responses when most of the answer is known in advance, such as small edits to a document or code file. Shape: {"type": "content", "content": "<expected text>"}.
presence_penaltynumber- From -2 to 2. Higher values push the model to use a wider variety of words and topics. Example: 0.5.
prompt_modestring- Set to reasoning to use Mistral's reasoning system prompt with reasoning (Magistral) models. Leave empty otherwise.one of
reasoning random_seedinteger- Seed for random sampling. The same seed and inputs give repeatable results. Example: 42.
reasoning_effortstring- How much the model reasons before answering, on models that support adjustable reasoning: none, minimal, low, medium, high or xhigh. Example: medium.one of
noneminimallowmediumhighxhigh response_formatobject- Output format. {"type": "text"} is the default. {"type": "json_object"} turns on JSON mode: the reply is valid JSON, and you must also ask for JSON in a system or user message. {"type": "json_schema", "json_schema": {"name": "book", "schema": {...}, "strict": true}} makes the reply follow your JSON Schema. Example: {"type": "json_object"}.
safe_promptboolean- Prepend Mistral's safety system prompt to the conversation. Default false. Example: true.
service_tierstring- auto serves the request on priority capacity when your workspace has it; standard_only always uses standard capacity.one of
autostandard_only stopstring- Stop generating when the model writes this string, or any string in this array. Example: ["\n\n", "END"].
temperaturenumber- Sampling temperature from 0 to 1.5. Mistral recommends 0.0 to 0.7: lower is more focused and deterministic, higher is more random. Change this or top_p, not both. Leave empty for the model's default. Example: 0.3.
tool_choicestring- How the model uses the tools: auto (default, model decides), none (never call a tool), any or required (must call at least one tool), or {"type": "function", "function": {"name": "get_weather"}} to force one function. Example: auto.
toolsarray- Functions the model may call. Each tool is {"type": "function", "function": {"name", "description", "parameters": <JSON Schema>}}. When the model calls one, the response has finish_reason tool_calls and message.tool_calls; run the function yourself and send the result back as a tool message. Example: [{"type": "function", "function": {"name": "get_weather", "description": "Get the current weather for a city", "parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}}}]
top_pnumber- Nucleus sampling: only tokens within this cumulative probability mass are considered, so 0.1 keeps the top 10%. Change this or temperature, not both. Example: 0.9.
mistral_create_embeddingsTurn one or more texts or code snippets into embedding vectors with a Mistral embedding model.WriteCreate Embeddings
Turn one or more texts or code snippets into embedding vectors with a Mistral embedding model. Returns data with one embedding per input, in input order, plus the model and token usage. Use this for semantic search, clustering or retrieval. Use mistral_classify_text to score text against a trained classifier instead.
Inputs
inputstringrequired- Text to embed: one string, or an array of strings to embed in one call. Example: ["First passage", "Second passage"].
modelstringrequired- Embedding model: mistral-embed for general text, or codestral-embed for code.
encoding_formatstring- float returns each embedding as an array of numbers; base64 returns it as a base64 string, which is smaller. Default float.one of
floatbase64 output_dimensioninteger- Size of each embedding vector, on models that support a configurable dimension (such as codestral-embed). Leave empty for the model default. Example: 256.
output_dtypestring- Number type of each vector element, on models that support it: float (default), int8, uint8, binary or ubinary.one of
floatint8uint8binaryubinary
mistral_create_fim_completionGenerate the code that belongs between a prefix and an optional suffix with a Codestral fill-in-the-middle model.WriteCreate FIM Completion
Generate the code that belongs between a prefix and an optional suffix with a Codestral fill-in-the-middle model. Returns the completion id, model, choices with the generated code in message.content, and token usage; non-streaming only. Use this for code completion and infilling inside a file. Use mistral_create_chat_completion for instructions or questions about code.
Inputs
modelstringrequired- Codestral model with fill-in-the-middle support, for example codestral-latest.
promptstringrequired- Code before the gap; the model writes what comes next. Example: def fibonacci(n: int):
max_tokensinteger- Maximum number of tokens to generate. The prompt plus max_tokens must fit in the model's context length. Leave empty to let the model stop on its own. Example: 512.
min_tokensinteger- Minimum number of tokens to generate. Example: 10.
random_seedinteger- Seed for random sampling. The same seed and inputs give repeatable results. Example: 42.
stopstring- Stop generating when the model writes this string, or any string in this array. Example: ["\n\n", "END"].
suffixstring- Code after the gap. With a suffix the model fills in what goes between prompt and suffix; without one it simply continues the prompt. Example: return result
temperaturenumber- Sampling temperature from 0 to 1.5. Mistral recommends 0.0 to 0.7: lower is more focused and deterministic, higher is more random. Change this or top_p, not both. Leave empty for the model's default. Example: 0.3.
top_pnumber- Nucleus sampling: only tokens within this cumulative probability mass are considered, so 0.1 keeps the top 10%. Change this or temperature, not both. Example: 0.9.
mistral_moderate_chatCheck the last message of a conversation against Mistral's moderation policy categories, judged in the context of the earlier turns.WriteModerate Chat
Check the last message of a conversation against Mistral's moderation policy categories, judged in the context of the earlier turns. Returns one result per conversation with a true or false flag and a score for each category (sexual, hate_and_discrimination, violence_and_threats, dangerous_and_criminal_content, selfharm, health, financial, law and pii). Use this to screen a user prompt or a model reply inside a chat. Use mistral_moderate_text for standalone text.
Inputs
inputarrayrequired- The conversation to moderate as an array of messages with role and content, oldest first; the last message is judged in the context of the earlier ones. To check several conversations in one call, pass an array of such arrays. Example: [{"role": "user", "content": "..."}, {"role": "assistant", "content": "..."}].
modelstringrequired- Moderation model, usually mistral-moderation-latest.
mistral_moderate_textCheck one or more pieces of standalone text against Mistral's moderation policy categories.WriteModerate Text
Check one or more pieces of standalone text against Mistral's moderation policy categories. Returns one result per input with a true or false flag and a score for each category (sexual, hate_and_discrimination, violence_and_threats, dangerous_and_criminal_content, selfharm, health, financial, law and pii). Use this for raw text such as user posts or documents. Use mistral_moderate_chat to judge the last message of a conversation in context.
Inputs
inputstringrequired- Text to moderate: one string, or an array of strings to check in one call. Example: ["First text", "Second text"].
modelstringrequired- Moderation model, usually mistral-moderation-latest.
mistral_ocr_documentExtract text, tables, images and layout from a PDF, office document or image with Mistral OCR, given a public URL, a base64 data URI or an uploaded file ID.WriteOCR Document
Extract text, tables, images and layout from a PDF, office document or image with Mistral OCR, given a public URL, a base64 data URI or an uploaded file ID. Returns one entry per page with markdown text, extracted images (with optional base64), tables, page dimensions and optional confidence scores, plus pages_processed and any document_annotation you asked for. Use this to turn a document into markdown or extract structured fields with a JSON schema. Use mistral_create_chat_completion with a document_url chunk to ask questions about a document instead. Billed per page processed.
Inputs
modelstringrequired- OCR model to use. mistral-ocr-latest points to the newest OCR model; pinned versions such as mistral-ocr-2512 are also accepted.
bbox_annotation_formatobject- Describe each extracted image or figure with a JSON object that follows your schema, returned as images[].image_annotation. Shape: {"type": "json_schema", "json_schema": {"name": "figure", "schema": {...}}}. Only json_schema is accepted.
confidence_scores_granularitystring- Add OCR confidence scores per page, per block or per word. Leave empty for no scores, which keeps the response small.one of
pageblockword document_annotation_formatobject- Extract structured data from the whole document into a JSON object that follows your schema, returned as document_annotation. Shape: {"type": "json_schema", "json_schema": {"name": "invoice", "schema": {...}, "strict": true}}. Only json_schema is accepted.
document_annotation_promptstring- Instructions that guide the document-level extraction. Needs document_annotation_format. Example: Extract the invoice number, date and total amount.
document_namestring- Optional file name for a document_url input, returned with the result. Example: invoice-2026-03.pdf.
document_urlstring- Document to read, as a public URL or a base64 data URI. Supports PDF, PPTX, DOCX and other document formats, up to 50 MB and 1,000 pages. Example: https://arxiv.org/pdf/2201.04234 or data:application/pdf;base64,JVBERi0x... Provide exactly one of document_url, image_url or file_id.
extract_footerboolean- Move each page's footer out of the markdown into the page's footer field. Default false. Needs OCR 2512 or newer.
extract_headerboolean- Move each page's header out of the markdown into the page's header field. Default false. Needs OCR 2512 or newer.
file_idstring- ID of a file already uploaded to Mistral with purpose ocr (see mistral_list_files). Provide exactly one of document_url, image_url or file_id. Example: 6a5bd9f5-0d4e-4bd0-a6f2-2d2c3b1e7c11.
image_limitinteger- Maximum number of images to extract from the document. Example: 10.
image_min_sizeinteger- Only extract images whose height and width are at least this many pixels. Example: 100.
image_urlstring- Image to read, as a public URL or a base64 data URI. Supports PNG, JPEG, AVIF and other image formats. Example: https://example.com/receipt.png or data:image/png;base64,iVBORw0KGgo... Provide exactly one of document_url, image_url or file_id.
include_blocksboolean- Return paragraph-level bounding boxes for each content block. Mistral's default is true; set false for a smaller response.
include_image_base64boolean- Return each extracted image as a base64 data URI in images[].image_base64. This can make the response very large. Default false.
pagesstring- Pages to process, numbered from 0. A string of numbers and ranges such as "0,2-4", or an array of integers such as [0, 1, 2]. Leave empty to process every page.
table_formatstring- How to return tables: markdown keeps them inline in each page's markdown, html returns them separately in each page's tables with placeholders in the markdown. Leave empty for the model default. Needs OCR 2512 or newer.one of
markdownhtml
mistral_restart_conversationBranch a Mistral conversation from an earlier entry: keep the history up to that entry, add new inputs and run a new reply.WriteRestart Conversation
Branch a Mistral conversation from an earlier entry: keep the history up to that entry, add new inputs and run a new reply. Returns the new conversation_id, the new output entries and token usage; the original conversation is unchanged. Use this to retry or explore an alternative from a past turn. Use mistral_append_to_conversation to continue from the latest entry.
Inputs
conversation_idstringrequired- ID of the conversation to branch from. Example: conv_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.
from_entry_idstringrequired- ID of the entry to restart from, from mistral_get_conversation_history. Entries after it are left out of the new conversation. Example: msg_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.
agent_versioninteger- Agent version number or alias to use for the new branch. Leave empty for the current version.
completion_argsobject- Default generation settings for the agent or conversation: temperature, top_p, max_tokens, random_seed, stop, presence_penalty, frequency_penalty, tool_choice (auto, none, any or required), reasoning_effort and response_format (same shapes as in chat completions). Example: {"temperature": 0.3, "max_tokens": 1024}.
handoff_executionstring- With multi-agent handoffs: server lets Mistral run the handoff, client returns it to you to perform.one of
serverclient inputsstring- What to add to the conversation: a plain string is sent as one user message. For more control pass an array of entries, such as [{"type": "message.input", "role": "user", "content": "..."}], or, to answer a function call the model made, [{"type": "function.result", "tool_call_id": "<id from the function.call entry>", "result": "<your result as a string>"}]. Example: "Summarise the key points of our last discussion."
metadataobject- Your own key-value metadata for the new conversation. Example: {"branch": "retry-1"}.
storeboolean- Whether Mistral stores the new conversation. Default true.
mistral_start_conversationStart a new server-stored conversation with a Mistral model or agent, send the first inputs and run the reply, including built-in tools such as web search or code interpreter.WriteStart Conversation
Start a new server-stored conversation with a Mistral model or agent, send the first inputs and run the reply, including built-in tools such as web search or code interpreter. Returns the conversation_id, the new output entries (assistant messages, tool executions or function calls) and token usage. Use this when you want Mistral to keep the history. Continue with mistral_append_to_conversation, branch with mistral_restart_conversation, or use mistral_create_chat_completion for a stateless call. Usage is billed to the API key's workspace.
Inputs
inputsstringrequired- What to add to the conversation: a plain string is sent as one user message. For more control pass an array of entries, such as [{"type": "message.input", "role": "user", "content": "..."}], or, to answer a function call the model made, [{"type": "function.result", "tool_call_id": "<id from the function.call entry>", "result": "<your result as a string>"}]. Example: "Summarise the key points of our last discussion."
agent_idstring- Agent to run the conversation with, instead of a model. Provide agent_id or model. Example: ag_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.
agent_versioninteger- Version number or alias of the agent to use. Leave empty for the agent's current version. Example: 3.
completion_argsobject- Default generation settings for the agent or conversation: temperature, top_p, max_tokens, random_seed, stop, presence_penalty, frequency_penalty, tool_choice (auto, none, any or required), reasoning_effort and response_format (same shapes as in chat completions). Example: {"temperature": 0.3, "max_tokens": 1024}.
descriptionstring- Description of the conversation. Example: Review of the ACME master services agreement.
handoff_executionstring- With multi-agent handoffs: server lets Mistral run the handoff, client returns it to you to perform.one of
serverclient instructionsstring- System instructions for a model-based conversation. Example: You are a helpful legal assistant. Answer briefly.
metadataobject- Your own key-value metadata for the conversation. Example: {"customer_id": "cus_123"}.
modelstring- Model to run the conversation with, when not using an agent. Provide model or agent_id. Example: mistral-medium-latest.
namestring- Name for the conversation. Example: Contract review - ACME.
storeboolean- Whether Mistral stores the conversation so you can continue it later. Default true; set false for a one-off exchange.
toolsarray- Tools the agent can use. Built-in tools: {"type": "web_search"}, {"type": "web_search_premium"}, {"type": "code_interpreter"}, {"type": "image_generation"} and {"type": "document_library", "library_ids": ["<library id>"]}. Your own functions use {"type": "function", "function": {"name": ..., "description": ..., "parameters": <JSON Schema>}}; the conversation then pauses with a function.call entry until you send back a function.result. Example: [{"type": "web_search"}].
mistral_update_agentChange a Mistral agent's name, model, instructions, tools, settings or metadata; only the fields you provide change, and each update creates a new agent version.WriteUpdate Agent
Change a Mistral agent's name, model, instructions, tools, settings or metadata; only the fields you provide change, and each update creates a new agent version. Returns the updated agent with its new version number. Use this to adjust an existing agent. Use mistral_create_agent for a new one.
Inputs
agent_idstringrequired- ID of the agent to update. Example: ag_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.
completion_argsobject- Default generation settings for the agent or conversation: temperature, top_p, max_tokens, random_seed, stop, presence_penalty, frequency_penalty, tool_choice (auto, none, any or required), reasoning_effort and response_format (same shapes as in chat completions). Example: {"temperature": 0.3, "max_tokens": 1024}.
descriptionstring- Short description of what the agent does. Example: Flags risky clauses in contracts.
handoffsarray- IDs of other agents this agent can hand the conversation to. Example: ["ag_0195b2f2a6f97c3bb6b1c0f5e1a2d3c5"].
instructionsstring- System instructions the agent follows in every conversation. Example: You review contracts and list risky clauses with a short reason for each.
metadataobject- Your own key-value metadata for the agent. Example: {"team": "legal"}.
modelstring- Model the agent runs on. Example: mistral-medium-latest.
namestring- Name of the agent. Example: Contract reviewer.
toolsarray- Tools the agent can use. Built-in tools: {"type": "web_search"}, {"type": "web_search_premium"}, {"type": "code_interpreter"}, {"type": "image_generation"} and {"type": "document_library", "library_ids": ["<library id>"]}. Your own functions use {"type": "function", "function": {"name": ..., "description": ..., "parameters": <JSON Schema>}}; the conversation then pauses with a function.call entry until you send back a function.result. Example: [{"type": "web_search"}].
version_messagestring- Note describing this version of the agent. Example: Added web search.
mistral_delete_agentPermanently delete a Mistral agent and all its versions.DestructiveDelete Agent
Permanently delete a Mistral agent and all its versions. Returns an empty result on success (HTTP 204). Use this to remove an agent you no longer need. This cannot be undone, and conversations can no longer use the agent.
- Idempotent
Inputs
agent_idstringrequired- ID of the agent to delete. Example: ag_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.
mistral_delete_conversationPermanently delete a stored Mistral conversation and its history.DestructiveDelete Conversation
Permanently delete a stored Mistral conversation and its history. Returns an empty result on success (HTTP 204). Use this to remove a conversation you no longer need. This cannot be undone.
- Idempotent
Inputs
conversation_idstringrequired- ID of the conversation to delete. Example: conv_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.
mistral_delete_filePermanently delete a file from your Mistral workspace.DestructiveDelete File
Permanently delete a file from your Mistral workspace. Returns the file id, object and deleted: true. Use this to remove uploaded inputs or batch results you no longer need. This cannot be undone.
- Idempotent
Inputs
file_idstringrequired- ID of the file to delete. Example: 6a5bd9f5-0d4e-4bd0-a6f2-2d2c3b1e7c11.
No tools match.