# Mistral AI

> Use Mistral AI in your workflows: answer questions and write text with its chat models, read documents and pull data out of them with Mistral OCR, transcribe recordings with Voxtral, moderate content, and create embeddings for semantic search.

App · AI Models · 7 actions. Web page: https://docs.lodol.com/docs/integrations/mistral

## Actions

### Create embeddings

Turn texts into vectors for semantic search, finding similar items or clustering, ready to store in a vector database.

**Inputs**

- Texts (`texts`, list, required): The texts to embed, one per entry. Each comes back as one vector, in the same order.
- Model (`model`, text): Which embedding model to use. Defaults to mistral-embed. One of: `mistral-embed` (Mistral Embed (text, recommended)), `codestral-embed` (Codestral Embed (code)). Default: `mistral-embed`.
- Dimensions (`dimensions`, number): How many numbers each vector has, for a vector database that expects a set size. Only Codestral Embed can change it, up to 3,072. Leave blank for the model's own size.

**Outputs**

- `count` (number): How many vectors there are.
- `dimensions` (number): How many numbers each vector has.
- `embedding` (list): The first text's vector.
- `embeddings` (list): One vector per text, in the same order.
- `model` (text): The embedding model used.
- `total_tokens` (number): Tokens billed for the request.

**Example output**

```json
{
  "count": 2,
  "dimensions": 3,
  "embedding": [
    0.012,
    -0.043,
    0.031
  ],
  "embeddings": [
    [
      0.012,
      -0.043,
      0.031
    ],
    [
      0.018,
      -0.039,
      0.027
    ]
  ],
  "model": "mistral-embed",
  "total_tokens": 12
}
```

### Extract data from a document

Pull the fields you name, such as an invoice's number, date and total, out of a PDF, Word or PowerPoint file, or a photo or scan. A field the document doesn't contain comes back empty rather than guessed.

**Inputs**

- Document (`document`, text, required): The document to read: upload a file, pick one an earlier step produced, or paste a link to one. PDFs, Word and PowerPoint files, and images such as photos or scans all work, up to 50 MB and 1,000 pages.
- Fields to fill (`fields`, list, required): The pieces of information you want back, one per entry. Add what each means after a colon to steer it: 'total: the amount due, with its currency'.
- Instructions (`instructions`, text): Optional guidance on how to fill the fields, such as 'Write dates as YYYY-MM-DD' or 'Give amounts without a currency symbol'.
- Pages (`pages`, text): Which pages to read, counting from 1, such as '1-3, 5'. Leave blank to read every page.

**Outputs**

- `data` (object): Each field you named, with its value from the document, or empty when the document doesn't contain it.
- `found_fields` (list): The fields that were found.
- `missing_fields` (list): The fields the document doesn't contain.
- `model` (text): The Mistral OCR model that read the document.
- `page_count` (number): How many pages were read.
- `text` (text): The text of every page read, as Markdown, from the same pass.

**Example output**

```json
{
  "data": {
    "invoice date": "2026-09-14",
    "invoice number": "INV-2041",
    "purchase order": null,
    "total": "$1,200.00"
  },
  "found_fields": [
    "invoice number",
    "invoice date",
    "total"
  ],
  "missing_fields": [
    "purchase order"
  ],
  "model": "mistral-ocr-4-1",
  "page_count": 1,
  "text": "# Invoice INV-2041\n\nDate: 2026-09-14\nBilled to: Acme Corp\n\n| Item | Amount |\n| --- | --- |\n| Consulting | $1,200.00 |\n\n**Total due: $1,200.00**"
}
```

### Extract text from a document

Read a PDF, Word or PowerPoint file, or a photo or scan, with Mistral OCR and get its text back as Markdown, page by page, with tables and headings kept.

**Inputs**

- Document (`document`, text, required): The document to read: upload a file, pick one an earlier step produced, or paste a link to one. PDFs, Word and PowerPoint files, and images such as photos or scans all work, up to 50 MB and 1,000 pages.
- Pages (`pages`, text): Which pages to read, counting from 1, such as '1-3, 5'. Leave blank to read every page.
- Leave out page headers and footers (`remove_headers_and_footers`, true/false): Drop the text repeated at the top and bottom of each page, such as running titles and page numbers, so it doesn't interrupt the body text. Default: `false`.

**Outputs**

