> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to Mistral AI

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.

**Authentication:** Bearer Token
**Categories:** AI, Files & Documents
**Tools:** 32: 13 read, 16 write, 3 destructive
**Users sign in with:** Access token
**Built by:** Scalekit connector
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=MISTRAL)

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
   SCALEKIT_CLIENT_ID=<your-client-id>
   SCALEKIT_CLIENT_SECRET=<your-client-secret>
   ```

3. ### Create the Mistral AI connection

   In **AgentKit > Connections**, create a Mistral AI connection. The name you give it is the `connection_name` your code passes. See [Configure connections](/agentkit/connections/).

4. ### Authorize a user and make your first call

   **Node.js** (`quickstart.mts`)

   ```typescript
   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.actions

   const connector = 'mistral'
   const identifier = 'user_123'

   // Generate an authorization link for the user
   const { 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 call
   const result = await actions.executeTool({
     connector,
     identifier,
     toolName: 'mistral_list_agents',
     toolInput: {},
   })
   console.log(result)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_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.actions

   connection_name = "mistral"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_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 call
   result = actions.execute_tool(
       tool_input={},
       tool_name="mistral_list_agents",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user opens the link once and enters their Mistral AI credentials there. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'mistral_get_agent',
  toolInput: {
    agent_id: '<agent_id>',
  },
  connector: 'mistral',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="mistral_get_agent",
    tool_input={
        "agent_id": "<agent_id>",
    },
    connection_name="mistral",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `mistral_get_agent`

Get Agent · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `agent_id` (`string`, required): ID of the agent, from mistral_list_agents. Example: ag_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.
- `agent_version` (`integer`, optional): Version number or alias to get. Leave empty for the current version. Example: 2.

Example input: `{"agent_id":"<agent_id>"}`

### `mistral_get_batch_job`

Get Batch Job · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `job_id` (`string`, required): ID of the batch job, from mistral_list_batch_jobs or mistral_create_batch_job. Example: 9c1e3b2a-5d4f-4e6a-8b7c-1d2e3f4a5b6c.
- `inline` (`boolean`, optional): 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.

Example input: `{"job_id":"<job_id>"}`

### `mistral_get_conversation`

Get Conversation · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `conversation_id` (`string`, required): ID of the conversation. Example: conv_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.

Example input: `{"conversation_id":"<conversation_id>"}`

### `mistral_get_conversation_history`

Get Conversation History · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `conversation_id` (`string`, required): ID of the conversation. Example: conv_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.

Example input: `{"conversation_id":"<conversation_id>"}`

### `mistral_get_file`

Get File · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `file_id` (`string`, required): ID of the file, from mistral_list_files or a batch job's output_file. Example: 6a5bd9f5-0d4e-4bd0-a6f2-2d2c3b1e7c11.

Example input: `{"file_id":"<file_id>"}`

### `mistral_get_file_signed_url`

Get File Signed URL · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `file_id` (`string`, required): ID of the file to download, for example a batch job's output_file. Example: 6a5bd9f5-0d4e-4bd0-a6f2-2d2c3b1e7c11.
- `expiry` (`integer`, optional): Hours until the URL stops working, from 1 to 168. Mistral's default is 24. Example: 24.

Example input: `{"file_id":"<file_id>"}`

### `mistral_get_model`

Get Model · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `model_id` (`string`, required): ID or alias of the model, as returned by mistral_list_models. Example: mistral-large-latest.

Example input: `{"model_id":"<model_id>"}`

### `mistral_list_agents`

List Agents · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `name` (`string`, optional): Only return agents with exactly this name. Example: Contract reviewer.
- `page_size` (`integer`, optional): Agents per page. Mistral's default is 20. Example: 20.
- `page_token` (`string`, optional): Cursor for the next page: the next_page_token from the previous response. Leave empty for the first page.
- `search` (`string`, optional): Only return agents whose name or ID contains this text. Example: contract.
- `sources` (`array`, optional): Only return agents created in these places: api, playground or agent_builder_v1. Example: ["api"].

Example input: `{}`

### `mistral_list_batch_jobs`

List Batch Jobs · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `agent_id` (`string`, optional): Only return jobs that use this agent. Example: ag_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.
- `created_after` (`string`, optional): Only return jobs created after this ISO 8601 date-time. Example: 2026-10-01T00:00:00Z.
- `created_by_me` (`boolean`, optional): true returns only the jobs created by the API key's own user. Default false.
- `model` (`string`, optional): Only return jobs that use this model. Example: mistral-small-latest.
- `order_by` (`string`, optional): Sort by creation time: -created for newest first (default) or created for oldest first. One of: `created`, `-created`.
- `page` (`integer`, optional): Page number, starting at 0. Example: 0.
- `page_size` (`integer`, optional): Jobs per page. Mistral's default is 100. Example: 20.
- `status` (`array`, optional): Only return jobs in these statuses: QUEUED, RUNNING, SUCCESS, FAILED, TIMEOUT_EXCEEDED, CANCELLATION_REQUESTED, CANCELLED. Example: ["RUNNING", "QUEUED"].

Example input: `{}`

### `mistral_list_conversation_messages`

List Conversation Messages · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `conversation_id` (`string`, required): ID of the conversation. Example: conv_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.

Example input: `{"conversation_id":"<conversation_id>"}`

### `mistral_list_conversations`

List Conversations · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `page` (`integer`, optional): Page number, starting at 0. Example: 0.
- `page_size` (`integer`, optional): Conversations per page. Mistral's default is 100. Example: 20.

Example input: `{}`

### `mistral_list_files`

List Files · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `page` (`integer`, optional): Page number, starting at 0. Example: 0.
- `page_size` (`integer`, optional): Files per page. Mistral's default is 100. Example: 20.
- `purpose` (`string`, optional): Only return files uploaded for this purpose: fine-tune, batch, ocr or agentic_safety. Example: batch. One of: `fine-tune`, `batch`, `ocr`, `agentic_safety`.
- `sample_type` (`array`, optional): Only return files of these sample types: pretrain, instruct, batch_request, batch_result or batch_error. Example: ["batch_result"].
- `search` (`string`, optional): Only return files whose name matches this text. Example: invoices.
- `source` (`array`, optional): Only return files from these sources: upload, repository or mistral (files Mistral created, such as batch outputs). Example: ["mistral"].

Example input: `{}`

### `mistral_list_models`

List Models · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `mistral_append_to_conversation`

Append to Conversation · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `conversation_id` (`string`, required): ID of the conversation to continue, from mistral_start_conversation or mistral_list_conversations. Example: conv_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.
- `inputs` (`string`, required): 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_args` (`object`, optional): 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_execution` (`string`, optional): With multi-agent handoffs: server lets Mistral run the handoff, client returns it to you to perform. One of: `server`, `client`.
- `store` (`boolean`, optional): Whether Mistral stores the new entries. Default true.

Example input: `{"conversation_id":"<conversation_id>","inputs":"Summarise the key points of our last discussion."}`

### `mistral_cancel_batch_job`

Cancel Batch Job · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `job_id` (`string`, required): ID of the batch job to cancel. Example: 9c1e3b2a-5d4f-4e6a-8b7c-1d2e3f4a5b6c.

Example input: `{"job_id":"<job_id>"}`

### `mistral_classify_chat`

Classify Chat · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `input` (`object`, required): The conversation to classify as {"messages": [{"role": "user", "content": "..."}, ...]}, or an array of such objects to classify several conversations in one call.
- `model` (`string`, required): 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).

Example input: `{"input":{},"model":"<model>"}`

### `mistral_classify_text`

Classify Text · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `input` (`string`, required): Text to classify: one string, or an array of strings to classify in one call. Example: ["The delivery was late again", "Great support!"].
- `model` (`string`, required): 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).