- `model` (text): The Mistral OCR model that read the document.
- `page_count` (number): How many pages were read.
- `pages` (list): Each page read, in order.
- `text` (text): The text of every page read, as Markdown, with a blank line between pages.

**Example output**

```json
{
  "model": "mistral-ocr-4-1",
  "page_count": 1,
  "pages": [
    {
      "page_number": 1,
      "text": "# Invoice INV-2041\n\nDate: 2026-09-14\nBilled to: Acme Corp\n\n| Item | Amount |\n| --- | --- |\n| Consulting | $1,200.00 |\n\n**Total due: $1,200.00**"
    }
  ],
  "text": "# Invoice INV-2041\n\nDate: 2026-09-14\nBilled to: Acme Corp\n\n| Item | Amount |\n| --- | --- |\n| Consulting | $1,200.00 |\n\n**Total due: $1,200.00**"
}
```

### Generate a Mistral response

Send a prompt to a Mistral AI model and get back its written response.

**Inputs**

- Prompt (`prompt`, text, required): The message or question to send to Mistral.
- System instructions (`system_prompt`, text): Optional instructions that set the model's role, tone, or output format for this request (e.g. 'You are a concise support agent. Reply in two sentences.').
- Model (`model`, text): Which Mistral model to use. Defaults to mistral-large-latest. Mistral's free plan leaves out Mistral Large, Medium and Small; Ministral and Codestral work on it. One of: `mistral-large-latest` (Mistral Large (most capable, recommended)), `mistral-medium-latest` (Mistral Medium (balanced quality and cost)), `mistral-small-latest` (Mistral Small (fast and low cost)), `ministral-8b-latest` (Ministral 8B (smallest and cheapest)), `codestral-latest` (Codestral (writing and explaining code)). Default: `mistral-large-latest`.
- Maximum response length (`max_tokens`, number): Maximum number of tokens Mistral may generate in its response. Raise it for longer replies. Leave blank to use the model's own default.
- Creativity (temperature) (`temperature`, number): How varied the response should be, from 0 (focused and predictable) to 1.5 (more creative). Mistral recommends staying between 0 and 0.7. Leave blank to use the model's own default.

**Outputs**

- `completion_tokens` (number): Number of tokens the response used.
- `finish_reason` (text): Why the model stopped generating, e.g. 'stop' when it finished or 'length' when it hit the response limit.
- `model` (text): The Mistral model that produced the response.
- `prompt_tokens` (number): Number of tokens the prompt used.
- `response_text` (text): The text Mistral generated for your prompt.
- `total_tokens` (number): Total tokens billed for this request.

**Example output**

```json
{
  "completion_tokens": 121,
  "finish_reason": "stop",
  "model": "mistral-large-latest",
  "prompt_tokens": 24,
  "response_text": "Here is a thoughtful response to your question about artificial intelligence and its applications in modern software development.",
  "total_tokens": 145
}
```

### List models

List the Mistral models your API key can use, including your fine-tuned ones, with what each can do, how much text it takes in, and when Mistral plans to retire it.

**Inputs**

- Can do (`capability`, text): Only list models that can do this, such as read images or transcribe audio. Leave on 'Anything' for every model. One of: `all` (Anything), `chat`, `vision` (Reads images), `reasoning` (Reasons step by step), `function_calling` (Calls tools), `code_completion` (Completes code), `ocr` (Reads documents (OCR)), `audio` (Understands audio in a chat), `audio_transcription` (Transcribes audio), `speech` (Reads text aloud), and 3 more. Default: `all`.

**Outputs**

- `count` (number): How many models were listed.
- `model_ids` (list): Every model's id, in the same order.
- `models` (list): Each model, sorted by id.

**Example output**

```json
{
  "count": 1,
  "model_ids": [
    "mistral-ocr-latest"
  ],
  "models": [
    {
      "aliases": [
        "mistral-ocr-4-1"
      ],
      "capabilities": [
        "ocr"
      ],
      "deprecation_date": "",
      "description": "Official mistral-ocr-4-1 Mistral AI model",
      "id": "mistral-ocr-latest",
      "max_context_length": 16384,
      "name": "mistral-ocr-4-1",
      "replacement_model": "",
      "type": "base"
    }
  ]
}
```

### Moderate text

Check text against Mistral's moderation categories, such as hate, violence, self-harm, personal data and jailbreak attempts, and get back which it falls into, with a score for each.

**Inputs**

- Text (`text`, text, required): The text to check, such as a customer message, a review or an AI-written reply.
- In reply to (`in_reply_to`, text): Optional: the message the text answers, such as the question an AI-written reply responds to. Mistral then judges the text in that context, so a reply can be flagged for what it helps with, not just what it says.

**Outputs**

- `categories` (object): Every category, true when the text falls into it.
- `category_scores` (object): Every category's score, from 0 (unlikely) to 1 (likely).
- `flagged` (true/false): Whether the text falls into any category.
- `flagged_categories` (list): The categories the text falls into, like 'pii' or 'violence_and_threats'.
- `highest_category` (text): The category with the highest score.
- `highest_score` (number): That category's score, from 0 to 1.
- `model` (text): The moderation model that checked the text.

**Example output**

```json
{
  "categories": {
    "criminal": false,
    "dangerous": false,
    "financial": false,
    "hate_and_discrimination": false,
    "health": false,
    "jailbreaking": false,
    "law": false,
    "pii": true,
    "selfharm": false,
    "sexual": false,
    "violence_and_threats": false
  },
  "category_scores": {
    "criminal": 0.0021,
    "dangerous": 0.0002,
    "financial": 0.0315,
    "hate_and_discrimination": 0.0011,
    "health": 0.0007,
    "jailbreaking": 0.0002,
    "law": 0.0009,
    "pii": 0.91,
    "selfharm": 0.0001,
    "sexual": 0.0004,
    "violence_and_threats": 0.0003
  },
  "flagged": true,
  "flagged_categories": [
    "pii"
  ],
  "highest_category": "pii",
  "highest_score": 0.91,
  "model": "mistral-moderation-2603"
}
```

### Transcribe audio

Turn a recording, such as a call, meeting or voice note, into text with Mistral's Voxtral, optionally labelled by speaker and timestamped.

**Inputs**

- Audio (`audio`, text, required): The recording to transcribe: upload a file, pick one an earlier step produced, or paste a link to one. Recordings of up to about three hours work.
- Language (`language`, text): The language being spoken. Leave it on automatic detection unless the recording is short or noisy enough to fool it. One of: `auto` (Detect automatically), `en` (English), `zh` (Chinese), `hi` (Hindi), `es` (Spanish), `ar` (Arabic), `fr` (French), `pt` (Portuguese), `ru` (Russian), `de` (German), and 4 more. Default: `auto`.
- Identify speakers (`identify_speakers`, true/false): Label who said what, so the transcript reads as a conversation. Mistral then times the transcript by segment. Default: `false`.
- Timestamps (`timestamps`, text): Note when each part was said, by segment (a phrase or sentence) or by word. With speakers identified, only segments can be timed. One of: `none`, `segment` (For each segment), `word` (For each word). Default: `none`.
- Words to listen for (`words_to_listen_for`, list): Names, jargon or product terms the recording uses, so they're spelled right: one per entry, up to 100 words. A phrase is listened for word by word.

**Outputs**

- `duration_seconds` (number): How long the recording is, in seconds.
- `language` (text): The language spoken, as a code like 'en', when Mistral reports it or you set it.
- `model` (text): The Voxtral model that transcribed it.
- `segments` (list): The transcript in timed stretches (segments, or single words with word timestamps), each with who said it when speakers were identified. Filled when you ask for speakers or timestamps.
- `speakers` (list): Each speaker, in the order they first spoke.
- `text` (text): Everything that was said.
- `transcript_by_speaker` (text): The transcript with one line per turn, like 'speaker_1: …', when speakers were identified.

**Example output**

```json
{
  "duration_seconds": 7,
  "language": "en",
  "model": "voxtral-mini-2602",
  "segments": [
    {
      "end": 3.1,
      "speaker": "speaker_1",
      "start": 0.4,
      "text": "Thanks for calling Acme support, this is Dana."
    },
    {
      "end": 6.2,
      "speaker": "speaker_2",
      "start": 3.6,
      "text": "Hi Dana, my invoice shows the wrong total."
    }
  ],
  "speakers": [
    "speaker_1",
    "speaker_2"
  ],
  "text": "Thanks for calling Acme support, this is Dana. Hi Dana, my invoice shows the wrong total.",
  "transcript_by_speaker": "speaker_1: Thanks for calling Acme support, this is Dana.\nspeaker_2: Hi Dana, my invoice shows the wrong total."
}
```