Example input: `{"input":"<input>","model":"<model>"}`

### `mistral_create_agent`

Create Agent · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `model` (`string`, required): Model the agent runs on. Example: mistral-medium-latest.
- `name` (`string`, required): Name of the agent. Example: Contract reviewer.
- `completion_args` (`object`, optional): 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}.
- `description` (`string`, optional): Short description of what the agent does. Example: Flags risky clauses in contracts.
- `handoffs` (`array`, optional): IDs of other agents this agent can hand the conversation to. Example: ["ag_0195b2f2a6f97c3bb6b1c0f5e1a2d3c5"].
- `instructions` (`string`, optional): System instructions the agent follows in every conversation. Example: You review contracts and list risky clauses with a short reason for each.
- `metadata` (`object`, optional): Your own key-value metadata for the agent. Example: {"team": "legal"}.
- `tools` (`array`, optional): 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_message` (`string`, optional): Note describing this version of the agent. Example: Added web search.

Example input: `{"model":"<model>","name":"<name>"}`

### `mistral_create_agent_completion`

Create Agent Completion · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `agent_id` (`string`, required): ID of the agent to run, from mistral_list_agents or Mistral AI Studio. Example: ag_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.
- `messages` (`array`, required): 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_tokens` (`integer`, optional): 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_seed` (`integer`, optional): Seed for random sampling. The same seed and inputs give repeatable results. Example: 42.
- `response_format` (`object`, optional): 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"}.
- `stop` (`string`, optional): Stop generating when the model writes this string, or any string in this array. Example: ["\n\n", "END"].
- `tool_choice` (`string`, optional): auto, none, any or required, or {"type": "function", "function": {"name": "..."}} to force one function. Example: auto.
- `tools` (`array`, optional): 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"]}}}]

Example input: `{"agent_id":"<agent_id>","messages":[{"role":"system","content":"You are a concise assistant."},{"role":"user","content":"Who is the best French painter? Answer in one sentence."}]}`

### `mistral_create_batch_job`

Create Batch Job · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `endpoint` (`string`, required): 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_id` (`string`, optional): Agent to run every request with, instead of a model. Example: ag_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.
- `input_files` (`array`, optional): 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"].
- `metadata` (`object`, optional): Your own key-value metadata for the job. Example: {"job_type": "nightly-summaries"}.
- `model` (`string`, optional): Model to run every request with. Provide model or agent_id. Example: mistral-small-latest.
- `requests` (`array`, optional): 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_hours` (`integer`, optional): Hours after which unfinished requests time out. Mistral's default is 24. Example: 24.

Example input: `{"endpoint":"/v1/chat/completions"}`

### `mistral_create_chat_completion`

Create Chat Completion · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `messages` (`array`, required): 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."}]
- `model` (`string`, required): 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_penalty` (`number`, optional): From -2 to 2. Higher values discourage repeating words that already appear often in the output. Example: 0.5.
- `max_tokens` (`integer`, optional): 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.
- `n` (`integer`, optional): Number of completions to generate for the request; each is returned as a separate choice. Input tokens are billed once. Example: 2.
- `parallel_tool_calls` (`boolean`, optional): Whether the model may call several tools in one turn. Mistral's default is true. Example: false.
- `prediction` (`object`, optional): 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_penalty` (`number`, optional): From -2 to 2. Higher values push the model to use a wider variety of words and topics. Example: 0.5.
- `prompt_mode` (`string`, optional): Set to reasoning to use Mistral's reasoning system prompt with reasoning (Magistral) models. Leave empty otherwise. One of: `reasoning`.
- `random_seed` (`integer`, optional): Seed for random sampling. The same seed and inputs give repeatable results. Example: 42.
- `reasoning_effort` (`string`, optional): How much the model reasons before answering, on models that support adjustable reasoning: none, minimal, low, medium, high or xhigh. Example: medium. One of: `none`, `minimal`, `low`, `medium`, `high`, `xhigh`.
- `response_format` (`object`, optional): 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_prompt` (`boolean`, optional): Prepend Mistral's safety system prompt to the conversation. Default false. Example: true.
- `service_tier` (`string`, optional): auto serves the request on priority capacity when your workspace has it; standard_only always uses standard capacity. One of: `auto`, `standard_only`.
- `stop` (`string`, optional): Stop generating when the model writes this string, or any string in this array. Example: ["\n\n", "END"].
- `temperature` (`number`, optional): 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_choice` (`string`, optional): 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.
- `tools` (`array`, optional): 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_p` (`number`, optional): 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.

Example input: `{"messages":[{"role":"system","content":"You are a concise assistant."},{"role":"user","content":"Who is the best French painter? Answer in one sentence."}],"model":"<model>"}`

### `mistral_create_embeddings`

Create Embeddings · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `input` (`string`, required): Text to embed: one string, or an array of strings to embed in one call. Example: ["First passage", "Second passage"].
- `model` (`string`, required): Embedding model: mistral-embed for general text, or codestral-embed for code.
- `encoding_format` (`string`, optional): float returns each embedding as an array of numbers; base64 returns it as a base64 string, which is smaller. Default float. One of: `float`, `base64`.
- `output_dimension` (`integer`, optional): 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_dtype` (`string`, optional): Number type of each vector element, on models that support it: float (default), int8, uint8, binary or ubinary. One of: `float`, `int8`, `uint8`, `binary`, `ubinary`.

Example input: `{"input":"<input>","model":"<model>"}`

### `mistral_create_fim_completion`

Create FIM Completion · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `model` (`string`, required): Codestral model with fill-in-the-middle support, for example codestral-latest.
- `prompt` (`string`, required): Code before the gap; the model writes what comes next. Example: def fibonacci(n: int):
- `max_tokens` (`integer`, optional): 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_tokens` (`integer`, optional): Minimum number of tokens to generate. Example: 10.
- `random_seed` (`integer`, optional): Seed for random sampling. The same seed and inputs give repeatable results. Example: 42.
- `stop` (`string`, optional): Stop generating when the model writes this string, or any string in this array. Example: ["\n\n", "END"].
- `suffix` (`string`, optional): 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
- `temperature` (`number`, optional): 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_p` (`number`, optional): 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.

Example input: `{"model":"<model>","prompt":"<prompt>"}`

### `mistral_moderate_chat`

Moderate Chat · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `input` (`array`, required): 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": "..."}].
- `model` (`string`, required): Moderation model, usually mistral-moderation-latest.

Example input: `{"input":[{"role":"user","content":"..."},{"role":"assistant","content":"..."}],"model":"<model>"}`

### `mistral_moderate_text`

Moderate Text · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `input` (`string`, required): Text to moderate: one string, or an array of strings to check in one call. Example: ["First text", "Second text"].
- `model` (`string`, required): Moderation model, usually mistral-moderation-latest.

Example input: `{"input":"<input>","model":"<model>"}`

### `mistral_ocr_document`

OCR Document · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `model` (`string`, required): 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_format` (`object`, optional): 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_granularity` (`string`, optional): Add OCR confidence scores per page, per block or per word. Leave empty for no scores, which keeps the response small. One of: `page`, `block`, `word`.
- `document_annotation_format` (`object`, optional): 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_prompt` (`string`, optional): Instructions that guide the document-level extraction. Needs document_annotation_format. Example: Extract the invoice number, date and total amount.
- `document_name` (`string`, optional): Optional file name for a document_url input, returned with the result. Example: invoice-2026-03.pdf.
- `document_url` (`string`, optional): 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_footer` (`boolean`, optional): Move each page's footer out of the markdown into the page's footer field. Default false. Needs OCR 2512 or newer.
- `extract_header` (`boolean`, optional): Move each page's header out of the markdown into the page's header field. Default false. Needs OCR 2512 or newer.
- `file_id` (`string`, optional): 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_limit` (`integer`, optional): Maximum number of images to extract from the document. Example: 10.
- `image_min_size` (`integer`, optional): Only extract images whose height and width are at least this many pixels. Example: 100.
- `image_url` (`string`, optional): 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_blocks` (`boolean`, optional): Return paragraph-level bounding boxes for each content block. Mistral's default is true; set false for a smaller response.
- `include_image_base64` (`boolean`, optional): Return each extracted image as a base64 data URI in images[].image_base64. This can make the response very large. Default false.
- `pages` (`string`, optional): 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_format` (`string`, optional): 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: `markdown`, `html`.

Example input: `{"model":"<model>"}`

### `mistral_restart_conversation`

Restart Conversation · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `conversation_id` (`string`, required): ID of the conversation to branch from. Example: conv_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.
- `from_entry_id` (`string`, required): 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_version` (`integer`, optional): Agent version number or alias to use for the new branch. Leave empty for the current version.
- `completion_args` (`object`, optional): 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_execution` (`string`, optional): With multi-agent handoffs: server lets Mistral run the handoff, client returns it to you to perform. One of: `server`, `client`.
- `inputs` (`string`, optional): 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."
- `metadata` (`object`, optional): Your own key-value metadata for the new conversation. Example: {"branch": "retry-1"}.
- `store` (`boolean`, optional): Whether Mistral stores the new conversation. Default true.

Example input: `{"conversation_id":"<conversation_id>","from_entry_id":"<from_entry_id>"}`

### `mistral_start_conversation`

Start Conversation · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `inputs` (`string`, required): 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_id` (`string`, optional): Agent to run the conversation with, instead of a model. Provide agent_id or model. Example: ag_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.
- `agent_version` (`integer`, optional): Version number or alias of the agent to use. Leave empty for the agent's current version. Example: 3.
- `completion_args` (`object`, optional): 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}.
- `description` (`string`, optional): Description of the conversation. Example: Review of the ACME master services agreement.
- `handoff_execution` (`string`, optional): With multi-agent handoffs: server lets Mistral run the handoff, client returns it to you to perform. One of: `server`, `client`.
- `instructions` (`string`, optional): System instructions for a model-based conversation. Example: You are a helpful legal assistant. Answer briefly.
- `metadata` (`object`, optional): Your own key-value metadata for the conversation. Example: {"customer_id": "cus_123"}.
- `model` (`string`, optional): Model to run the conversation with, when not using an agent. Provide model or agent_id. Example: mistral-medium-latest.
- `name` (`string`, optional): Name for the conversation. Example: Contract review - ACME.
- `store` (`boolean`, optional): Whether Mistral stores the conversation so you can continue it later. Default true; set false for a one-off exchange.
- `tools` (`array`, optional): 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"}].

Example input: `{"inputs":"Summarise the key points of our last discussion."}`

### `mistral_update_agent`

Update Agent · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `agent_id` (`string`, required): ID of the agent to update. Example: ag_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.
- `completion_args` (`object`, optional): 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}.
- `description` (`string`, optional): Short description of what the agent does. Example: Flags risky clauses in contracts.
- `handoffs` (`array`, optional): IDs of other agents this agent can hand the conversation to. Example: ["ag_0195b2f2a6f97c3bb6b1c0f5e1a2d3c5"].
- `instructions` (`string`, optional): System instructions the agent follows in every conversation. Example: You review contracts and list risky clauses with a short reason for each.
- `metadata` (`object`, optional): Your own key-value metadata for the agent. Example: {"team": "legal"}.
- `model` (`string`, optional): Model the agent runs on. Example: mistral-medium-latest.
- `name` (`string`, optional): Name of the agent. Example: Contract reviewer.
- `tools` (`array`, optional): 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_message` (`string`, optional): Note describing this version of the agent. Example: Added web search.

Example input: `{"agent_id":"<agent_id>"}`

### `mistral_delete_agent`

Delete Agent · Destructive

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.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `agent_id` (`string`, required): ID of the agent to delete. Example: ag_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.

Example input: `{"agent_id":"<agent_id>"}`

### `mistral_delete_conversation`

Delete Conversation · Destructive

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.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `conversation_id` (`string`, required): ID of the conversation to delete. Example: conv_0195b2f2a6f97c3bb6b1c0f5e1a2d3c4.

Example input: `{"conversation_id":"<conversation_id>"}`

### `mistral_delete_file`

Delete File · Destructive

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.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `file_id` (`string`, required): ID of the file to delete. Example: 6a5bd9f5-0d4e-4bd0-a6f2-2d2c3b1e7c11.

Example input: `{"file_id":"<file_id>"}`

## Related

Other AI connectors ([all 148](/agentkit/connectors/?category=ai)):

- [Chorus](/agentkit/connectors/chorus/): Scalekit connector, Username and password, 9 tools
- [Gong](/agentkit/connectors/gong/): Scalekit connector, OAuth, 69 tools
- [Jiminny](/agentkit/connectors/jiminny/): Scalekit connector, Access token, 27 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
